Repository navigation
fix(settings): step over buried Settings history entries; keep a preview over Settings on reload - #1015
Merged
Conversation
…ver Settings on reload
|
Warning Review limit reachedYou'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. View limit details
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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'spushState, 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'ssettings=is not reopened), and Back from it steps over the Settings entries beneath.src/lib/useFileViewer.ts:openFilebuilds the preview's state withoutsideSettingsinstead of copying the whole state, Settings marker included.pushStatethen the X; a reload on a preview over Settings).scripts/settings-pages-demo-regression.tsgets two browser steps: a phone with Settings > Terminal > key bar, two markerlesspushStates, then Back twice; and a desktop?pane&file=README.md&settings=aboutlink, reloaded, then Back.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 --buildwithscripts/deep-link-demo-regression.tsandscripts/file-viewer-regression.ts(Settings over a preview, Back/Escape ordering): both pass.bun run check fulllanes, and no test on a real phone.