4.0 KiB
Whole-hour work entry
The /work view lists the selected day's entries and total, with an immediately available work form. Customer and project are required, the last active pair is preselected, and the description is optional. Users can create, edit, move or delete entries for today and earlier dates in the device timezone. An owner transaction enforces the twelve-hour daily total across concurrent writes, including moves between dates. Existing archived assignments can be retained during edits but cannot be selected for new assignments.
Versions protect changes and deletion. Request receipts ensure replayed saves/deletions do not duplicate work. A conflicting edit displays the currently stored date, assignment, hours and description beside the unchanged draft. An explicit action adopts exactly the displayed version as the draft's base; saving remains a separate action. Another intervening edit still conflicts. Reloading a stale draft preserves its original version rather than silently adopting the server version.
Browser input events save drafts locally with stable customer/project IDs, the owner identity and a separate tab identity. Reloading the same tab restores its draft; other drafts for that form on the device are offered for explicit recovery. Saving one tab cannot remove another tab's draft. A pending save retains its request ID across reload so the server receipt can resolve an uncertain outcome. Known failures keep the input editable. Successful saves remove the completed draft; discarding requires the user's explicit action. A device-storage failure is reported instead of promising unavailable persistence. Authentication and logout cleanup remain later nodes; the current owner is the requested shared guest account.
Verified behavior
The full local JVM build and production smoke pass. WorkServiceTest covers concurrent daily limits, idempotent saves/updates/deletions, timezone date boundaries, moving entries into a full day, archived assignments, foreign owners and receipt isolation. The added current-version lookup also rejects foreign owners.
The local browser exercise used an isolated migrated database:
- Saved work with the default customer/project and observed the updated daily total.
- Reloaded an unsaved draft and recovered its hours, text and selected IDs.
- Rejected a 13-hour daily total while retaining the draft.
- Stopped the local server, changed the description during the interruption, started the updated JAR and recovered the changed draft. No work was added until explicit save.
- Opened the same entry in two views. The second save conflicted, kept its own text and showed the first view's stored text. Reloading and reopening retained the stale draft. Explicitly adopting the displayed version and saving succeeded.
- Saved one tab while another had different unsaved input; reloading the second retained its own draft. Closed that tab, opened a new tab, explicitly recovered its draft, rebased and saved it without duplicate work.
- Cancelled deletion with unchanged totals, then confirmed deletion and observed the reduced total.
These are implementation checks, not a claim that the complete Gherkin browser suite, monthly reporting, real Android behavior, or authentication are finished. The work form was published and checked read-only on 2026-09-09 in release 6e6daa1; see deployment.md.
Approved journal layout
The work page now places its date selection, total and Record work action together in the Petrol summary card, next to the entry list. Create/edit opens the existing draft-aware WorkForm in a dialog. Today links explicitly request the new-entry dialog. Cancel closes the dialog while preserving its draft; saving refreshes entries and totals.
Production JAR build passed. Local browser verification: entered two hours, cancelled, reopened and observed the restored two-hour draft; explicit save closed the dialog and updated the daily total from three to five hours. No browser errors. Broader other-page design acceptance remains in progress.