feat(render-html): Serialize collapse state in URL and support popstate navigation#48
Merged
Merged
Conversation
…te navigation Add collapsed tables to URL hash (`c` param) so shared links preserve collapse state. Use pushState for discrete viewer changes (selection, search, filter, collapse) to enable browser back/forward, while keeping replaceState for continuous viewport pan/zoom to avoid history flooding.
mhiro2
force-pushed
the
feat/url-state-collapse-and-popstate
branch
from
April 10, 2026 21:10
e7ebca9 to
c748081
Compare
Code Metrics Report
Details | | main (a9d8da7) | #48 (6ad409a) | +/- |
|---------------------|----------------|---------------|------|
| Coverage | 94.1% | 94.1% | 0.0% |
| Files | 77 | 77 | 0 |
| Lines | 29895 | 29895 | 0 |
| Covered | 28148 | 28148 | 0 |
- | Test Execution Time | 1m34s | 1m38s | +4s |Reported by octocov |
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.
Summary
cparameter) so it can be shared andbookmarked
runtime.collapse.getCollapsed/runtime.collapse.setCollapsed) forprogrammatic collapse control
popstatewith properpushState/replaceStatedistinction
Changes
ViewerCollapseApiinterface withgetCollapsed/setCollapsedmethods toviewer_api.ts, extendingViewerRuntimeandViewerModuletypesapplyCollapseStateincollapse.tsfor programmatic collapse/expand, registerthe collapse module in the viewer runtime, and emit
relune:collapse-changedevents on togglechash parameter inurl_state.ts, restore them onpage load, and validate IDs against known table IDs; introduce
scheduleDiscreteWriteusinghistory.pushStatefor user actions while keepinghistory.replaceStatefor continuous viewportchanges; add
popstatelistener withrestoringFromPopstateguard to avoid duplicate historyentries