Restore saved settings and balances before initializing defaults #22

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

Problem

Leave balances are currently initialized randomly instead of being restored from the browser. Theme preference starts in System on each visit.

Resulting behavior

Restore supported saved settings and readable saved leave balances during application startup. Initialization must preserve readable saved planning data.

Acceptance criteria

  • Restore theme preference, language, and week numbers before their controls are presented for use.
  • Restored System resolves the device's current appearance and continues following it; restored Light or Dark remains an explicit override.
  • Restore a readable saved balance list with the same quantities, leave types, identities, order, availability dates, and expiry dates before the initial planning calculation.
  • Keep saved dates unchanged, including expired dates. Existing planner validation and remaining-balance classification continue to handle the restored inputs.
  • A saved empty list is present data: restore it as empty and do not generate random balances.
  • When no saved balance list exists, use the random initialization specified in #23.
  • When saved balance data cannot be decoded into supported balance records, delete only that balance data and use the same random fallback. Unrelated settings and planning rules must remain intact.
  • Reading and restoring balances must not save untouched random defaults or overwrite readable saved balances.

Verification

Seed browser storage, create a fresh application/component instance, and inspect rendered settings and balance fields. Cover explicit and System theme restoration, dated balance restoration, an expired balance, a saved empty list, absent balance data, and unreadable balance data. Verify the deletion affects only unreadable balance storage.

Coordination

Uses the save format from #21 and the startup fallback from #23. Existing planning rules retain their local restoration behavior.

## Problem Leave balances are currently initialized randomly instead of being restored from the browser. Theme preference starts in System on each visit. ## Resulting behavior Restore supported saved settings and readable saved leave balances during application startup. Initialization must preserve readable saved planning data. ## Acceptance criteria - Restore theme preference, language, and week numbers before their controls are presented for use. - Restored System resolves the device's current appearance and continues following it; restored Light or Dark remains an explicit override. - Restore a readable saved balance list with the same quantities, leave types, identities, order, availability dates, and expiry dates before the initial planning calculation. - Keep saved dates unchanged, including expired dates. Existing planner validation and remaining-balance classification continue to handle the restored inputs. - A saved empty list is present data: restore it as empty and do not generate random balances. - When no saved balance list exists, use the random initialization specified in [#23](https://gitea.nessar.fr/nessar/vac-optimizer/issues/23). - When saved balance data cannot be decoded into supported balance records, delete only that balance data and use the same random fallback. Unrelated settings and planning rules must remain intact. - Reading and restoring balances must not save untouched random defaults or overwrite readable saved balances. ## Verification Seed browser storage, create a fresh application/component instance, and inspect rendered settings and balance fields. Cover explicit and System theme restoration, dated balance restoration, an expired balance, a saved empty list, absent balance data, and unreadable balance data. Verify the deletion affects only unreadable balance storage. ## Coordination Uses the save format from [#21](https://gitea.nessar.fr/nessar/vac-optimizer/issues/21) and the startup fallback from [#23](https://gitea.nessar.fr/nessar/vac-optimizer/issues/23). Existing planning rules retain their local restoration behavior.
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)

Completion audit — 2026-10-02

There is no user-settings restoration implementation. Existing language and calendar settings are restored independently. Specify the user settings to restore, together with #18 and #21.

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 There is no user-settings restoration implementation. Existing language and calendar settings are restored independently. Specify the user settings to restore, together with #18 and #21. 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:06 +02:00 (Migrated from 172.24.0.1:8928)

mentioned in issue #21

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

changed title from appliquer les reglages du localstorage to Restore saved settings and balances before initializing defaults

<p>changed title from <code class="idiff"><span class="idiff left right deletion">appliquer les reglages du localstorage</span></code> to <code class="idiff"><span class="idiff left right addition">Restore saved settings and balances before initializing defaults</span></code></p>
nessar commented 2026-10-04 21:18:09 +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:44 +02:00
nessar commented 2026-10-04 23:33:30 +02:00 (Migrated from 172.24.0.1:8928)

mentioned in commit b0ba4227ac

mentioned in commit b0ba4227ac499e78ff6a87c68fa404570e5c6581

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

gitlab-35-issue-22.md (SHA-256 587c54eaef60c04a7a001fada401228bd1f8b960f7a6b9f292badf9d17ac2980)

gitlab-35-issue-22.json (SHA-256 9ccebab97d0c79a1bc94cf48eba174038e95dfe7238cebdca4844278a601c952)

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

<!-- gitlab-to-gitea-history:35:Issue:22 --> Preserved GitLab #22 history: source attribution, exact timestamps, discussion grouping and review positions. Historical diff snapshots: 1; visible source notes: 9. [gitlab-35-issue-22.md](https://gitea.nessar.fr/attachments/610b93b2-65ff-4da7-a1c5-b95c5b2b9532) (SHA-256 `587c54eaef60c04a7a001fada401228bd1f8b960f7a6b9f292badf9d17ac2980`) [gitlab-35-issue-22.json](https://gitea.nessar.fr/attachments/3abcb707-085d-4e7f-9de8-ce4ba9f52016) (SHA-256 `9ccebab97d0c79a1bc94cf48eba174038e95dfe7238cebdca4844278a601c952`) 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#22