Skip to content

Fix macos updating#35

Merged
nedtwigg merged 10 commits intomainfrom
fix-apple-update
Apr 30, 2026
Merged

Fix macos updating#35
nedtwigg merged 10 commits intomainfrom
fix-apple-update

Conversation

@nedtwigg
Copy link
Copy Markdown
Member

No description provided.

nedtwigg and others added 9 commits April 30, 2026 09:58
When an update install throws (e.g. macOS Gatekeeper translocation,
permission denied on /Applications, signature verify failure), the
banner now reads "Update failed. [Click here to debug]" and the link
opens a modal that helps the user (a) search existing GitHub issues
and (b) copy a pre-filled bug report — version, platform, error, and
the last ~10 KB of mouseterm.log — and open the new-issue page.

A new read_update_log Tauri command exposes default_log_path() to the
JS side so the report includes the sidecar/setup output that explains
why pendingUpdate.install() rejected.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- buildDebugReport returns just the markdown body string (callers only
  used .body); drops the DebugReport interface and detectPlatform helper.
- Extract PLATFORM_STRING in lib/platform alongside IS_MAC so the lib
  and standalone share one source of truth for browser platform detection.
- Replace three open(URL).catch(console.error) call sites with a small
  openUrl(url, context) helper.
- Trim UpdateDebugDialog props from 5 to 4: a single failure object
  replaces the parallel targetVersion/errorPreview pair, and the body
  string replaces the report. The parent only renders the dialog when
  failure is non-null.
- Banner: replace the 'changelog'|'debug'|null action variable with a
  {label, onClick} per case so there's one button JSX, not three.
- Dialog: hoist layout classes onto <dialog>, drop the wrapper <div>.
- Move the "Copied!" reset into a cleanup-aware effect so the timeout
  can't fire after unmount.
- Add the mouseterm-lib alias to vitest.config.ts so the new
  cross-package import resolves under jsdom.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
- Banner switch now has an exhaustive default with a `never` check, so
  adding a future UpdateBannerState variant fails at compile time
  instead of leaving `link` undefined at render.
- Report body says `**Error**: (none captured)` when the error string
  is empty, matching the dialog's existing placeholder.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The release checklist used to enumerate four files to edit by hand. The
hidden fifth file is Cargo.lock — it carries its own `mouseterm`
package version and only updates when cargo runs, so committing the
Cargo.toml bump without also running cargo would ship a release with
mismatched lockfile metadata (which is what just happened on v0.8.0).

Replace step 3 with `./scripts/bump-version.sh X.Y.Z`, which edits the
four files in lockstep and runs `cargo check` to bring Cargo.lock
along.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Two related fixes for the failure-marker session:

- updater.ts: skip the auto-update probe when we just consumed a
  `failed: true` marker. Re-running check()/download() on that launch
  fetches the same artifact that just failed (it'll fail again on quit)
  and the state transition to `downloaded` was unmounting any open
  debug dialog. Failed updates retry on the next launch.

- main.tsx: snapshot the failure into local state when the user opens
  the dialog. The dialog renders from the snapshot, not from live
  banner state, so it persists through any state change (including the
  user X-dismissing the banner). debugOpen boolean goes away — dialog
  open ↔ snapshot non-null.

Also fix a stray layout bug in UpdateDebugDialog: `flex flex-col
max-h-[80vh]` on <dialog> with `flex-1 overflow-y-auto` on the body
collapsed the body to 0 height (only the first paragraph was visible).
Drop the flex column, put overflow-y-auto on the dialog itself, and
make the header sticky.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The dialog imports from standalone/src/updater, which transitively
pulls in @tauri-apps/api/{app,core}, plugin-shell, plugin-updater, and
mouseterm-lib/lib/platform — none of which resolve in a Storybook
build. Add a tauri-stub.ts with no-op exports for the named imports
those modules expose, and alias each Tauri package plus mouseterm-lib
in .storybook/main.ts so the dialog can render in Storybook the same
way the existing UpdateBanner story does.

Also fix UpdateBanner.stories.tsx, which has been broken since the
banner gained a required onOpenDebug prop.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Drop the "Copy report" and "Open new issue" buttons; section 2's text
now reads "If you can't find an existing bug, copy this report and
paste it into a new issue." where "copy this report" is a link that
copies the report and shows a transient "— copied!" hint beside it.

Two layout-stability things:
- The link text is decoupled from the feedback, so the line never
  reflows when the user clicks (the original swap from "copy this
  report" to "copied!" was making the dialog shrink to fit content).
- The dialog's width is now an inline style instead of a Tailwind
  arbitrary value, ruling out any cascade interaction with the native
  <dialog> UA stylesheet's `width: fit-content`.

Also remove the now-unused openNewIssue export from updater.ts.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
The signed v0.8.0 .tar.gz contained ._MouseTerm.app sidecars (the
resource-fork metadata macOS's tar emits by default), which broke the
Tauri updater on every v0.7.x → v0.8.0 install attempt:

  failed to unpack `._MouseTerm.app` into /var/folders/.../tauri_updated_app…

Set COPYFILE_DISABLE=1 to stop macOS's tar from writing ._* entries,
and add a post-build assertion that fails loudly if any slip in.

Doesn't help users already on v0.8.0; this fix takes effect at the
next release.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 30, 2026

Deploying mouseterm with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2a07dcd
Status: ✅  Deploy successful!
Preview URL: https://7dd0705e.mouseterm.pages.dev
Branch Preview URL: https://fix-apple-update.mouseterm.pages.dev

View logs

@nedtwigg nedtwigg merged commit d5bcb96 into main Apr 30, 2026
6 checks passed
@nedtwigg nedtwigg deleted the fix-apple-update branch April 30, 2026 20:07
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