Repository navigation
feat(site): keep the address bar a link to the model being edited - #36
Merged
Merged
Conversation
The fragment follows the editor text and the selected index, written with history.replaceState after the page has been still for a moment, so editing adds no history entries and fires no hashchange. A page in the state it opened with keeps the address it opened at, including a gist's, and returns to it when changed back. A link past the longest address a browser is known to accept is not written: the fragment is cleared and the page says to share a gist.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This security review couldn’t start because the paying account has exhausted its Codex allowance and has insufficient available credits. The payer can check their balance and add credits in the Codex usage dashboard, then try again. If you do not manage the paying account, contact this repository's admins. |
|
🎉 This PR is included in version 2.1.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
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.
The explorer's address bar now holds the same link Copy link makes, and updates as the model or the selected index changes, so the link can be copied from the browser.
Writes use
history.replaceStateafter the page has been still forADDRESS_DEBOUNCE_MS, which is WebKit's window divided by its call limit, so editing adds no history entries, fires nohashchangeand stays under WebKit's replaceState limit. A page in the state it opened with keeps its opened address (clean, or a gist's) and goes back to it when changed back. Text that is not yet valid JSON is kept in the fragment, so a reload does not lose it. A link longer than 1 MiB (Firefox's standard URL limit; Chromium's is 2 MiB) is not written: the fragment is cleared and the page says to share a gist.The browser tests cover each of those against the built site, and fail when the
replaceStatecall is removed. The deployed site is checked after the Pages run.