feat(host): a sidebar pin or section write answers once the followed sidebar has its transaction

Merged
CH
10d ago
+91-6

This is the host half of the txid wait for repository pins and sidebar sections. It follows #4434, where those writes return their txid, and builds on #4423, which added the shared confirmWrite / onTxWait.

What changed:

  • workspaces-follow.ts: LiveReadDependencies takes an optional onTxWait and passes it through to liveRows.
  • compose-tasks.ts: the sidebar follow keeps the wait it is handed. That wait is cleared once the follow is let go or falls back to polling. TASKS_PIN_REPOSITORY and TASKS_WRITE_SECTION now call confirmWrite(wait, txid) before they update the view and reply to the window. Without this, a Realtime delivery from before the write could put the old sidebar back on screen.
  • Waiting is skipped when the write changed no row (no txid), or when the sidebar is polled or not followed yet. Per #4423, the wait still confirms after 10 s.

Out of scope: task pins. They belong to the tasks-and-agents area.

Test (compose-tasks.test.ts): before the first refresh, a write waits on nothing. Once the sidebar is followed, a section write and a repository pin each wait until their txid arrives. A pin that changed nothing replies at once. With the confirmWrite call removed, the test fails.

Made with Luke


Devin Review