chore: remove Tauri compatibility leftovers#93
Conversation
📝 WalkthroughWalkthroughRemoved Tauri-specific integrations across the app: titlebar logic and attributes, CSS drag selectors, a legacy Tauri→Electron migration module, and explicit CORS allowances for Tauri origins; updated docs to reference Electron and added tests ensuring Tauri artifacts are removed. Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related issues
Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/app/src/components/titlebar-tauri-compat.test.ts`:
- Around line 3-4: The test reads files into titlebarSource and baseCssSource
using Bun.file(...).text() with a hardcoded relative path
"../../../ui/src/styles/base.css"; update the test to document the expected
monorepo layout (add a brief comment near baseCssSource) and wrap the
Bun.file(...) call for baseCssSource in a defensive check/try-catch that
verifies existence or catches the file-not-found error and throws a clear,
descriptive message indicating the expected path and how to adjust it; keep the
titlebarSource read unchanged but ensure both reads use the same defensive
pattern around Bun.file(...).text() so CI failures show a clear diagnostic
instead of a raw file-not-found.
In `@packages/desktop-electron/src/main/tauri-cleanup.test.ts`:
- Around line 18-19: The test contains two assertions using
expect(readme).not.toMatch(...); remove the redundant, more specific assertion
expect(readme).not.toMatch(/packages\/desktop\s+tauri/) and keep the general
case expect(readme).not.toMatch(/tauri/i) so failures are clearer and not
duplicated; update the test in tauri-cleanup.test.ts by deleting the expect with
/packages\/desktop\s+tauri/.
In `@packages/opencode/test/server/cors-middleware.test.ts`:
- Around line 7-34: Replace raw bun:test "test" usages with the repository's
testEffect harness: import and call testEffect to get "it", then convert the two
tests ("allows localhost browser origins" and "does not allow legacy Tauri
origins") to use it.live or it.effect as appropriate and wrap their bodies in
Effect.gen(function* () { ... }); inside each generator yield the
Server.Default() service to obtain app (referencing Server.Default().app) and
perform the same app.request("/global/health", { headers: { Origin: ... } })
checks; keep the same assertions on response.status and
response.headers.get("access-control-allow-origin") but run them inside the
Effect.gen context so tests use the shared effect runtime and service injection
pattern.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 530737f6-e348-47cb-b5e2-9c2cf7054896
📒 Files selected for processing (8)
packages/app/src/components/titlebar-tauri-compat.test.tspackages/app/src/components/titlebar.tsxpackages/desktop-electron/README.mdpackages/desktop-electron/src/main/migrate.tspackages/desktop-electron/src/main/tauri-cleanup.test.tspackages/opencode/src/server/middleware.tspackages/opencode/test/server/cors-middleware.test.tspackages/ui/src/styles/base.css
💤 Files with no reviewable changes (2)
- packages/opencode/src/server/middleware.ts
- packages/desktop-electron/src/main/migrate.ts
There was a problem hiding this comment.
Code Review
This pull request migrates the desktop application from Tauri to Electron by removing Tauri-specific APIs, types, and configurations across the codebase. Key changes include updating the titlebar component to use shell-neutral drag regions, removing Tauri-specific CORS origins, and updating the desktop documentation and build scripts. New tests have been added to verify the cleanup of Tauri references. Feedback suggests removing a redundant drag region attribute in the titlebar and refining a broad regex check in the cleanup tests to avoid potential false positives in the future.
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@packages/opencode/test/server/cors-middleware.test.ts`:
- Around line 15-23: The test unnecessarily wraps an existing promise with
Promise.resolve inside Effect.promise; update the calls that use
Effect.promise(() => Promise.resolve(app.request(...))) to instead call
Effect.promise(() => app.request(...)) (remove the Promise.resolve wrapper) for
the instances that call app.request with Origin header (both occurrences around
the app.request("/global/health", ...) and the other similar call), ensuring you
only remove the redundant wrapper and leave the Effect.promise and app.request
usage and headers intact.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: ASSERTIVE
Plan: Pro Plus
Run ID: 08216b82-365e-451c-b1d3-2e5345e77ed7
📒 Files selected for processing (4)
packages/app/src/components/titlebar-tauri-compat.test.tspackages/app/src/components/titlebar.tsxpackages/desktop-electron/src/main/tauri-cleanup.test.tspackages/opencode/test/server/cors-middleware.test.ts
Summary
Remove the remaining Tauri-era compatibility surfaces from the GUI-only Electron app:
Why
PawWork is GUI-only and no longer ships a Tauri shell. Keeping stale Tauri compatibility code makes upstream sync and cherry-pick review noisier without preserving a supported product path.
Related Issue
Part of #91.
How To Verify
Also ran a focused source audit to confirm Tauri strings remain only in the new regression tests.
Screenshots or Recordings
Not included. This cleanup preserves the existing Electron titlebar drag behavior and does not introduce visible UI changes.
Checklist
devbranchSummary by CodeRabbit
Documentation
Refactor
Bug Fixes
Tests