Repository navigation
feat(ui): rename Run button + stale-graph banner (#21, #22) - #37
Merged
Merged
Conversation
Renames the primary action button from "Run" to "Lineage" and adds a non-blocking banner plus nav-affordance gates that protect the text↔ graph navigation shipped in #23/#24 from silently drifting after edits. - Lineage store: analyzedContentByPath snapshot + stalePaths set, cleared on setResult(null), preserved across successful re-analyze. - useAnalysis seeds the snapshot on both fresh runs and cache-hit restores; EditorArea diffs live files via computeStalePaths on every content change and pushes stalePaths. - OccurrenceCycler disables ◀/▶, useOccurrenceShortcuts short-circuits n/Shift+n, and SqlView hides "Reveal in lineage" when the relevant sourceName is stale. - Amber banner above the editor when the active file diverges from its snapshot, clearing on undo or re-analyze.
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.
Closes #21, closes #22.
Summary
Why
After #23/#24 shipped bidirectional text↔graph navigation, any post-analysis edit silently invalidates the byte-offset spans the navigation relies on — clicking an occurrence arrow or "Reveal in lineage" would jump to the wrong place. The banner + gates make that invariant visible and the nav safe.
Design
LineageStategainsanalyzedContentByPath: ReadonlyMap<string,string> | null(snapshot taken at analyze time) andstalePaths: ReadonlySet<string>(paths whose live content diverges). Both cleared onsetResult(null); snapshot preserved across successful re-analyze to avoid a stale→fresh flicker.EditorArearunscomputeStalePaths(snapshot, currentFiles)on every content change and pushes the result viasetStalePaths.useAnalysisseeds the snapshot on successful analyze and on IndexedDB cache-hit restore.OccurrenceCycler(disabled ◀/▶ witharia-disabled),useOccurrenceShortcuts(n/Shift+n short-circuit),SqlView("Reveal in lineage" hidden).Scope notes
Test plan
yarn workspaces run typecheck— all workspaces cleanyarn workspaces run test— 169 tests pass including 12 new ones (staleContent.test.ts,stalePaths.test.ts)yarn workspaces run lint— cleanyarn workspace @pondpilot/flowscope-app build— builds