Skip to content

fix(tui): use split pane bounds for URL clicks - #1313

Merged
edwin-zvs merged 1 commit into
mainfrom
fix-url-click-split-pane
Aug 28, 2026
Merged

edwin-zvs merged 1 commit into
mainfrom
fix-url-click-split-pane

Conversation

@edwin-zvs

Copy link
Copy Markdown
Contributor

Summary

  • resolve rendered URL hits against the concrete split pane under the pointer
  • preserve whole-view fallback for unsplit and zoomed layouts plus minibuffer handling
  • add a regression covering clicks on both rows of a URL wrapped at a split-pane edge

Root cause

Spec 0210 joins wrapped URL rows by checking whether the previous row filled its last cell. Split panes render at each pane inner edge, but URL hit-testing measured against the full outer view, so the real wrap edge looked like padding and the rows were never joined.

Test plan

  • cargo test -p construct-cli --bin construct url_hit (9 passed)
  • cargo build
  • git diff --check
  • cargo test -p construct-cli --bin construct (1459 passed; existing color::tests::truecolor_backend_still_emits_rgb failure reproduced on unchanged main)

No spec update: this restores the already-accepted pane-width behavior in spec 0210.

edwin-zvs added a commit that referenced this pull request Aug 28, 2026
The daemon rebuilds several derived session fields from transcripts at
startup — seq counter, message count, last-message/last-error snippets,
token tally (spec 0103), context gauge (spec 0104), fleet token history
(spec 0167) — so records written before a field existed, or that lagged a
crash, heal themselves.

It did that by reading every transcript in full, serially, before binding
the IPC socket. That is proportional to all history ever recorded. On a
fleet with 340 transcripts totalling 7 GB it put ~30s between launch and
the socket existing, every single start:

    loaded config  02:12:34.387
    listening      02:13:01.626    (+27.2s)

`construct daemon start` waits 5s, so it reported a daemon that had failed
while it was in fact still reading (#1313).

Checkpoint the fold. Each session stores its derived state in `scan.json`
next to the transcript, with the byte length that state reflects; the next
start `stat`s the file and reads only what was appended past that offset.
Transcripts are append-only, so a recorded length is always a line
boundary and equal lengths mean there is nothing to read.

The checkpoint is a discardable cache, never an authority: missing, stale
past EOF, or written at another version all fall back to a full walk.
Anything carried across the resume point is part of it — including the
model in effect where the scan stopped, without which usage recovered
after a resume attributes differently than a full walk (spec 0167).
Samples are pruned to the retention window as they are written, so the
file cannot accumulate history no consumer would accept back.

Checkpoints are written during startup only, before any adapter resumes
and while nothing can append — sampling a length and a fold state as one
consistent pair needs that quiet, or the race skips events in one
direction and double-counts them in the other.

Also raise `daemon start`'s readiness budget to the 60s the auto-start
path already allows: the first start after this change still pays one
full walk to seed the checkpoints.

Startup now logs what it read, so a slow start is a readable fact:

    transcript scan complete sessions=340 up_to_date=338 tail=2
      full=0 mib_read=3 elapsed_ms=214
@edwin-zvs
edwin-zvs merged commit fe41870 into main Aug 28, 2026
1 check passed
@edwin-zvs
edwin-zvs deleted the fix-url-click-split-pane branch August 28, 2026 22:20
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