fix(cll): fix change_analysis state propagation in CLL#1190
Open
fix(cll): fix change_analysis state propagation in CLL#1190
Conversation
Tests demonstrate that change_analysis mode is lost when clicking between
columns during Impact Radius mode. The root cause is that
viewOptions.column_level_lineage is wholesale-replaced by onColumnNodeClick
with { node_id, column }, dropping the change_analysis flag.
4 tests use it.fails (RED) showing the bug; 6 pass documenting baseline.
When the fix lands, change it.fails → it and verify they pass.
See docs/plans/state_model_repair.md for the fix plan.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Danyel Fisher <danyel@gmail.com>
…te loss Column clicks wholesale-replace viewOptions.column_level_lineage via showColumnLevelLineage(), which dropped change_analysis. This caused Impact Radius mode to silently disappear when clicking columns. Fix: Add independent changeAnalysisMode boolean state that column clicks never touch. The mode is set true on Impact Radius activation, cleared when CLL is turned off entirely, and injected into API calls at the call site rather than being carried in the viewOptions object. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Danyel Fisher <danyel@gmail.com>
Update test helpers to reflect the new state model where change_analysis is an independent boolean rather than a field on the CllInput object. Flip it.fails → it on all 4 bug tests. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Danyel Fisher <danyel@gmail.com>
…osure
When Impact Radius activates, setChangeAnalysisMode(true) and
showColumnLevelLineage({change_analysis: true}) fire in the same
event. The state setter hasn't re-rendered yet, so changeAnalysisMode
is still false in the refreshLayout closure. Use ?? to prefer the
explicit CllInput value, falling back to the state boolean for
column clicks that don't carry it.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Danyel Fisher <danyel@gmail.com>
The useEffect([lineageGraph]) captured changeAnalysisMode via closure, causing stale reads on refetch. Use a ref mirror so both the CLL API call and trackLineageRender read the current value. Ref: DRC-2893 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Danyel Fisher <danyel@gmail.com>
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.
Summary
changeAnalysisModefromviewOptionsto prevent state loss when users click columns after activating Impact Radius. Previously,change_analysislived insideviewOptions.column_level_lineageand was overwritten on column clicks.??merge pattern in both CLL API call paths to fall back to the stickychangeAnalysisModestate whenchange_analysisis absent from the per-request input.changeAnalysisModeRefto avoid stale closure reads in theuseEffect([lineageGraph])path.Closes a bug where toggling Impact Radius, then clicking a column, would silently drop the
change_analysisflag from subsequent CLL API calls.Test plan
CllChangeAnalysisPropagation.test.ts)change_analysis: truepersists in network requestsReviewer notes
DCO
🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com