Repository navigation
The shell re-renders in place: no reload, no flash, no leaked listeners - #142
Merged
Merged
Conversation
Brett: "yes, get rid of the flash too."
The five controls that change what is shown — the repository jump, the
repository selector, the project selector, a refresh, and clearing a drill-in
— now call `render()` instead of `window.location.reload()`. There is no
navigation left in app.js.
THE HARD PART IS NOT RE-RENDERING, IT IS UNBINDING. Several views bind
document-level listeners (Escape closes the explorer, Escape closes the
workbench, the wheel's keyboard paging, fullscreen and settings events) and
observe layout with ResizeObservers. Re-mounting them without teardown means
the second Escape press runs two handlers, the third runs three, and the leak
grows with every switch a human makes — silently, until something fires twice.
ONE `AbortController` PER RENDER is the whole mechanism. Everything a render
binds outside its own root passes `{ signal }`, and starting the next render
aborts the last, which removes all of it at once. No view needs a `destroy()`
and none keeps bookkeeping; it honours the signal it is handed. Observers hook
the same signal's `abort` to disconnect.
The settings gear stays bound ONCE for the life of the page — it owns no
snapshot state, so a re-render must neither rebind nor unbind it.
MEASURING IT PROPERLY MATTERED. The first leak check counted calls to
`addEventListener` and showed keydown climbing 4 -> 13 over three switches,
which looked like a total failure of the scoping. It was the measurement:
an aborted listener is gone but its registration was still counted. Counting
LIVE listeners — registrations whose signal has not aborted — shows them flat
at keydown 4, click 1, fullscreenchange 1, settings 1 across four switches,
against 27 total registrations. Two listeners are deliberately unscoped: the
settings gear's, bound once.
Verified in place with zero navigations: the project switch (lands back on the
wheel), and the drill-in and its clear ("drilled in: 10 documents — 2
identities carried by all 5 visible repositories", then gone).
Suites 2816 passed (exit 0). One unrelated flake appeared in a single run —
`test_wire_accept_and_the_pending_edits_plane`, a git-backed register-edit
wire test — and passed both in isolation and on a full re-run; nothing in this
change touches that lane.
Co-Authored-By: Claude Fable 5 <[email protected]>
There was a problem hiding this comment.
Hi @brettheap! 👋
Your private repo does not have access to Sourcery.
Please upgrade to continue using Sourcery ✨
There was a problem hiding this comment.
Pull request overview
This PR updates the ideation dashboard shell to re-render in place (instead of reloading the page) while preventing listener/observer leaks across re-mounts by scoping render-installed bindings to a per-render AbortController.
Changes:
- Replaced remaining
window.location.reload()-based flows with in-placerender()calls in the dashboard shell. - Introduced a per-render
AbortControllerscope and threaded{ signal }through views that bind document-level listeners / long-lived observers. - Added tests and runbook documentation to pin “no reload” behavior and the render-scope teardown rule.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/ideation-dashboard/test_bullseye_widget.py | Adds a regression test asserting no reloads and that document listeners / observers are render-scoped. |
| scripts/ideation_dashboard/web/app.js | Adds per-render scope management and switches key controls to call render() instead of reloading. |
| scripts/ideation_dashboard/web/views/wheel.js | Scopes document listeners and disconnects ResizeObserver on render abort. |
| scripts/ideation_dashboard/web/views/funnel.js | Disconnects ResizeObserver on render abort. |
| scripts/ideation_dashboard/web/views/explorer.js | Scopes the overlay’s document Escape handler to the render scope. |
| scripts/ideation_dashboard/web/views/staging-workbench.js | Scopes the overlay’s document Escape handler to the render scope. |
| docs/ideation-dashboard-session-runbook.md | Documents the new in-place re-render behavior and the “one AbortController per render” rule. |
Suppressed comments (1)
scripts/ideation_dashboard/web/app.js:734
- A render aborted by a subsequent
render()call can still continue pastawait probeCapabilities()and mount overlays / mutate DOM. Add an early-return guard immediately after the await so stale renders stop before doing further work.
// every view's existing capability check is the whole gating.
const caps = composed ? readOnlyCaps(probedCaps) : probedCaps;
const explorer = mountExplorer(explorerRoot, snapshot, {
signal,
onOpenFile: (entry, pane, tile) => {
const sourceKey = sourceKeyFor(entry);
return renderViewer(pane, {
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Comment on lines
927
to
931
| mountRepoSelector(document.getElementById("repopicker"), { | ||
| index, active, snapshot, caps, projects, | ||
| onSelect: (key) => { storeKey(key); window.location.reload(); }, | ||
| onRefreshed: () => window.location.reload(), | ||
| onSelect: (key) => { storeKey(key); render(); }, | ||
| onRefreshed: () => render(), | ||
| }); |
Comment on lines
+623
to
627
| async function render() { | ||
| const signal = nextRenderScope(); | ||
| const status = document.getElementById("loadstatus"); | ||
| try { | ||
| // The snapshot INDEX (add-dashboard-repo-selector): the roster the selector |
brettheap
pushed a commit
that referenced
this pull request
Aug 25, 2026
…chives xFactory PR #127 merged at e02d0a8 and that commit is an ancestor of the aggregation's main, so the code surface this change declared has landed where it was always going to land: two .gitmodules entries, two gitlinks at exactly the validated commits 1aa184e and 05f4404, and the README submodule documentation. The gate checked the merge sha for ancestry rather than trusting a branch tip, which is the trap the title-uniqueness archive already recorded once. Task 3.5 carries the read-back and the dated realization note supersedes the 2026-08-21 snapshot that still said the act had not run. The delta restates "Install repository scope" canon-complete: both promoted scenarios byte-identical, the body carried verbatim and extended, and canon was last amended 2026-07-13, so no later writer's amendment was overwritten by a restatement that predated it. Promotion moved that requirement and nothing else — 473 requirements across 50 capabilities before and after, none added, none removed, one modified, and the promoted text is byte-for-byte the delta's. All seven of the change's not-this-change boxes archive open, because each names work the ratification refuses to authorize and ticking a refusal turns it into a claim. One of them is now also a live observation: both pins have advanced past the validated commits, which 5.7 permits by route rather than forbids, and both advances took that route through aggregation PRs #135 and #142. The item stays open as a standing boundary on every future advance. Co-Authored-By: Claude Fable 5 <[email protected]>
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 five controls that change what's shown — repository jump, repository
selector, project selector, refresh, and clearing a drill-in — now call
render()instead ofwindow.location.reload(). There is no navigation leftin
app.js.The hard part isn't re-rendering, it's unbinding
Several views bind document-level listeners (Escape closes the explorer, Escape
closes the workbench, the wheel's keyboard paging, fullscreen and settings
events) and observe layout with
ResizeObserver. Re-mounting them withoutteardown means the second Escape press runs two handlers, the third runs three,
and the leak grows with every switch — silently, until something fires twice.
One
AbortControllerper render is the whole mechanism. Everything a renderbinds outside its own root passes
{ signal }, and starting the next renderaborts the last, removing all of it at once. No view needs a
destroy()or anybookkeeping — it honours the signal it's handed. Observers hook the same
signal's
abortto disconnect.The settings gear stays bound once for the life of the page: it owns no
snapshot state, so a re-render must neither rebind nor unbind it.
Measuring it properly mattered
My first leak check counted calls to
addEventListenerand showedkeydownclimbing 4 → 13 over three switches — which looked like the scoping had failed
completely. It was the measurement: an aborted listener is gone, but its
registration was still counted.
Counting live listeners — registrations whose signal hasn't aborted — shows
them flat across four switches:
Two listeners are deliberately unscoped: the settings gear's, bound once.
Verified in place, zero navigations
navigations: 0.repositories"; clear → gone.
navigations: 0.Suites
2816 passed, 19 skipped, exit 0.
One unrelated flake appeared in a single run —
test_wire_accept_and_the_pending_edits_plane, a git-backed register-edit wiretest — and passed both in isolation and on a full re-run. Nothing in this
change touches that lane, but it's worth knowing it can flake.