fix: resolve web public assets via alias#822
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
✅ Files skipped from review due to trivial changes (2)
📝 WalkthroughWalkthroughBoth Vitest configuration files now include a Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~2 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
mavishay
left a comment
There was a problem hiding this comment.
Thanks for the contribution and for digging into the Windows test resolution issue — this is a real problem worth solving.
After reviewing the PR, we have a few concerns before we can merge:
1. Potential conflict with CLAUDE.md guidance
Our codebase guidelines specify that image assets should use ES module imports with /assets/... paths to ensure they work correctly in the packaged Electron app. Switching to an @assets alias changes how Vite handles these at build time — assets imported via alias go through Vite's asset pipeline (content-hashed, potentially inlined), whereas /assets/... files from the public/ directory are served as-is. This is a subtle but meaningful behavioral difference that could affect the packaged desktop build.
2. Needs verification in the packaged app
Could you confirm that the Electron app still loads all assets correctly after this change? Specifically:
- Run
pnpm build:desktopand verify the packaged app renders logos and icons as expected. - The key concern is whether the
@assetsalias resolves correctly in the renderer process at runtime in the packaged (non-dev) build.
3. Scope of the fix
A global refactor of 24 files is a large blast radius for a Windows test environment issue. Have you explored a more targeted fix — for example, adjusting the jsdom/vitest configuration to handle public/ assets correctly in tests without changing how the app imports them?
We appreciate the effort here and would love to find a path to merging a fix for the Windows issue. Happy to collaborate on a scoped solution if the full alias approach turns out to have packaged-app regressions.
mavishay
left a comment
There was a problem hiding this comment.
Thanks for the contribution and for digging into the Windows test resolution issue — this is a real problem worth solving.
After reviewing the PR, we have a few concerns before we can merge:
1. Potential conflict with our asset import convention
Our codebase guidelines specify that image assets should use ES module imports with /assets/... paths to ensure they work correctly in the packaged Electron app. Switching to an @assets alias changes how Vite handles these at build time — assets imported via alias go through Vite's asset pipeline (content-hashed, potentially inlined), whereas /assets/... files from the public/ directory are served as-is. This is a subtle but meaningful behavioral difference that could affect the packaged desktop build.
2. Needs verification in the packaged app
Could you confirm that the Electron app still loads all assets correctly after this change? Specifically:
- Run
pnpm build:desktopand verify the packaged app renders logos and icons as expected. - The key concern is whether the
@assetsalias resolves correctly in the renderer process at runtime in the packaged (non-dev) build.
3. Scope of the fix
A global refactor of 24 files is a large blast radius for a Windows test environment issue. Have you explored a more targeted fix — for example, adjusting the jsdom/vitest configuration to handle public/ assets correctly in tests without changing how the app imports them?
We appreciate the effort here and would love to find a path to merging a fix for the Windows issue. Happy to collaborate on a scoped solution if the packaged-app concerns are addressed.
|
Reworked this PR to keep the app/runtime behavior aligned with the existing What changed:
Verification:
I also tried the remaining desktop MCP bundle step, but |
Summary
@assetsalias for the web app in Vite, Vitest, and TypeScript config/assets/...paths to@assets/...file:///assets/...resolution failure that was preventing several integration suites from loadingTesting
corepack pnpm --filter @accomplish/web typecheckcorepack pnpm --filter @accomplish/web buildcorepack pnpm --filter @accomplish/web exec vitest run __tests__/integration/renderer/components/TaskLauncher.integration.test.tsx --config vitest.integration.config.tsNotes
corepack pnpm --filter @accomplish/web test:integrationnow gets past the previous asset import crash on Windows.SettingsDialog.integration.test.tsxandExecution.integration.test.tsx, which are outside the scope of this asset-resolution fix.Summary by CodeRabbit