Skip to content

diff: a pane nothing can draw yet is kept, and shows once something can - #99141

Open
poteat wants to merge 2 commits into
mainfrom
poteat/diff-awaits-surface
Open

poteat wants to merge 2 commits into
mainfrom
poteat/diff-awaits-surface

Conversation

@poteat

@poteat poteat commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

Summary

TLDR: /diff opened before anything can draw its pane keeps the pane, and it shows as soon as something can.

Stacked on #99118: its one commit shows here until that merges.

Notes

Where nothing is attached that draws a pane yet (a host whose page has not attached), the engine answers an open isPlaced: false with a reason that starts no-surface. The mod read every unplaced open as one left waiting for width and withdrew it, so the pane was lost: it never showed once the page attached.

Topic Detail
An open answered no-surface kept; /diff answers "Nothing here can draw the diff panel yet; it opens as soon as something can"
While no one sees it nothing polls and nothing refreshes; an edit reads nothing
Its first drawing reads the repository again, and counts the pane shown with the trigger it was opened by
An open left waiting for width withdrawn, as before
An engine that resolves nothing, or never gives that reason reads as before: placed, or withdrawn

Test Plan

  • claude plugin test mods/diff passes: 215 pass, 0 fail
  • /diff typed where nothing draws yet: the pane is kept, HEAD is read once and not polled, nothing is counted shown; the first drawing has what the open read, reads again, and counts it
  • An edit while the pane waits unseen runs no git
  • /diff again closes it, as an open pane
  • In a terminal the pane is placed as before, with no new line

Revert-proof: 2 new tests fail with the mod's hooks reverted (the mod's own suite, run against the unchanged hooks)

Changelog

Fixed the /diff pane being lost when /diff ran before the page that draws it had attached

poteat added 2 commits October 2, 2026 18:35
The pane and the dialog were opened with holdToasts, which holds every toast while the pane is shown: other plugins' and the app's own, as this plugin's. Nothing in the mod relies on the hold, and a toast no longer lands between the pane and the prompt, so the option goes from both opens.
An open the engine answers no-surface (nothing is attached that draws it yet, as before a host's page attaches) was withdrawn like one left waiting for width, so the pane was lost. It is kept: /diff says so, nothing polls or refreshes while no one sees the pane, and its first drawing reads the repository again and counts it shown.
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