Repository navigation
fix(settings): keep no earlier opening's anchor on a Settings opened again (#1949) - #2182
Conversation
…again (#1949) A Settings opening copies its base entry's state into its entries. When an earlier opening took over a phone sheet's entry, its lost mark and anchor travelled on with that state (a preview opened over Settings copies them), so a later opening began from that entry carried them, and a Back-menu jump past its base onto the entry the sheet had opened over counted as Settings closing. A new opening now drops them from its base.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Reset markers on new opening src/lib/settingsHistory.ts, src/lib/settingsHistory.test.ts, changelog.d/settings-history-stale-anchor.md |
A new Settings opening omits inherited LOST_KEY and ANCHOR_KEY markers. The regression test checks that backing past a preview does not report Settings as closing and preserves navigation marker "b". The changelog describes the phone browser-history scenario. |
Priority:
Estimated code review effort: 2 (Simple) | ~10 minutes
Change: Bug fix · Severity of issue fixed: Low
Possibly related PRs
- devswha/ovis#2023: This PR changes the same Settings history marker flow by clearing stale markers when a new Settings opening begins.
- devswha/ovis#1947: This PR introduced the lost-opening and anchor markers that this change resets.
Merge Risk: 
Minimal · up to 6a24b
-
The change addresses the reported history-navigation issue. No actionable merge-blocking risk remains.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title names the main change: Settings reopened from a history entry no longer keeps an anchor from an earlier opening. It uses the conventional fix(settings) prefix and states the behavior. It does not cover the test or the changelog entry, which is expected. The 82-character length is slightly long but acceptable.
Full details: Description check
-
Explanation
The description follows the template. It has a Change section that explains the problem (stale ovis:settings-base-lost and ovis:settings-anchor marks copied into later entries), the resulting wrong classification of a history jump as Settings closing, and the fix in reconcile(). It links the issue (Closes
#1949). The Validation section lists the new test, unit test counts, the check run, browser regressions, and reviews. It has no HTTP/WS contract statement is present, and it does state no contract or server change, so the template's contract-test note is addressed.
Full details: Linked Issues check
-
Explanation
Issue
#1949requires stale Settings marks and anchors to stop misclassifying a multi-entry history jump after Settings reopens.reconcile()removesLOST_KEYandANCHOR_KEYfrom the base entry at each new opening, then assigns a newBASE_KEY. The sheet takeover path writes fresh marks afterward. The added regression test reopens Settings from a preview, nests a sheet, performsgo(-5), and verifies that history lands on B withoutsettingsSteppedOff().
Full details: Out of Scope Changes check
-
Explanation
The changes are limited to the Settings history fix, its regression test, and a related changelog entry. These changes directly support issue
#1949. No unrelated product behavior or server, HTTP, or WebSocket changes are shown.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files. (1 skipped: 1 unsupported.)
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches: 💡 1
-
📝 Generate docstrings: 💡
-
- Commit to this branch
- Create a new PR
🧪 Generate unit tests (beta)
-
- Commit to this branch
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
Merging 6a24b29: omo-native-code-reviewer and Codex both pass this head, and the regression and four history-jump variants fail on main. The LOW notes go to a follow-up issue. The required checks are green, and CodeRabbit did not review this head. |
Change
Closes #1949.
What was wrong. When Settings opens from a phone sheet (the command palette), it takes over the sheet's entry. It then puts a lost mark (
ovis:settings-base-lost) and the sheet's id (ovis:settings-anchor) on its entries, so its closing can be told from the entry the sheet opened over. Those marks stayed in the history after Settings closed. A preview opened over Settings copies them (outsideSettings). A later opening that started from such an entry copied them again onto its own entries, because every Settings entry copies its base's state.So, on a phone: A → B → palette → Settings → a file preview → Settings closes under the preview → Settings opens again from the preview (a sheet inside it, Phone & devices → Sign out → Cancel) → a jump through the browser's history menu past the preview onto B. The second opening's entries held the first opening's anchor, B carries that sheet's id, and the jump counted as Settings closing (
settingsSteppedOff()true). The address bar then kept the current pane instead of going to B's.Fix. A new opening drops the lost mark and the anchor from its base entry when it marks that entry with its own id (
reconcile()insrc/lib/settingsHistory.ts). An opening that takes over a sheet's entry itself writes fresh ones right after, as before. Those marks are only ever read from Settings entries, so removing them from a pane's or a preview's entry changes nothing else.This is the issue's first proposed fix ("clear the anchor and the mark ... or scope them to one opening"), applied where an opening begins. That covers every entry a later opening could start from, rather than only the entry an opening closes onto. No HTTP or WebSocket contract changes, no server change.
Validation
settingsHistory.test.ts, "does not carry an earlier opening's anchor into Settings opened again over the same entries". It follows the path above and ends withgo(-5)onto B. It fails on main (settingsSteppedOff()came back[false, true]) and passes with the fix. It still fails on main without the inner sheet step, because the marks come from the preview's copy. No fixed sleeps.bun test src/lib/settingsHistory.test.ts: 38 pass.bun test src/lib: 2462 pass, 0 fail.bun run check fast: green at the head commit.settings-pages-demo-regression,deep-link-demo-regressionandhide-pc-demo-regression(390 and 1440, including the phone palette path) pass.Reviews
outsideSettingsstill copying the marks onto a preview's entry (older behaviour, harmless now that an opening drops them).