Automatically save settings and edited leave balances in the browser #21

Closed
opened 2025-11-03 16:37:22 +01:00 by admin-backup · 10 comments
admin-backup commented 2025-11-03 16:37:22 +01:00 (Migrated from 172.24.0.1:8928)

Problem

Theme selection and leave balances do not survive a new visit. Language, week-number settings, and planning rules already have local persistence.

Resulting behavior

Automatically save changes to theme preference, language, week numbers, and the current leave-balance list in browser storage.

Acceptance criteria

  • Theme, language, and week-number changes are saved as they are selected; closing the dialog or immediately revisiting must retain the selection.
  • Save the selected theme preference (System / Light / Dark), rather than System's currently resolved appearance.
  • Preserve existing language, calendar-setting, and planning-rule storage and behavior.
  • Save each balance's identity, order, quantity, leave type, availability date, and expiry date in a form that can restore the same calendar dates.
  • Random initial balances remain unsaved until the first balance edit. An edit includes changing a quantity, type, or date, adding a balance, or removing one.
  • The first balance edit saves the entire current list, including unchanged rows; every later balance edit saves the updated list automatically.
  • Removing the final balance saves an empty list. It must not remove the storage entry or make the next visit generate replacement balances.
  • Opening settings, changing preferences or planning rules, or calculating alone does not count as a balance edit and must not save untouched random defaults.

Verification

Exercise user interactions through the Settings and leave-input components with their real state services and controlled browser storage. Verify preference saving, preservation of unrelated stored values, no balance write before an edit, complete-list saving on an edit, date/identity preservation, and saving deletion of the last row.

Coordination

Defines the persistence contract consumed by #22. Random initialization and its unsaved state are covered by #23.

## Problem Theme selection and leave balances do not survive a new visit. Language, week-number settings, and planning rules already have local persistence. ## Resulting behavior Automatically save changes to theme preference, language, week numbers, and the current leave-balance list in browser storage. ## Acceptance criteria - Theme, language, and week-number changes are saved as they are selected; closing the dialog or immediately revisiting must retain the selection. - Save the selected theme preference (System / Light / Dark), rather than System's currently resolved appearance. - Preserve existing language, calendar-setting, and planning-rule storage and behavior. - Save each balance's identity, order, quantity, leave type, availability date, and expiry date in a form that can restore the same calendar dates. - Random initial balances remain unsaved until the first balance edit. An edit includes changing a quantity, type, or date, adding a balance, or removing one. - The first balance edit saves the entire current list, including unchanged rows; every later balance edit saves the updated list automatically. - Removing the final balance saves an empty list. It must not remove the storage entry or make the next visit generate replacement balances. - Opening settings, changing preferences or planning rules, or calculating alone does not count as a balance edit and must not save untouched random defaults. ## Verification Exercise user interactions through the Settings and leave-input components with their real state services and controlled browser storage. Verify preference saving, preservation of unrelated stored values, no balance write before an edit, complete-list saving on an edit, date/identity preservation, and saving deletion of the last row. ## Coordination Defines the persistence contract consumed by [#22](https://gitea.nessar.fr/nessar/vac-optimizer/issues/22). Random initialization and its unsaved state are covered by [#23](https://gitea.nessar.fr/nessar/vac-optimizer/issues/23).
nessar commented 2026-08-28 14:16:03 +02:00 (Migrated from 172.24.0.1:8928)

mentioned in issue #20

mentioned in issue #20
nessar commented 2026-10-02 14:54:43 +02:00 (Migrated from 172.24.0.1:8928)

mentioned in issue #22

mentioned in issue #22
nessar commented 2026-10-02 14:54:43 +02:00 (Migrated from 172.24.0.1:8928)

Completion audit — 2026-10-02

UserSettingsService is empty. Language and calendar settings persist independently, but the theme preference starts in System each session. Specify the user settings to persist; #20 explicitly excludes persistence.

