You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit cd78176
Browse filesBrowse the repository at this point in the historyBrowse files
fix(navigation): dialogs never become Back/Forward destinations
Follow-up to 35eeda4, which kept "push on open, return on close" for the
channel Members dialog. That rule still let Back while the list was open
merely dismiss it. Reversed: a dialog is never a history visit. Back
always leaves the page the dialog is on, whether or not it is open, and
Members is in the chain in neither direction.
Enforced centrally so page code cannot push a dialog visit at all:
`createNavigationController.open` now writes any target that shares the
current visit's page identity (`pageKey`: the parsed target minus a
conversation's `panel`) with `replace`, whatever `options.replace` says.
The address still carries `panel: "members"` while open, so reload and
deep links restore the dialog. `pageKey` lives next to `targetKey` in
targets.ts; non-conversation kinds have no presentation field and key as
before.
`ChannelsPage.setMembersOpen` opens and closes through
`navigator.open(..., { replace: true })`; the opener-visit ref and its
`returnTo` are gone. `Navigation.open`'s `returnTo` option stays for
Settings' `leaveSettings`, which is unchanged: Settings is a multi-section
modal where Back between sections is meaningful, and it already keeps a
dismissed Settings out of back history. I do not think Settings should
change: its sections are destinations in their own right, not presentation
on one page.
Consequence worth knowing: after Back leaves a channel whose list was
open, Forward lands on that same channel visit with Members restored,
because the visit's address is what reload and deep links rely on. The
dialog never consumes a Back press; it is simply part of the page state
Forward and reload bring back.
Tests: controller case asserting a panel-only open and close are written
in place even with `replace: false` (no forward branch created, Back
leaves to the previous page, a different message of the same channel is
still a push). `channel-members.spec.mjs` flips to: opening leaves
history.length and canGoForward unchanged; Back while open lands on the
previous channel; Forward returns to the channel visit; after Close, Back
leaves the channel and Forward has nothing beyond it; reload restores
Members from the address and Close after reload also replaces. The scoped
routed-thread case now asserts Back after a cold dismissal lands on the
visit before the conversation was opened. Docs state the final rule.
Validation: `tsc --noEmit` clean; biome check on changed files clean;
`vitest run src/features/navigation src/app/navigation
src/bundled/channels/ChannelsPage src/app/App.profile src/app/Settings
src/app/entity-navigation` 18 files, 292 passed. Playwright
channel-members.spec.mjs: chromium first run 4 passed / 1 failed on an
assertion I had placed behind the open modal (the draft textbox is hidden
from role queries while the dialog is up, same ordering mistake as last
time, not product behaviour); after moving that assertion past Escape,
chromium 5/5 and webkit 5/5. Not exercised: the native desktop app or a
human walkthrough.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Matt Toohey <[email protected]>
0 commit comments