feat(web): jump from Timeline to Source tab on chunk/file click#676
Merged
feat(web): jump from Timeline to Source tab on chunk/file click#676
Conversation
Timeline's "Open" button (chunks view) and chunk-row clicks (files view)
went to ``showDetailFromChunk`` → Search tab's detail panel. But the
user landing on Search after clicking a Timeline chunk sees an empty
left-side results pane ("Enter a query to search") next to a populated
detail on the right — the panel reads as orphaned. The Source tab
already exposes Copy / Edit / Delete on every chunk (the same
operations Search detail offers), and the two preceding PRs (#673
vendor sub-tab follow-through, #674 Home-recent activation) built the
``_navigateToSource(path)`` plumbing — pending-activate handoff plus
eager vendor resolve — for exactly this kind of cross-tab jump.
Reuses that plumbing from Timeline:
- ``_navigateToSource`` gains an optional ``chunkId`` argument and
sets ``STATE.pendingActivateChunkId`` alongside the existing
``pendingActivatePath``. Empty-string chunkId means "source-level
only, no card highlight" — keeps the Home-recent and command-
palette callers behaving exactly as before.
- ``browseSource`` consumes ``pendingActivateChunkId`` after
``content`` lands in the DOM: queries by ``data-chunk-id``
(already set on every ``.chunk-card`` since the existing browse
code path), scrolls into view, expands the accordion if the card
is collapsible, and pulses a ~1.4s ``.tl-target-flash``. Cleared
unconditionally so a follow-up Load-All re-render of the same
source doesn't re-flash an old target.
- Timeline rewrites three call sites:
* Chunks view "Open" button → ``_navigateToSource(c.source_file,
c.id)``. Button label moves from hard-coded "Open" to
``timeline.open_in_source`` (en: "Open in source", ko:
"소스에서 보기").
* Files view file header gains a small ghost-style
``.tl-file-open-source`` button on the right edge that
``stopPropagation``'s the row's expand/collapse and navigates
to the source path (no chunk highlight — file headers don't
carry a single canonical chunk).
* Files view per-chunk row click → ``_navigateToSource(c.source
_file, c.id)``.
``showDetailFromChunk`` is kept: ``app.js:4834`` still uses it for the
Source-chunks side panel inside the Search detail (intra-detail "jump
to a sibling chunk in the same source"), which is a different flow.
The Timeline call sites are the only ones changing.
Cache-bust: ``style.css?v=72→v=73``, ``app.js?v=87→v=88``,
``timeline.js?v=1→v=2`` per ``feedback_static_asset_cache_bust.md`` —
all three files have body changes.
i18n parity verified by ``test_i18n.py`` (12 passed); ruff +
ruff-format clean. Manual verification with Playwright MCP against a
live ``mm web`` against the developer's real DB:
- Chunks-view "Open in source" → tab=sources, exactly one
``.chunk-card.tl-target-flash`` on the matching ``data-chunk-id``,
flash visible ~205ms after click then auto-removed.
- Files-view header button → tab=sources, no chunk flash (intended).
- Files-view header non-button click → expand/collapse only, tab
unchanged. ``stopPropagation`` on the new button confirmed.
- KO label "소스에서 보기" rendered on first paint (``data-i18n``
+ langchange wiring already covers this since PR #587).
Co-Authored-By: Claude <[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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Summary
Timeline tab's chunk/file clicks now jump to the Source tab instead of
opening Search's detail panel. Search's left-side results pane stays empty
unless the user actually ran a search, so jumping there from Timeline left
a populated detail floating next to a "Enter a query to search" placeholder
— readable as orphaned. Source already has Copy / Edit / Delete on every
chunk, and the cross-tab navigation plumbing landed in #673 + #674
(
_navigateToSource(path), vendor sub-tab follow-through, pending-activatehandoff). This PR reuses it from Timeline.
_navigateToSourcegains an optionalchunkId.STATE.pendingActivate ChunkIdis consumed inbrowseSourceafter the chunk list lands —scrolls the matching
.chunk-card[data-chunk-id="…"]into view, expandsit if collapsible, pulses
.tl-target-flashfor ~1.4s. Empty chunkId =source-level jump only (no flash) — keeps the Home-recent and
command-palette callers behaving exactly as before.
_navigateToSource(c.source_file, c.id).Label moves from hard-coded "Open" to
timeline.open_in_source(en"Open in source" / ko "소스에서 보기").
.tl-file-open- sourcebutton on the right edge —stopPropagation'd so the row'sexisting expand/collapse still works for header non-button clicks.
No chunkId (file headers don't carry a single canonical chunk).
_navigateToSource(c.source_file, c.id).showDetailFromChunkis kept —app.js:4834still uses it forthe Source-chunks side panel inside Search detail (intra-detail "jump to
a sibling chunk in the same source"), which is a separate flow. Timeline
call sites are the only ones moving.
Cache-bust per
feedback_static_asset_cache_bust.md—style.css v=72→73,app.js v=87→88,timeline.js v=1→2(all three have body changes).Test plan
uv run pytest packages/memtomem/tests/test_i18n.py -q— 12 passed(locale parity holds: new key in both en + ko).
uv run ruff check+ruff format --checkclean.mm web:tab=sources, exactly one.chunk-card.tl-target-flashon the matchingdata-chunk-id, firstflash observed ~205ms after click then auto-removed at 1.4s.
tab=sources, no chunk flash (intended).unchanged.
stopPropagationon the new button confirmed.data-i18n+langchange wiring (already covered since feat(web): Index tab — surface hard-to-discover behaviors (static, 7-item bundle) (#579) #587).
_navigateToSourcepath used by fix(web): vendor sub-tab follow-through on cross-tab source navigation #673; verified above on user-vendorsources, confidence-by-symmetry on the other two but worth a manual
eyeball post-merge.
pendingActivate handoff path proved out for the Home-recent flow in
fix(web): activate the clicked source on Home recent navigation #674; mechanically identical here.
🤖 Generated with Claude Code