Skip to content

Uninstall: report success per step and say when a step failed - #199

Merged
fylorn merged 1 commit into
devfrom
fix/uninstall-step-results
Sep 25, 2026
Merged

fylorn merged 1 commit into
devfrom
fix/uninstall-step-results

Conversation

@fylorn

@fylorn fylorn commented Sep 25, 2026

Copy link
Copy Markdown
Contributor

The uninstall dialog titled its result "Uninstall complete" even when a step had failed, because uninstall returned plain text lines and the UI could not tell which ones were failures (found while reviewing #194).

  • uninstall returns Vec<UninstallStep> ({ ok, text }, new in wire.rs, generated into lite-api.ts). Restores carry the restore result; launch at login and data-directory deletion report failures; "data kept" and the closing instruction count as ok. The Linux menu-entry removal (desktop_entry::remove) returns steps too.
  • The dialog's title says "卸载已结束,N 项未成功" / "Uninstall finished; N steps failed" when any step failed, and failed lines get an error dot and destructive text. The settings row keeps showing the last line.
  • No compatibility shim: the command's return type changed together with its only caller.

Checks: pnpm typecheck, pnpm test, cargo fmt --check, cargo clippy --all-targets -D warnings, cargo test --lib, ts_bindings (macOS). The Linux-only desktop_entry change is covered by the Rust (Linux) job. Checked the dialog in the preview harness with a failing launch-at-login step and with all steps succeeding.

🤖 Generated with Claude Code

… failed

`uninstall` returned plain lines, so the dialog always titled the result
"Uninstall complete", even when turning off launch at login or deleting
the data directory had failed. Telling success from failure by parsing a
sentence would break with the other UI language.

The command now returns `UninstallStep { ok, text }` per step (generated
into lite-api.ts via wire.rs). Informational steps (data kept, what to do
next) count as ok. The dialog titles the result "卸载已结束,N 项未成功" /
"Uninstall finished; N steps failed" when any step failed, and marks those
lines with an error dot and destructive text. The Linux menu-entry removal
reports its steps the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fylorn
fylorn merged commit 3b8638e into dev Sep 25, 2026
4 checks passed
@fylorn
fylorn deleted the fix/uninstall-step-results branch September 25, 2026 00:46
fylorn added a commit that referenced this pull request Sep 25, 2026
Generated with `pnpm shots` on dev at 3b8638e (after the Keys, Clients,
Routing, Upstreams, Settings, Traffic and Overview redesigns, #190-#199),
core v0.47.0. Two complete runs produce byte-identical files.

- `{zh,en}/<scene>-{light,dark}.png`: 13 scenes, 2360x1540.
- `menubar-{light,dark}.png` (178x64) and `{zh,en}/menubar-menu-*.png`
  (664x1120).
- `web/`: the website variants (WebP from the dark images, and the dark
  menu bar item as PNG).

The English menu images were drawn with the menu bar layout fix from
#195 applied, which this branch does not contain: without it, "Resets in
3 days" and "4 failed" run into the text beside them. Every other image,
including the Chinese menus, is the same with or without that fix.

The old images and the README references are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fylorn added a commit that referenced this pull request Sep 25, 2026
)

* build(shots): regenerate the product screenshots from the real interface

The screenshots in docs/screenshots/ were taken with a pipeline that
lived in an ignored local directory and was lost. This one is in the
repository and runs with one command, `pnpm shots` (macOS only):

- scripts/shots/ is a separate Vite entry that mounts src/main.tsx on
  mocked IPC. It is not part of the app build, and src/index.css now
  keeps scripts/ out of Tailwind's source scan, so the app bundle is the
  same with or without it.
- The configuration views (upstreams, keys, routes, security rules,
  prices, dry runs) are what the pinned core answers for a demo
  configuration, stored in scripts/shots/core/ and regenerated by
  oracle.sh. Masking, detected protocols, rule flags and prices are
  therefore core's own, and sentences carry their real message codes.
- The clock is fixed and the traffic comes from a fixed seed, so two
  runs write byte-identical files.
- capture.swift renders each scene in the system WKWebView, the engine
  the app uses on macOS, and frames it as a macOS 26 window.
- examples/menubar_shots.rs draws the menu bar item and its menu with
  the app's own rendering code, at exactly 2x.
- finish.mjs writes 256-colour PNGs to docs/screenshots/ and the
  website's WebP variants to docs/screenshots/web/. sharp is a new dev
  dependency; its install script is not needed and not allowed to run.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* build(shots): follow the redesigned pages and catch mock drift in CI

The Keys and Clients redesign (#190) changed `key_usage` to take
`{sinceMs, bucketMs}` and return `KeyUsage`, and `upstream_stats` gained
hourly buckets. The mock still answered the old shapes, and nothing
failed: its command handlers returned `unknown`, so the pages rendered
error states that the capture accepted.

- Every Tauri command handler now returns the type the interface reads
  (`KeyUsage`, `UpstreamStats`, `Dashboard`, `ConnView`, ...), and the
  stored core answers are checked against the core types. `pnpm
  typecheck`, which CI runs, now includes `scripts/shots/`, so a changed
  generated type fails the Frontend job. It already caught the Overview
  redesign (#196) dropping `history` from `Dashboard`.
- At capture time, a command the mock does not answer or one called
  without the arguments it expects is logged as an error and stops the
  run, instead of falling back to a default time window.
- `key_usage` and `upstream_stats` return totals plus sparse buckets, as
  tw-store's `cost_by` / `cost_buckets_by` do; `input_tokens` in the
  totals no longer includes cache reads and writes. `dashboard` computes
  latency over the same window as the summary, with tw-store's
  percentile rule, as dashboard.rs now asks for.
- The menu bar images take the page's fixed clock (`--now`) instead of
  the system clock, so runs on different days are byte-identical. Run on
  its own, `menubar_shots` uses the same instant.
- A scene with a table that does not fit the window fails instead of
  being captured with its last columns cut off. The MCP scene collapses
  the sidebar so the six client columns fit.
- Demo configuration: every secret keeps the first 5 and last 4
  characters shown in the masked views, with EXAMPLE in the middle (zeros
  for the hex control key). Cursor's key gets its own route to a
  `cheapest` group, so the routing page has three routes and three
  groups; the core answers are regenerated with oracle.sh (core v0.47.0).
- Review fixes: the hidden-text event counts 74 characters, the length of
  the text it reveals; the remote MCP finding uses tw-scan's rule id
  `remote-mcp`; CONTRIBUTING names `fetch-core.sh` and uses US spelling.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* docs(screenshots): add screenshots of the current interface

Generated with `pnpm shots` on dev at 3b8638e (after the Keys, Clients,
Routing, Upstreams, Settings, Traffic and Overview redesigns, #190-#199),
core v0.47.0. Two complete runs produce byte-identical files.

- `{zh,en}/<scene>-{light,dark}.png`: 13 scenes, 2360x1540.
- `menubar-{light,dark}.png` (178x64) and `{zh,en}/menubar-menu-*.png`
  (664x1120).
- `web/`: the website variants (WebP from the dark images, and the dark
  menu bar item as PNG).

The English menu images were drawn with the menu bar layout fix from
#195 applied, which this branch does not contain: without it, "Resets in
3 days" and "4 failed" run into the text beside them. Every other image,
including the Chinese menus, is the same with or without that fix.

The old images and the README references are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* shots: wait for the traffic table's deferred render before capturing

The table body renders through useDeferredValue; on a busy machine the
capture's idle and stable-snapshot checks pass before that render commits,
and the scene is shot with only the in-flight row while the run succeeds.
Wait until the table has its rows. Images are unchanged at normal speed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@fylorn fylorn mentioned this pull request Sep 25, 2026
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