Skip to content

feat(web): URL-addressable Space views + overlay history + /settings route#1557

Merged
lsm merged 6 commits intodevfrom
space/audit-and-fix-browser-back-forward-navigation-gaps-in-space
Apr 21, 2026
Merged

feat(web): URL-addressable Space views + overlay history + /settings route#1557
lsm merged 6 commits intodevfrom
space/audit-and-fix-browser-back-forward-navigation-gaps-in-space

Conversation

@lsm
Copy link
Copy Markdown
Owner

@lsm lsm commented Apr 21, 2026

Summary

  • /settings route — Settings now has a dedicated URL (/settings) with full back/forward support. navigateToSettings() pushes history, popstate restores it, and initializeRouter sets signals on page load.
  • Space Agent Overlay history — Opening the overlay pushes a marker history entry (URL stays clean), so browser back closes it. pushOverlayHistory() / closeOverlayHistory() encapsulate the pattern. Popstate handler detects overlay marker removal and clears overlay signals.
  • Replace bare signal assignments with router calls — SpaceTaskPane, SpaceTaskCardFeed, SpaceIsland, Inbox, and ChatContainer now use pushOverlayHistory(), navigateToRoomTask(), and navigateToSettings() instead of directly mutating navigation signals.

Note: The /rooms URL route is out of scope for this PR per user instruction and will be addressed in a follow-up.

Changed files (11)

File Change
web/src/lib/router.ts Add /settings route, pushOverlayHistory, closeOverlayHistory, popstate/init cases
web/src/App.tsx Add settings branch to URL-sync effect
web/src/islands/SpaceIsland.tsx Use pushOverlayHistory/closeOverlayHistory
web/src/components/space/SpaceTaskPane.tsx Use pushOverlayHistory instead of bare signals
web/src/components/space/thread/compact/SpaceTaskCardFeed.tsx Use pushOverlayHistory
web/src/components/inbox/Inbox.tsx Use navigateToRoomTask instead of bare signals
web/src/islands/ChatContainer.tsx Use navigateToSettings instead of bare signal
web/src/lib/__tests__/overlay-history.test.ts New — 10 tests for overlay history
web/src/lib/__tests__/settings-router.test.ts New — 7 tests for settings route
web/src/components/space/__tests__/SpaceTaskPane.test.tsx Update mock for pushOverlayHistory
web/src/islands/__tests__/SpaceIsland.test.tsx Add pushOverlayHistory/closeOverlayHistory to mock

Test plan

  • All existing web tests pass (17 test suites, pre-existing flaky SpaceIsland.configure excluded)
  • New overlay-history tests: push state, signal setting, agent name null, state preservation, closeOverlayHistory back vs signal-only, popstate overlay removal, normal navigation unaffected
  • New settings-router tests: pushState call, signal clearing, replaceState mode, idempotent check, init on /settings, popstate restore/clear
  • Manual: Open Space → open agent overlay → press back → overlay closes
  • Manual: Navigate to Settings → press back → returns to previous view
  • Manual: Share /settings URL → opens settings directly

lsm added 6 commits April 20, 2026 21:05
…route

- Add /settings route with dedicated URL, back/forward support, and
  proper signal cleanup in router and App URL-sync
- Add pushOverlayHistory/closeOverlayHistory for Space Agent Overlay,
  pushing a marker history entry (no URL change) so browser back
  closes the overlay
- Replace bare signal assignments with router calls in SpaceTaskPane,
  SpaceTaskCardFeed, SpaceIsland, Inbox, and ChatContainer
- Add overlay + settings cases to popstate handler and initializeRouter
- Add unit tests for overlay history and settings route (overlay-history,
  settings-router)
Consistent with existing router test convention (router.test.ts,
router-short-id.test.ts, router-space-slug.test.ts).
Components now read navigation state from shared signals instead of local
useState. Update test mocks to use real Preact signals (via bridge pattern)
so that navigateToSpaceTasks/navigateToSpaceTask/navigateToSpaceConfigure
calls trigger reactive re-renders during tests.
…ail)

Add URL routing for Space sub-tab views so they are shareable and support
back/forward navigation:

- /space/:id/configure/agents|workflows|settings — configure sub-tabs
- /space/:id/tasks/action|active|completed|archived — tasks filter tabs
- /space/:id/task/:taskId/thread|canvas|artifacts — task detail sub-views

Components now read tab state from signals (driven by router) instead of
local useState. Tab switches pushState, popstate restores the correct
tab, and initializeRouter handles direct URL loads.

New signals: currentSpaceConfigureTabSignal,
currentSpaceTasksFilterTabSignal, currentSpaceTaskViewTabSignal.
@lsm lsm enabled auto-merge (squash) April 21, 2026 05:16
@lsm lsm merged commit a26d4c6 into dev Apr 21, 2026
44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant