Skip to content

fix(settings): step over buried Settings history entries; keep a preview over Settings on reload - #1015

Merged
devswha merged 2 commits into
mainfrom
fix/settings-history-entries
Oct 14, 2026
Merged

devswha merged 2 commits into
mainfrom
fix/settings-history-entries

Conversation

@devswha

@devswha devswha commented Oct 14, 2026

Copy link
Copy Markdown
Owner

Closes #898
Closes #828

Change

  • src/lib/settingsHistory.ts: each opening of Settings now marks the entry it began from (herdr-web-ui:settings-base, also carried by its entries). When the module finds its held entries under a markerless state that is not that base (a typed #hash, another script's pushState, a preview), it records the opening as buried. A later Back that lands on a buried opening's entries from above steps over them to their base (an own traversal, so the app does not reopen Settings). Forward from the base still reopens them, as before.
  • outsideSettings(state) (new export): the state another dialog pushes from a Settings entry drops the Settings marker and notes the opening it lies above (herdr-web-ui:settings-above). A load on such an entry keeps it and closes Settings (loadedOnSettingsEntry() is true, so the address's settings= is not reopened), and Back from it steps over the Settings entries beneath.
  • src/lib/useFileViewer.ts: openFile builds the preview's state with outsideSettings instead of copying the whole state, Settings marker included.
  • Tests: the unit test that characterized settings: an unrelated history entry while Settings is open buries its entries #898 now asserts the fix, and two cases were added (a foreign pushState then the X; a reload on a preview over Settings). scripts/settings-pages-demo-regression.ts gets two browser steps: a phone with Settings > Terminal > key bar, two markerless pushStates, then Back twice; and a desktop ?pane&file=README.md&settings=about link, reloaded, then Back.
  • Changelog fragment changelog.d/settings-history-entries.md.

Behavior note: with the preview no longer copying the marker, Forward onto a preview that was opened over Settings shows the file with Settings closed (previously Settings stayed open over it).

Validation

  • bun run typecheck: passes.
  • HERDR_TEST_MODE=unit bun test ./src/lib/settingsHistory.test.ts ./src/conventions.test.ts ./scripts/conventions.test.ts ./scripts/changelog-fold.test.ts ./src/lib/i18n.test.ts: 73 pass, 0 fail.
  • CHECK_DIR=... bun run check run --build bun scripts/settings-pages-demo-regression.ts: all PASS, including the two new steps.
  • check run --build with scripts/deep-link-demo-regression.ts and scripts/file-viewer-regression.ts (Settings over a preview, Back/Escape ordering): both pass.
  • With the two source files stashed: the 3 new unit tests fail and the settings-pages regression fails with a history wait timeout. Both pass again with the fix.
  • Not run: the full bun run check full lanes, and no test on a real phone.

@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 46 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository: devswha/herdr-web-ui/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7ebb1ec8-a950-4d5c-a275-662cba5658a8
📥 Commits

Reviewing files that changed from the base of the PR and between b83c7c5 and f810f91.

📒 Files selected for processing: 5
  • changelog.d/settings-history-entries.md
  • scripts/settings-pages-demo-regression.ts
  • src/lib/settingsHistory.test.ts
  • src/lib/settingsHistory.ts
  • src/lib/useFileViewer.ts
  • 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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@devswha
devswha merged commit bfaafae into main Oct 14, 2026
9 checks passed
@devswha
devswha deleted the fix/settings-history-entries branch October 14, 2026 01:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

settings: an unrelated history entry while Settings is open buries its entries A reload on a file preview opened over Settings reopens Settings

1 participant