Skip to content

feat(web): surface copyable CCCC commands from error messages - #243

Merged
ChesterRa merged 1 commit into
mainfrom
feat/copyable-error-commands
Dec 1, 2026
Merged

ChesterRa merged 1 commit into
mainfrom
feat/copyable-error-commands

Conversation

@waterbang

Copy link
Copy Markdown
Collaborator

What

Some daemon errors can only be fixed by running a CCCC command, and they quote it in backticks, e.g. the Antigravity ACP authentication error: "… Complete separate ACP login with cccc setup … --login." Today that command is buried in a toast that disappears after eight seconds, which is too short to read it, switch to a terminal and copy it.

When an error message quotes a cccc … command, the error toast now:

  • says what to do in plain words (a specific sentence for the Antigravity ACP sign-in, a generic one otherwise);
  • shows the command on its own line with a Copy command key, reporting "Copied" or "Copy failed";
  • keeps the daemon's original message under an Original error disclosure;
  • stays on screen until dismissed. Errors without a command behave exactly as before and still clear by themselves.

Only a backtick-quoted command starting with cccc counts; other quoted text such as IDs or paths is ignored, and a command the message wrapped over lines is joined into one line. Parsing lives in web/src/utils/commandError.ts; AppFeedback.tsx renders it and useUIStore.showError skips the auto-dismiss timer for these errors. Strings are added in en/zh/ja.

Verification

  • commandError.test.ts (3 tests): the Antigravity ACP login command, any other quoted CCCC command, and a command wrapped over lines.
  • AppFeedback.command.test.tsx (5 tests): the plain-words text and exact copied command, the original message under the disclosure, the copy-failure state, an error without a command left unchanged, and the toast staying until dismissed while a plain error still clears.
  • scripts/quality_gate.sh fast (format, lint, typecheck) passes on this branch; the app, store and util test files pass on this base (174 tests).

@ChesterRa
ChesterRa merged commit ac970f8 into main Dec 1, 2026
12 of 14 checks passed
ChesterRa added a commit that referenced this pull request Dec 1, 2026
Recognize the daemon's own wording for an Antigravity ACP session that
did not open, and show its fixed login command, instead of taking any
quoted cccc command from an error. An error can give several commands
to run in order, and one picked out alone loses that order. This error
stays on screen until dismissed. Other timed errors show their own text
and close after eight seconds, as before.

The hint no longer says Antigravity is not signed in: the daemon uses
the same words whenever its session/new or session/load request fails,
a timeout included. It says the session could not be opened and to run
the command if sign-in is needed. The original message stays one click
away. The daemon keeps that sentence in one constant, with a test that
names the Web file, so a rewording cannot drop the command unnoticed.

Follows up the change merged from #243.

Verified with the Web checks and Web tests, including errors that quote
other commands and the login sentence without the daemon's first
sentence, the daemon test for the sentence, and the 138 pytest tests,
including the locale key checks.
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.

2 participants