Skip to content

refactor(rail): adopt Core 0.46.0 per-viewport rail-visuals predicate (v3.53.1.0)#197

Merged
sjvrensburg merged 2 commits into
mainfrom
refactor/core-0.46-rail-visuals-predicate
Jun 30, 2026
Merged

refactor(rail): adopt Core 0.46.0 per-viewport rail-visuals predicate (v3.53.1.0)#197
sjvrensburg merged 2 commits into
mainfrom
refactor/core-0.46-rail-visuals-predicate

Conversation

@sjvrensburg

Copy link
Copy Markdown
Owner

Summary

Adopts RailReaderCore 0.46.0's new per-viewport rail-visuals API (RailReaderCore#83), deleting the shell-side IsFreePanningThisViewport band-aid introduced in #196.

Core 0.46.0 adds two per-viewport RailNav members:

  • Paused — this view's rail is paused by an in-progress free pan (distinct from Active, which stays true so resume can restore the prior block/line).
  • VisualsVisibleActive && !Paused && HasAnalysis; the canonical "draw rail visuals now?" predicate.

Changes

  • Bump all RailReader.* packages 0.45.2 → 0.46.0 (RailReader2, Cli, Export.Tests).
  • DocumentView.BuildOverlayState → gate on _viewport?.Rail is { VisualsVisible: true } (equivalent to the old Active && HasAnalysis && NavigableCount>0 && !free-pan guard).
  • DocumentView.BuildPageState line-focus dim → gate on _viewport?.Rail.Paused != true, using Paused alone to preserve the exact prior condition (no NavigableCount>0 requirement, per the Core author's note).
  • Delete IsFreePanningThisViewport(vm) (the RailPaused && ReferenceEquals(view, FocusedViewport) workaround).

The four remaining RailPaused reads (ViewportPanel.EndGesture, MainWindow Ctrl-release, Documents.SelectTab, the VM passthrough) are input/lifecycle paths that correctly act on the focused viewport and are left as-is. The "rail visuals live" rule is no longer duplicated in the shell.

Behaviour-preserving (Core's change is additive/behaviour-preserving; the shell conditions are equivalent).

Verification

  • dotnet build RailReader2.slnx -c Release — 0 errors, 0 warnings.
  • dotnet test tests/RailReader.Export.Tests — 83/83 pass.
  • /simplify (4 parallel cleanup agents: reuse, simplification, efficiency, altitude) — clean; only a duplicated comment clause trimmed.

🤖 Generated with Claude Code

sjvrensburg and others added 2 commits June 30, 2026 09:51
Bump RailReader.* packages 0.45.2 -> 0.46.0 and replace the shell-side
IsFreePanningThisViewport band-aid (RailPaused && ReferenceEquals to the
focused viewport, from #196) with the new per-viewport RailNav predicates:

- BuildOverlayState gates on Rail.VisualsVisible (= Active && !Paused &&
  HasAnalysis), the canonical "draw rail visuals now?" check.
- BuildPageState line-focus dim gates on Rail.Paused alone, preserving the
  exact prior condition (no NavigableCount>0 requirement, per the Core
  author's note).

The four remaining RailPaused reads are input/lifecycle paths that
correctly act on the focused viewport and are left as-is. Behaviour-
preserving; the "rail visuals live" rule is no longer duplicated in the
shell. Completes the railreader2 follow-up to RailReaderCore#83.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@sjvrensburg
sjvrensburg merged commit fd29761 into main Jun 30, 2026
2 checks passed
@sjvrensburg
sjvrensburg deleted the refactor/core-0.46-rail-visuals-predicate branch June 30, 2026 07:52
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