Skip to content

Rename dialog shows one failure toast when a save cannot be sent - #1283

Merged
Hona merged 2 commits into
devfrom
upstream-f/unsent-one-toast
Nov 26, 2026
Merged

Hona merged 2 commits into
devfrom
upstream-f/unsent-one-toast

Conversation

@Hona

@Hona Hona commented Nov 26, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #1269 for the Rename dialog (features/session-menu/src/rename_dialog.rs), which showed two failure toasts when a rename could not be sent (no writer or read-only window). Ours-only fault: no official commit, so no ledger row.

(Earlier commit 539eda374 also touched permission/question replies and queued prompt changes. Reading features/timeline-extras/src/permission/mod.rs:150-154 and :168-172 confirmed reply_permission and send_form already return early on !writes_open() and App::write shows no toast on Ok(false), so those replies never had a double toast; those edits were dropped. Queued prompt changes need a live --read-only server to exercise and are split into their own draft PR.)

What changes

The save Official Ours before Ours now
Could not be sent (no server) one toast: "Request failed", description = error.message (packages/app/src/shell/titlebar/project-session-row.tsx:276-280) two: "Not connected to an OpenCode server" / "Nothing was sent." and "Request failed" / "Not connected to an OpenCode server" one: "Request failed" / "Not connected to an OpenCode server"
Read-only window (ours only) n/a two: "Nothing was sent" / read-only and "Request failed" / "Not connected to an OpenCode server" one: "Nothing was sent" / "This window is read-only. Relaunch without --read-only to act."
No answer in 15 s one toast: "Request failed" / "Request failed" (project-session-row.tsx:279) same same
Refused by server one toast: "Request failed" + server words same (session_write_replied, #1269) same

How

  • features/session-menu/src/rename_dialog.rs: Effect::Save calls SessionMenuHost::write_server_quiet (added in A failed in-place rename says so once, in official's words #1269) instead of write_server, and dispatch takes crate::rename::Why::{Unsaid, NotSent, ReadOnly, Refused} instead of comparing a translated string.
  • features/session-menu/src/lib.rs: passes said (rename::Why) into rename_dialog::dispatch.

2 files; no manifest, lock, profile or plugin contract change.

Run

A PR build is of the PR's own head. Before = opencode-rune #1271's own PR build, head 278f9aaf38, run 45709668204: dev a5c55ecf42 with the Rune pin 5342f14d and nothing of this change.

  • On 539eda3745 (Windows x64 CI build, run 45728438752; headless, the app's own fixture file, no server; same rename_dialog.rs + lib.rs code as eb691d78c):
    • Case 1 holds: Home Inbox card menu -> Rename, "By the dialog", Return: dialog stays open in editing (input focused with "By the dialog"), one toast "Request failed" / "Not connected to an OpenCode server". Before (278f9aaf38): two toasts ("Not connected to an OpenCode server" / "Nothing was sent." and "Request failed" / "Not connected to an OpenCode server").
    • Case 2 (sample) holds: /rename New words, Return: one generic toast "Not connected to an OpenCode server" / "Nothing was sent.".
  • On eb691d78cc, the head that merges (Windows x64 CI build, run 45731749564; headless, the app's own fixture file, no server; 2 launches exit 0; before = chore(pgo): the profiles re-keyed to Rune 5342f14d's symbol names #1271 278f9aaf38 run 45709668204):
    • Case 1 holds: Home Inbox card menu -> Rename, "By the dialog", Return: dialog stays open in editing (input focused with "By the dialog"), one toast "Request failed" / "Not connected to an OpenCode server". Before (278f9aaf38): two toasts ("Not connected to an OpenCode server" / "Nothing was sent." and "Request failed" / "Not connected to an OpenCode server").
    • Case 2 (sample) holds: /rename New words, Return: one generic toast "Not connected to an OpenCode server" / "Nothing was sent.".
  • Merged on: CI run 45731749564 green on eb691d78cc (guardrails, macOS, Windows x64, Windows arm64, Linux x64; Linux arm64 skipped). dev took no file of this change since its base.

Not run (each needs a live server): a --read-only live window, a server refusal, and a 15 s timeout.

Hona added 2 commits November 26, 2026 10:23
…eue changes show one toast

Follow-up to #1269 for the four remaining write paths whose own state machines emit a failure toast when a write cannot be sent: rename dialog (features/session-menu/src/rename_dialog.rs), permission and question form replies (features/timeline-extras/src/permission/mod.rs), and queued prompt changes (features/inbox/src/queue/{mod,run}.rs).

Each now offers its write quietly via App::write_quiet so the machine emits a single toast: official's Request failed (or queue changeFailed) with the cause Not connected to an OpenCode server when no writer is attached, and our single read-only toast in a read-only window.
…and split queue

Reading permission/mod.rs:150-154 and :168-172 shows reply_permission and send_form already return early through host.write when !writes_open(), and App::write emits no toast on Ok(false) (dead channel), so permission and question form replies never showed a double toast. Queued prompt changes require a live --read-only server to exercise (fixture mutates locally) and move to their own draft PR.
@Hona Hona changed the title Unsent writes from rename dialog, question/permission replies, and queue changes show one toast Rename dialog shows one failure toast when a save cannot be sent Nov 26, 2026
@Hona
Hona marked this pull request as ready for review November 26, 2026 01:16
@Hona
Hona merged commit d2c2eee into dev Nov 26, 2026
7 checks passed
@Hona
Hona deleted the upstream-f/unsent-one-toast branch November 26, 2026 01:16
Hona added a commit that referenced this pull request Nov 26, 2026
…hen read-only (#1284)

Split out from #1283 because offline fixture runs mutate the queue locally and proving this requires a live --read-only server. Uses QueueHost::write_quiet (backed by App::write_quiet) in run_queue_op so step_queue emits one toast instead of two, and checks QueueHost::is_read_only() in Effect::Failed(None) so read-only windows show our read-only toast instead of Not connected.
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