Skip to content

Show findings inline and load TUI analysis automatically - #303

Merged
shanejonas merged 11 commits into
masterfrom
fix/tui-inline-findings
Oct 30, 2026
Merged

shanejonas merged 11 commits into
masterfrom
fix/tui-inline-findings

Conversation

@shanejonas

@shanejonas shanejonas commented Oct 29, 2026 •

Copy link
Copy Markdown
Collaborator

The TUI loads quality and patterns automatically, shows each loading phase, and displays findings beside source. [ / ] visits quality findings, their recorded evidence lines, visible patterns, and saved notes across the report. Files and Functions show distinct pattern counts in PAT; pattern notes include observations, suggested review, related sites, and caveats.

Clone notes state that they compare whole functions and show their source ranges. Clone and divergent-clone candidates preserve canonical qualified names, function IDs, and full function extents; methods that share a short name remain distinct. Related sites include their ranges. Matching thresholds and the grouping algorithm stay unchanged.

Quality notes use a square (■), patterns use a triangle (▲), and saved notes use a diamond (◆). Supported effect and mutation evidence appears directly below its recorded source line, with unavailable recorded positions kept explicit. Mutation notes say mutation: target (provenance) in source and quality views. The TUI hides unknown effects, unproved mutations, and findings that exceed a limit only because of unknown contributions. A mixed finding stays visible when its known contribution alone exceeds the configured limit. Root and field mutation budgets preserve their original granularity. Badges and bracket navigation use the same visible findings. The optional quality pane also shows known evidence only.

Filtering builds a display projection. Raw JSON, headless scoring, thresholds, analysis status, and completeness flags stay unchanged. Density is displayed only when its known contribution can be computed from recorded metadata or a complete result. Regression tests cover source-line placement, unknown-only findings, mixed known excesses, root/field mutation budgets, badges, navigation, and raw-data preservation.

Finding locations are indexed when results arrive, tables render visible rows only, and source wrapping/counts are cached across same-function navigation. Pattern detail preparation and indexing run in the background worker. Resize, refresh, visibility changes, and note edits invalidate the relevant caches; stale scan results cannot install an old index. Visibility toggles during initial loading do not start another scan.

The implementation reuses the cached finding index for counts and navigation, removes obsolete scan/render helpers, filters known evidence once, and derives table viewport size from the fitted rows. Duplicate test setup is consolidated while keeping the startup, raw-data, source-position, navigation, and cache-invalidation checks. This review removes 211 lines net (107 production, 104 tests). Gstyle changed-function quality diagnostics fall from 23 to 14 with no new diagnostics; the finding-file index falls from CC 6 / COG 8 to CC 4 / COG 6.

Validation: make check cognitive lint, application race tests, make quality-baseline quality-gate, and repository guard checks pass in the isolated master snapshot. The quality baseline is regenerated. A large-report benchmark is included; real terminal tests also replay 64-key bursts without dropped bracket events.

The full pattern scan and fix --changed preview did not finish in the local review window and were stopped after more than 12 and 5 minutes respectively. They do not establish a clean pattern result for this review.

Merge risk: unknown 👀

Code impact: partial 👀
Affected functions: 135.

Dependencies: unchanged ✅

API diff: compatible changes ✅ (5)

Graph changes

Showing 1 of 135 changed functions. + added; − removed. At most 18 nodes and 24 changed edges per function.

application/review_navigation.go · github.com/rstyled/gstyle/application.Model.activeReviewIndex

flowchart TD
  n0["+ slices.IndexFunc"]
  n1["+ m Model"]
  n2["+ targets []reviewTarget"]
  n3["+ int"]
  n4["+ return slices.IndexFunc(targets, m.reviewTargetActive)"]
  n5["+ m.reviewTargetActive"]
  n6["+ targets"]
  n7["+ m"]
  n8["+ memory-input"]
  n4 -->|"+ data"| n3
  n7 -->|"+ data"| n5
  n7 -->|"+ execution"| n5
  n0 -->|"+ data"| n4
  n0 -->|"+ execution"| n4
  n1 -->|"+ data"| n7
  n5 -->|"+ data"| n0
  n5 -->|"+ execution"| n0
  n2 -->|"+ data"| n6
  n6 -->|"+ execution"| n7
  n6 -->|"+ data"| n0
  n8 -->|"+ data"| n0
Loading

Compared base: fdbeceba6073a44c79ec0757ba5f86030f08d8fd · head: 67461c2ae1e32b7e1854d1bec39a35357860c1b3

Load patterns automatically, show loading phases and distinct PAT counts, and
cycle through saved notes and source findings with the bracket keys. Render
pattern explanations and quality guardrails inline with scrollable evidence.
Clear the finding scroll position when visual selection starts so j/k
selects source lines instead of continuing to scroll finding evidence.
Use one directional navigation scan and reuse annotation wrapping and
selection resets. Keep finding behavior on markers and reset pattern
results as one state. Refresh master and regenerate the quality baseline.
Index finding sites when results arrive, render visible table rows, and bound inline quality evidence. Anchor target checks at recorded writes and distinguish whole-function checks.
Place effect and mutation records at their actual lines, make evidence navigable, prepare pattern indexes in the worker, and reuse wrapping measurements across same-function movement.
@shanejonas
shanejonas merged commit 2d31d31 into master Oct 30, 2026
16 of 17 checks passed
@shanejonas
shanejonas deleted the fix/tui-inline-findings branch October 30, 2026 13:49
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