Repository navigation
Let browser Back leave the form Settings page - #287
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
PhilReinking
left a comment
There was a problem hiding this comment.
Changes at 7f10c4f: one must, inline. Checked beyond the PR text in headless Brave: from the editor, Back then Forward, a reload on a #tab, and a Back that reloads the page all keep the right page and tab. A fresh load of /settings without #tab still needs two Backs (inline). Not blocking: leaving Settings by the Editor link, then Back, now opens the first tab, not the one you left; main kept it.
| // replace the entry: a new one per tab would trap browser Back on Settings. | ||
| // Inertia reads history.state.url on a Back that reloads, so it follows the hash | ||
| const url = `${location.pathname}${location.search}#${item.slug}`; | ||
| history.replaceState({ ...history.state, url }, "", url); |
There was a problem hiding this comment.
On a full load of /settings without #tab, setup calls this (lines 122–126) before Inertia saves its first page, so Inertia pushes a 2nd entry. The first Back then lands on an entry without a page: "Page not found: ./Pages/undefined.vue", still on Settings. In setup, only set selectedTabIndex.
… Back Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
PhilReinking
left a comment
There was a problem hiding this comment.
OK at 61d9717. Hanke's must is fixed: a fresh load of /settings without #tab adds one history entry, and one Back opens the editor, no page error. Held in Brave: 4 tabs then Back and Forward, the #completion-page link, reload on a tab, a Back that reloads. Editor link then Back now keeps the tab. Setting router.page.url is safe: Inertia only writes it back to history, as it does for a #link. Both new tests fail on the old code.
…-back # Conflicts: # CHANGELOG.md
PhilReinking
left a comment
There was a problem hiding this comment.
OK at e4759a8, CI green. Re-check of the changelog merge only: merging main conflicted only in CHANGELOG.md and changes no other file. The code diff vs main is the same as at 61d9717. The #287 line is word for word as before, 1 line added and 0 removed, first in Fixed. It merges cleanly with #289 and #290, in pairs and all 3 together. The OK at 61d9717 covers the rest.
Switching a Settings tab now replaces the current history entry instead of adding one, so browser Back from Settings shows the editor. A link like
#completion-pagestill opens its tab.Tested: new Vitest tests fail without the fix; lint and vue-tsc pass; in a real browser one Back from Settings after four tab clicks shows the editor.
Not tested: Forward after Back, browsers other than Chromium.
Fixes BITS-291
🤖 Generated with Claude Code