Evidence: reviewed issue requirements/discussions and f1f0835 (published application source; live main 57a39c81 only adds Renovate configuration). Tested an isolated checkout of the published source: 20 test files, 157/157 tests passed, including the five benchmark scenarios. Local commit 51978f7 and uncommitted edits were inspected separately and are not evidence of published completion.

Completion audit — 2026-10-02 UserSettingsService is empty. Language and calendar settings persist independently, but the theme preference starts in System each session. Specify the user settings to persist; #20 explicitly excludes persistence. Evidence: reviewed issue requirements/discussions and f1f0835 (published application source; live main 57a39c81 only adds Renovate configuration). Tested an isolated checkout of the published source: 20 test files, 157/157 tests passed, including the five benchmark scenarios. Local commit 51978f7 and uncommitted edits were inspected separately and are not evidence of published completion.
nessar commented 2026-10-04 21:17:57 +02:00 (Migrated from 172.24.0.1:8928)

mentioned in issue #18

mentioned in issue #18
nessar commented 2026-10-04 21:18:02 +02:00 (Migrated from 172.24.0.1:8928)

mentioned in issue #19

mentioned in issue #19
nessar commented 2026-10-04 21:18:05 +02:00 (Migrated from 172.24.0.1:8928)

changed title from enregistrer les user settings dans le localstorage to Automatically save settings and edited leave balances in the browser

<p>changed title from <code class="idiff"><span class="idiff left deletion">enregistrer les user</span> settings <span class="idiff deletion">d</span>an<span class="idiff right deletion">s le localstorage</span></code> to <code class="idiff"><span class="idiff left addition">Automatically save</span> settings an<span class="idiff right addition">d edited leave balances in the browser</span></code></p>
nessar commented 2026-10-04 21:18:05 +02:00 (Migrated from 172.24.0.1:8928)

changed the description

changed the description
nessar commented 2026-10-04 21:18:12 +02:00 (Migrated from 172.24.0.1:8928)

mentioned in issue #23

mentioned in issue #23
nessar (Migrated from 172.24.0.1:8928) closed this issue 2026-10-04 23:19:39 +02:00
nessar commented 2026-10-04 23:33:30 +02:00 (Migrated from 172.24.0.1:8928)

mentioned in commit 578aafbf91

mentioned in commit 578aafbf9121e1071d9edcb7f8f7ebb47465734e

Preserved GitLab #21 history: source attribution, exact timestamps, discussion grouping and review positions. Historical diff snapshots: 1; visible source notes: 9.

gitlab-35-issue-21.md (SHA-256 1825daec8db8788fbc48b16eaef42be47bce53051e1e4446eaecb844e996a896)

gitlab-35-issue-21.json (SHA-256 2042e2c48433a47de79e00d4ac6de9584b81e346a6fcc223ae9eef9e45171f3c)

Old CI job execution and reports are omitted. Original source files and rollback backups remain protected.

<!-- gitlab-to-gitea-history:35:Issue:21 --> Preserved GitLab #21 history: source attribution, exact timestamps, discussion grouping and review positions. Historical diff snapshots: 1; visible source notes: 9. [gitlab-35-issue-21.md](https://gitea.nessar.fr/attachments/e2919dde-0b47-40dc-b726-cbd20271f452) (SHA-256 `1825daec8db8788fbc48b16eaef42be47bce53051e1e4446eaecb844e996a896`) [gitlab-35-issue-21.json](https://gitea.nessar.fr/attachments/c66f604f-f236-4371-9bc5-7b89ccbb8c92) (SHA-256 `2042e2c48433a47de79e00d4ac6de9584b81e346a6fcc223ae9eef9e45171f3c`) Old CI job execution and reports are omitted. Original source files and rollback backups remain protected.
gitea-emergency added this to the Development project 2026-10-11 22:14:31 +02:00
gitea-emergency moved this to Closed in Development on 2026-10-11 22:14:31 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: nessar/vac-optimizer#21