feat: Improved Custom Protocol Routing#165
Conversation
Build artifacts for all platforms are ready! 🚀Download the artifacts from: (execution 18951159478 / attempt 1) |
|
Warning Rate limit exceeded@iamEvanYT has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 3 minutes and 46 seconds before requesting another review. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. 📒 Files selected for processing (8)
WalkthroughThis PR refactors the application's protocol handling and frontend routing system. It introduces a new frontend route generation infrastructure using Hono, replaces monolithic protocol handlers with modular Hono-based applications, migrates from Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Areas requiring extra attention:
Possibly related PRs
Suggested labels
Poem
Pre-merge checks and finishing touches❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
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 |
|
@coderabbitai review |
✅ Actions performedReview triggered.
|
There was a problem hiding this comment.
Actionable comments posted: 11
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (2)
src/renderer/src/routes/extensions/page.tsx (1)
22-22: Race condition: sharedisProcessingstate can cause inconsistent UI behavior.The single
isProcessingboolean is shared across all extension operations (enable/disable, pin/unpin). If a user triggers multiple operations concurrently—for example, toggling one extension while pinning another—the first operation to complete will resetisProcessingtofalse, prematurely re-enabling UI controls while other operations are still in flight.Consider using per-extension processing state instead:
- const [isProcessing, setIsProcessing] = useState(false); + const [processingExtensions, setProcessingExtensions] = useState<Set<string>>(new Set());Then update the handlers:
const setExtensionEnabled = async (id: string, enabled: boolean) => { - setIsProcessing(true); + setProcessingExtensions(prev => new Set(prev).add(id)); const success = await flow.extensions.setExtensionEnabled(id, enabled); if (success) { toast.success(`This extension has been successfully ${enabled ? "enabled" : "disabled"}!`); } else { toast.error(`Failed to ${enabled ? "enable" : "disable"} this extension!`); } - setIsProcessing(false); + setProcessingExtensions(prev => { + const next = new Set(prev); + next.delete(id); + return next; + }); return success; };And pass
processingExtensions.has(extension.id)instead ofisProcessingto child components.src/renderer/src/routes/pdf-viewer/page.tsx (1)
6-19: Consider optional UX improvements.The core logic correctly uses the cacheURL fallback and passes the appropriate path to the PDF viewer. Consider these optional enhancements:
- Title element (line 15): The raw URL may be too long or not user-friendly. Consider extracting a filename or using a formatted title.
- URL validation: No validation that the URL is well-formed or accessible before passing to
PDFViewerApp.- Loading state: No loading indicator while the PDF is being fetched.
These are nice-to-have improvements rather than critical issues.
♻️ Duplicate comments (5)
src/renderer/src/routes/games/config.tsx (1)
5-9: Same Fallback removal pattern.This change is identical to the pattern in
src/renderer/src/routes/omnibox-debug/config.tsx. Refer to the consolidated verification comment in that file.src/renderer/src/routes/settings/config.tsx (1)
5-9: Same Fallback removal pattern.This change is identical to the pattern in
src/renderer/src/routes/omnibox-debug/config.tsx. Refer to the consolidated verification comment in that file.src/renderer/src/routes/popup-ui/config.tsx (1)
5-9: Same Fallback removal pattern.This change is identical to the pattern in
src/renderer/src/routes/omnibox-debug/config.tsx. Refer to the consolidated verification comment in that file.src/renderer/src/routes/new-tab/config.tsx (1)
5-9: Same Fallback removal pattern.This change is identical to the pattern in
src/renderer/src/routes/omnibox-debug/config.tsx. Refer to the consolidated verification comment in that file.src/renderer/src/routes/about/config.tsx (1)
5-9: Same Fallback removal pattern.This change is identical to the pattern in
src/renderer/src/routes/omnibox-debug/config.tsx. Refer to the consolidated verification comment in that file.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (67)
docs/contributing/dependencies.md(1 hunks)electron.vite.config.ts(2 hunks)package.json(2 hunks)scripts/frontend-routes-generator/common.ts(1 hunks)scripts/frontend-routes-generator/generator.ts(1 hunks)scripts/frontend-routes-generator/pruner.ts(1 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow-external.ts(0 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow-external/index.ts(1 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow-internal.ts(0 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow-internal/active-favicon.ts(1 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow-internal/index.ts(1 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow.ts(0 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow/assets.ts(1 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow/extension-icon.ts(1 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow/favicon.ts(1 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow/index.ts(1 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow/pdf-cache.ts(1 hunks)src/main/controllers/sessions-controller/protocols/index.ts(2 hunks)src/main/controllers/sessions-controller/protocols/static-domains/config.ts(1 hunks)src/main/controllers/sessions-controller/protocols/static-domains/index.ts(1 hunks)src/main/controllers/sessions-controller/protocols/static-domains/serve-static.ts(1 hunks)src/main/controllers/sessions-controller/protocols/static-domains/types.ts(1 hunks)src/main/controllers/sessions-controller/protocols/types.ts(1 hunks)src/main/controllers/sessions-controller/protocols/utils.ts(3 hunks)src/main/controllers/windows-controller/interfaces/onboarding.ts(1 hunks)src/main/controllers/windows-controller/interfaces/settings.ts(1 hunks)src/main/controllers/windows-controller/types/base.ts(3 hunks)src/main/controllers/windows-controller/types/settings.ts(1 hunks)src/main/modules/typed-event-emitter.ts(1 hunks)src/main/modules/utils.ts(1 hunks)src/renderer/.gitignore(1 hunks)src/renderer/index.html(0 hunks)src/renderer/src/App.tsx(0 hunks)src/renderer/src/components/main/theme.tsx(3 hunks)src/renderer/src/components/providers/nuqs-provider.tsx(1 hunks)src/renderer/src/main.tsx(0 hunks)src/renderer/src/router/README.md(0 hunks)src/renderer/src/router/provider.tsx(0 hunks)src/renderer/src/router/route.tsx(0 hunks)src/renderer/src/routes/about/config.tsx(1 hunks)src/renderer/src/routes/about/route.tsx(0 hunks)src/renderer/src/routes/error/config.tsx(1 hunks)src/renderer/src/routes/error/route.tsx(0 hunks)src/renderer/src/routes/extensions/config.tsx(1 hunks)src/renderer/src/routes/extensions/page.tsx(2 hunks)src/renderer/src/routes/extensions/route.tsx(0 hunks)src/renderer/src/routes/games/config.tsx(1 hunks)src/renderer/src/routes/games/route.tsx(0 hunks)src/renderer/src/routes/main-ui/config.tsx(1 hunks)src/renderer/src/routes/main-ui/route.tsx(0 hunks)src/renderer/src/routes/new-tab/config.tsx(1 hunks)src/renderer/src/routes/new-tab/route.tsx(0 hunks)src/renderer/src/routes/omnibox-debug/config.tsx(1 hunks)src/renderer/src/routes/omnibox-debug/route.tsx(0 hunks)src/renderer/src/routes/omnibox/config.tsx(1 hunks)src/renderer/src/routes/omnibox/route.tsx(0 hunks)src/renderer/src/routes/onboarding/config.tsx(1 hunks)src/renderer/src/routes/onboarding/route.tsx(0 hunks)src/renderer/src/routes/pdf-viewer/config.tsx(2 hunks)src/renderer/src/routes/pdf-viewer/page.tsx(1 hunks)src/renderer/src/routes/pdf-viewer/route.tsx(0 hunks)src/renderer/src/routes/popup-ui/config.tsx(1 hunks)src/renderer/src/routes/popup-ui/route.tsx(0 hunks)src/renderer/src/routes/settings/config.tsx(1 hunks)src/renderer/src/routes/settings/route.tsx(0 hunks)src/renderer/src/types/routes.ts(0 hunks)tsconfig.node.json(1 hunks)
💤 Files with no reviewable changes (22)
- src/renderer/src/routes/about/route.tsx
- src/renderer/src/types/routes.ts
- src/main/controllers/sessions-controller/protocols/_protocols/flow-external.ts
- src/renderer/src/main.tsx
- src/renderer/src/router/README.md
- src/renderer/src/App.tsx
- src/renderer/src/routes/new-tab/route.tsx
- src/renderer/src/routes/omnibox-debug/route.tsx
- src/main/controllers/sessions-controller/protocols/_protocols/flow-internal.ts
- src/renderer/src/routes/games/route.tsx
- src/renderer/src/routes/settings/route.tsx
- src/main/controllers/sessions-controller/protocols/_protocols/flow.ts
- src/renderer/src/routes/main-ui/route.tsx
- src/renderer/src/routes/omnibox/route.tsx
- src/renderer/src/routes/onboarding/route.tsx
- src/renderer/src/routes/error/route.tsx
- src/renderer/src/routes/extensions/route.tsx
- src/renderer/src/router/route.tsx
- src/renderer/index.html
- src/renderer/src/routes/pdf-viewer/route.tsx
- src/renderer/src/routes/popup-ui/route.tsx
- src/renderer/src/router/provider.tsx
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)
**/*.{js,jsx,ts,tsx}: Usebun <file>instead ofnode <file>orts-node <file>
Bun automatically loads .env, so don't use dotenv.
UseBun.serve()for HTTP servers and WebSockets instead ofexpress.
Usebun:sqlitefor SQLite instead ofbetter-sqlite3.
UseBun.redisfor Redis instead ofioredis.
UseBun.sqlfor Postgres instead ofpgorpostgres.js.
Use built-inWebSocketinstead ofws.
PreferBun.fileovernode:fs's readFile/writeFile.
UseBun.$for shell commands instead of execa.
Files:
src/renderer/src/routes/main-ui/config.tsxsrc/renderer/src/routes/omnibox/config.tsxsrc/renderer/src/routes/extensions/page.tsxsrc/renderer/src/routes/extensions/config.tsxsrc/main/controllers/sessions-controller/protocols/_protocols/flow/pdf-cache.tssrc/main/modules/typed-event-emitter.tssrc/main/controllers/sessions-controller/protocols/static-domains/types.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow-internal/active-favicon.tsscripts/frontend-routes-generator/generator.tssrc/main/controllers/sessions-controller/protocols/utils.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow/favicon.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow-internal/index.tssrc/renderer/src/components/providers/nuqs-provider.tsxsrc/main/controllers/sessions-controller/protocols/_protocols/flow/extension-icon.tssrc/main/controllers/sessions-controller/protocols/types.tssrc/main/controllers/sessions-controller/protocols/static-domains/config.tssrc/renderer/src/routes/pdf-viewer/config.tsxsrc/renderer/src/routes/pdf-viewer/page.tsxsrc/renderer/src/routes/popup-ui/config.tsxsrc/renderer/src/routes/new-tab/config.tsxsrc/main/controllers/sessions-controller/protocols/_protocols/flow/assets.tssrc/main/controllers/sessions-controller/protocols/index.tssrc/main/controllers/windows-controller/interfaces/settings.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow/index.tsscripts/frontend-routes-generator/common.tssrc/main/modules/utils.tssrc/renderer/src/routes/onboarding/config.tsxelectron.vite.config.tssrc/renderer/src/routes/omnibox-debug/config.tsxscripts/frontend-routes-generator/pruner.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow-external/index.tssrc/main/controllers/sessions-controller/protocols/static-domains/serve-static.tssrc/renderer/src/components/main/theme.tsxsrc/renderer/src/routes/settings/config.tsxsrc/main/controllers/windows-controller/types/settings.tssrc/main/controllers/windows-controller/types/base.tssrc/renderer/src/routes/about/config.tsxsrc/renderer/src/routes/error/config.tsxsrc/renderer/src/routes/games/config.tsxsrc/main/controllers/sessions-controller/protocols/static-domains/index.tssrc/main/controllers/windows-controller/interfaces/onboarding.ts
**/*.{js,jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)
Import .css files directly in .tsx, .jsx, or .js files and it works with Bun.
Files:
src/renderer/src/routes/main-ui/config.tsxsrc/renderer/src/routes/omnibox/config.tsxsrc/renderer/src/routes/extensions/page.tsxsrc/renderer/src/routes/extensions/config.tsxsrc/renderer/src/components/providers/nuqs-provider.tsxsrc/renderer/src/routes/pdf-viewer/config.tsxsrc/renderer/src/routes/pdf-viewer/page.tsxsrc/renderer/src/routes/popup-ui/config.tsxsrc/renderer/src/routes/new-tab/config.tsxsrc/renderer/src/routes/onboarding/config.tsxsrc/renderer/src/routes/omnibox-debug/config.tsxsrc/renderer/src/components/main/theme.tsxsrc/renderer/src/routes/settings/config.tsxsrc/renderer/src/routes/about/config.tsxsrc/renderer/src/routes/error/config.tsxsrc/renderer/src/routes/games/config.tsx
**/*.{html,ts,css}
📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)
Use
bun build <file.html|file.ts|file.css>instead ofwebpackoresbuild
Files:
src/main/controllers/sessions-controller/protocols/_protocols/flow/pdf-cache.tssrc/main/modules/typed-event-emitter.tssrc/main/controllers/sessions-controller/protocols/static-domains/types.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow-internal/active-favicon.tsscripts/frontend-routes-generator/generator.tssrc/main/controllers/sessions-controller/protocols/utils.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow/favicon.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow-internal/index.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow/extension-icon.tssrc/main/controllers/sessions-controller/protocols/types.tssrc/main/controllers/sessions-controller/protocols/static-domains/config.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow/assets.tssrc/main/controllers/sessions-controller/protocols/index.tssrc/main/controllers/windows-controller/interfaces/settings.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow/index.tsscripts/frontend-routes-generator/common.tssrc/main/modules/utils.tselectron.vite.config.tsscripts/frontend-routes-generator/pruner.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow-external/index.tssrc/main/controllers/sessions-controller/protocols/static-domains/serve-static.tssrc/main/controllers/windows-controller/types/settings.tssrc/main/controllers/windows-controller/types/base.tssrc/main/controllers/sessions-controller/protocols/static-domains/index.tssrc/main/controllers/windows-controller/interfaces/onboarding.ts
package.json
📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)
package.json: Usebun installinstead ofnpm installoryarn installorpnpm install
Usebun run <script>instead ofnpm run <script>oryarn run <script>orpnpm run <script>
Files:
package.json
🧠 Learnings (10)
📚 Learning: 2025-07-24T08:49:07.217Z
Learnt from: CR
PR: MultiboxLabs/flow-browser#0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-07-24T08:49:07.217Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Use `Bun.serve()` for HTTP servers and WebSockets instead of `express`.
Applied to files:
src/main/controllers/sessions-controller/protocols/utils.tssrc/main/controllers/sessions-controller/protocols/static-domains/serve-static.ts
📚 Learning: 2025-07-24T08:49:07.217Z
Learnt from: CR
PR: MultiboxLabs/flow-browser#0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-07-24T08:49:07.217Z
Learning: Applies to **/*.html : Use HTML imports with `Bun.serve()` instead of `vite`.
Applied to files:
src/main/controllers/sessions-controller/protocols/utils.tssrc/renderer/.gitignore
📚 Learning: 2025-07-24T08:49:07.217Z
Learnt from: CR
PR: MultiboxLabs/flow-browser#0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-07-24T08:49:07.217Z
Learning: Applies to **/*.{html,ts,css} : Use `bun build <file.html|file.ts|file.css>` instead of `webpack` or `esbuild`
Applied to files:
src/main/controllers/sessions-controller/protocols/utils.tspackage.jsonsrc/renderer/.gitignore
📚 Learning: 2025-07-24T08:49:07.217Z
Learnt from: CR
PR: MultiboxLabs/flow-browser#0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-07-24T08:49:07.217Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Use `bun <file>` instead of `node <file>` or `ts-node <file>`
Applied to files:
tsconfig.node.jsonpackage.json
📚 Learning: 2025-07-24T08:49:07.217Z
Learnt from: CR
PR: MultiboxLabs/flow-browser#0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-07-24T08:49:07.217Z
Learning: Applies to **/*.{test,spec}.{js,jsx,ts,tsx} : Use `bun test` instead of `jest` or `vitest`
Applied to files:
tsconfig.node.jsonpackage.json
📚 Learning: 2025-07-24T08:49:07.217Z
Learnt from: CR
PR: MultiboxLabs/flow-browser#0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-07-24T08:49:07.217Z
Learning: Applies to package.json : Use `bun run <script>` instead of `npm run <script>` or `yarn run <script>` or `pnpm run <script>`
Applied to files:
package.json
📚 Learning: 2025-07-24T08:49:07.217Z
Learnt from: CR
PR: MultiboxLabs/flow-browser#0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-07-24T08:49:07.217Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Use `Bun.$` for shell commands instead of execa.
Applied to files:
package.json
📚 Learning: 2025-07-24T08:49:07.217Z
Learnt from: CR
PR: MultiboxLabs/flow-browser#0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-07-24T08:49:07.217Z
Learning: Applies to package.json : Use `bun install` instead of `npm install` or `yarn install` or `pnpm install`
Applied to files:
package.json
📚 Learning: 2025-07-24T08:49:07.217Z
Learnt from: CR
PR: MultiboxLabs/flow-browser#0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-07-24T08:49:07.217Z
Learning: Applies to **/*.html : HTML files can import .tsx, .jsx, or .js files directly and Bun's bundler will transpile & bundle automatically.
Applied to files:
src/renderer/.gitignore
📚 Learning: 2025-07-24T08:49:07.217Z
Learnt from: CR
PR: MultiboxLabs/flow-browser#0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-07-24T08:49:07.217Z
Learning: Applies to **/*.{js,jsx,tsx} : Import .css files directly in .tsx, .jsx, or .js files and it works with Bun.
Applied to files:
src/renderer/.gitignore
🧬 Code graph analysis (20)
src/renderer/src/routes/extensions/config.tsx (3)
src/renderer/src/routes/pdf-viewer/config.tsx (1)
RouteConfig(11-19)src/renderer/src/types/routes.ts (1)
RouteConfigType(3-5)src/renderer/src/components/providers/nuqs-provider.tsx (1)
NuqsProvider(3-5)
src/main/controllers/sessions-controller/protocols/_protocols/flow/pdf-cache.ts (2)
src/main/controllers/sessions-controller/protocols/_protocols/flow/index.ts (1)
HonoApp(14-14)src/main/modules/pdf-cache.ts (2)
getPdfResponseFromCache(12-14)removePdfResponseFromCache(16-18)
src/main/controllers/sessions-controller/protocols/static-domains/types.ts (1)
src/main/controllers/sessions-controller/protocols/types.ts (1)
CustomProtocol(1-1)
src/main/controllers/sessions-controller/protocols/_protocols/flow-internal/active-favicon.ts (2)
src/main/controllers/tabs-controller/index.ts (1)
tabsController(758-758)src/main/controllers/sessions-controller/protocols/_protocols/flow-internal/index.ts (1)
HonoApp(11-11)
scripts/frontend-routes-generator/generator.ts (1)
scripts/frontend-routes-generator/common.ts (3)
getDirectories(9-12)ROUTES_PATH(6-6)FRONTEND_PATH(5-5)
src/main/controllers/sessions-controller/protocols/utils.ts (1)
src/main/modules/paths.ts (1)
PATHS(18-23)
src/main/controllers/sessions-controller/protocols/_protocols/flow/favicon.ts (2)
src/main/controllers/sessions-controller/protocols/_protocols/flow/index.ts (1)
HonoApp(14-14)src/main/modules/utils.ts (1)
bufferToArrayBuffer(115-117)
src/main/controllers/sessions-controller/protocols/_protocols/flow-internal/index.ts (3)
src/main/controllers/sessions-controller/protocols/utils.ts (1)
transformPathForRequest(86-96)src/main/controllers/sessions-controller/protocols/_protocols/flow-internal/active-favicon.ts (1)
registerActiveFaviconRoutes(16-57)src/main/controllers/sessions-controller/protocols/static-domains/index.ts (1)
registerStaticDomainsRoutes(13-51)
src/main/controllers/sessions-controller/protocols/_protocols/flow/extension-icon.ts (4)
src/main/controllers/sessions-controller/protocols/_protocols/flow/index.ts (1)
HonoApp(14-14)src/main/controllers/loaded-profiles-controller/index.ts (1)
loadedProfilesController(325-325)src/main/modules/extensions/management.ts (1)
getExtensionIcon(99-151)src/main/modules/utils.ts (1)
bufferToArrayBuffer(115-117)
src/main/controllers/sessions-controller/protocols/static-domains/config.ts (1)
src/main/controllers/sessions-controller/protocols/static-domains/types.ts (1)
StaticDomainInfo(14-18)
src/renderer/src/routes/pdf-viewer/config.tsx (1)
src/renderer/src/components/providers/nuqs-provider.tsx (1)
NuqsProvider(3-5)
src/main/controllers/sessions-controller/protocols/_protocols/flow/assets.ts (3)
src/main/controllers/sessions-controller/protocols/_protocols/flow/index.ts (1)
HonoApp(14-14)src/main/modules/paths.ts (1)
PATHS(18-23)src/main/modules/utils.ts (2)
getContentType(23-25)bufferToArrayBuffer(115-117)
src/main/controllers/sessions-controller/protocols/index.ts (1)
src/main/controllers/sessions-controller/protocols/types.ts (1)
CustomProtocol(1-1)
src/main/controllers/sessions-controller/protocols/_protocols/flow/index.ts (6)
src/main/controllers/sessions-controller/protocols/utils.ts (1)
transformPathForRequest(86-96)src/main/controllers/sessions-controller/protocols/_protocols/flow/favicon.ts (1)
registerFaviconRoutes(5-20)src/main/controllers/sessions-controller/protocols/_protocols/flow/assets.ts (1)
registerAssetsRoutes(7-43)src/main/controllers/sessions-controller/protocols/_protocols/flow/extension-icon.ts (1)
registerExtensionIconRoutes(6-39)src/main/controllers/sessions-controller/protocols/_protocols/flow/pdf-cache.ts (1)
registerPdfCacheRoutes(4-21)src/main/controllers/sessions-controller/protocols/static-domains/index.ts (1)
registerStaticDomainsRoutes(13-51)
electron.vite.config.ts (1)
scripts/frontend-routes-generator/generator.ts (1)
generateRoutes(8-73)
scripts/frontend-routes-generator/pruner.ts (1)
scripts/frontend-routes-generator/common.ts (3)
getDirectories(9-12)ROUTES_PATH(6-6)FRONTEND_PATH(5-5)
src/main/controllers/sessions-controller/protocols/_protocols/flow-external/index.ts (2)
src/main/controllers/sessions-controller/protocols/utils.ts (1)
transformPathForRequest(86-96)src/main/controllers/sessions-controller/protocols/static-domains/index.ts (1)
registerStaticDomainsRoutes(13-51)
src/main/controllers/sessions-controller/protocols/static-domains/serve-static.ts (4)
src/main/modules/paths.ts (1)
PATHS(18-23)src/main/modules/flags.ts (1)
FLAGS(16-40)src/main/controllers/sessions-controller/protocols/static-domains/hot-reload.ts (3)
setupHotReloadFileDescriptors(9-15)isDevelopmentServerRunning(21-27)fetchFromDevServer(45-81)src/main/modules/utils.ts (2)
getContentType(23-25)bufferToArrayBuffer(115-117)
src/main/controllers/windows-controller/types/base.ts (1)
src/main/modules/typed-event-emitter.ts (1)
TypedEventEmitter(11-114)
src/main/controllers/sessions-controller/protocols/static-domains/index.ts (3)
src/main/controllers/sessions-controller/protocols/types.ts (1)
CustomProtocol(1-1)src/main/controllers/sessions-controller/protocols/static-domains/config.ts (1)
STATIC_DOMAINS(3-132)src/main/controllers/sessions-controller/protocols/static-domains/serve-static.ts (1)
serveStaticDomainFile(35-132)
🔇 Additional comments (47)
src/renderer/src/routes/extensions/page.tsx (3)
7-7: LGTM! Clean migration to new dependencies.The imports for
toastfrom sonner anduseQueryStatefrom nuqs align with the PR's migration from URL-based routing to query-state management.Also applies to: 12-12
24-50: LGTM! Clean async handlers with user feedback.Both
setExtensionEnabledandsetExtensionPinnedfollow a consistent pattern: they call the corresponding API, provide clear toast feedback to users, and return the success status. The implementation is straightforward and maintainable, though it assumes theflow.extensionsAPIs returnfalseon failure rather than throwing exceptions.Note: This assumes the processing state race condition (flagged separately) will be addressed.
52-58: LGTM! Query-state navigation is correctly implemented.The navigation handlers properly use
setSelectedExtensionIdto manage the query parameter, and theselectedExtensionlookup at line 60 safely handles the case where the ID might not match any extension by falling back to the list view.Minor edge case: If a user navigates directly to a URL with an invalid extension ID (e.g.,
?id=nonexistent), they'll see the extensions list without any feedback about the invalid ID. This is acceptable self-recovering behavior, though you could optionally add a toast notification if desired.Also applies to: 60-60
src/renderer/src/routes/pdf-viewer/page.tsx (3)
1-1: LGTM! Migration to nuqs.The import statement correctly migrates from the previous query parameter library to nuqs, aligning with the PR objectives.
7-8: LGTM! Correct nuqs hook usage.The
useQueryStatehooks are used correctly with appropriate destructuring to extract only the query parameter values.
9-11: No changes needed—the current null return is the correct behavior.The component correctly returns
nullwhen theurlquery parameter is missing. The codebase has no centralized error page mechanism for this scenario, and the null pattern is consistent with how the application handles other routing edge cases (e.g., theRoutecomponent also returns null for unmatched conditions). The PR description's reference to "unresolved domains" likely pertains to PDF fetch failures withinPDFViewerApp, not missing query parameters.Likely an incorrect or invalid review comment.
src/renderer/.gitignore (1)
1-2: LGTM!Properly excludes generated files from version control. The patterns correctly ignore:
route-*.html: Generated HTML route filessrc/routes/*/main.tsx: Generated entry point filesThis aligns with the frontend routes generation workflow mentioned in the PR objectives.
src/renderer/src/routes/omnibox-debug/config.tsx (1)
5-9: Verification Confirmed: RouteConfigType Update and Fallback Removal CompleteThe review comment's concerns have been fully verified:
RouteConfigType interface updated: The type definition in
src/renderer/src/types/routes.tsnow contains only theProvidersproperty. TheFallbackproperty has been completely removed from the interface.All route configurations updated: All 12 route config files in
src/renderer/src/routes/have been consistently updated to include only theProvidersproperty. No config file retains theFallbackproperty.No breaking references: A complete codebase search found zero instances of
RouteConfig.Fallbackaccess, confirming that no code attempts to use the removed property.The refactoring is complete, consistent, and introduces no breaking changes.
src/renderer/src/routes/omnibox/config.tsx (1)
5-9: LGTM! Configuration simplified.The removal of the
Fallbackproperty aligns with the broader pattern across route configs in this PR. TheProvidersimplementation remains intact and correct.src/renderer/src/routes/main-ui/config.tsx (1)
5-9: LGTM! Consistent configuration pattern.The removal of the
Fallbackproperty is consistent with the route config refactoring across the codebase.src/main/modules/utils.ts (1)
110-117: LGTM! Clean utility function.The
bufferToArrayBufferimplementation is correct and follows the standard pattern for converting Node.jsBuffertoArrayBuffer. The JSDoc is clear and the function is properly utilized across multiple Flow protocol handlers.src/renderer/src/components/main/theme.tsx (2)
22-31: Good refactor for clarity.Extracting theme class manipulation into a dedicated helper function improves readability and maintainability.
71-81: Excellent change to prevent theme flicker.Switching from
useEffecttouseLayoutEffectensures the theme class is applied synchronously before the browser paints, eliminating visual flicker during theme changes or initialization. This is the correct approach for DOM mutations that affect visual appearance.src/main/controllers/sessions-controller/protocols/_protocols/flow/extension-icon.ts (1)
6-38: LGTM! Well-structured route handler.The extension icon handler properly validates query parameters, checks for loaded profile and extension data, and returns appropriate status codes. The use of
bufferToArrayBufferfor converting the PNG buffer is consistent with other Flow protocol handlers.src/main/controllers/sessions-controller/protocols/_protocols/flow/pdf-cache.ts (1)
4-20: LGTM! Clean cache-and-serve implementation.The PDF cache handler correctly implements a one-time cache pattern: it checks the cache, redirects to the actual URL on miss (graceful fallback), and removes the cached response after serving it on hit. This prevents stale cache accumulation and is appropriate for single-use cached responses.
docs/contributing/dependencies.md (1)
100-101: Documentation updated correctly.The dependency documentation accurately reflects the replacement of
use-query-paramswithnuqsfor query parameter management and the addition ofhonofor custom protocol routing.src/main/controllers/sessions-controller/protocols/_protocols/flow/favicon.ts (1)
5-20: LGTM! Clean favicon handler.The favicon route properly validates the URL parameter, normalizes the URL (good practice for consistent lookup), and returns appropriate status codes. The implementation is consistent with the other Flow protocol handlers and correctly converts the buffer to ArrayBuffer for the response.
src/renderer/src/routes/onboarding/config.tsx (1)
5-9: LGTM!The removal of the
Fallbackproperty simplifies the route configuration and aligns with the broader refactoring ofRouteConfigTypeacross the codebase.src/renderer/src/routes/error/config.tsx (1)
5-9: LGTM!Consistent with the route configuration simplification across the codebase.
src/main/controllers/sessions-controller/protocols/types.ts (1)
1-1: LGTM!Clean type definition that provides type safety for the custom protocol system.
src/renderer/src/routes/extensions/config.tsx (1)
2-13: LGTM!The addition of
NuqsProviderfollows the established pattern seen in other route configurations (e.g., pdf-viewer) and properly nests providers for the query parameter management.src/main/controllers/sessions-controller/protocols/static-domains/config.ts (3)
3-44: LGTM!The flow-internal protocol mappings are well-structured and follow a consistent pattern for internal UI routes.
104-132: LGTM!Excellent practice including source attribution comments for the external game resources. The subdirectory-based mapping is appropriate for these static assets.
79-86: No changes required; the duplicate hostname is intentional and correct.The "omnibox" hostname appears under two different protocols:
flow-internal(line 31) maps to route "omnibox", andflow(line 81) maps to route "omnibox-debug". This is valid routing design—same hostname under different protocols creates distinct routing entries with no conflict. The code is correct as-is.src/main/controllers/sessions-controller/protocols/static-domains/index.ts (4)
13-17: LGTM!Efficient filtering and early return pattern when no domains match the protocol.
19-38: LGTM!The handler properly implements case-insensitive domain matching and correctly delegates to
serveStaticDomainFilewith appropriate options for both route and subdirectory types.
40-46: Good error handling with Chrome-compatible error codes.The redirect to the error page with context preservation is well-implemented. The error code -300 (ERR_INVALID_URL) appropriately matches the Chrome network error convention.
49-50: LGTM!The route registration correctly handles both root domain requests and paths with the wildcard pattern
{.+}.src/renderer/src/components/providers/nuqs-provider.tsx (1)
3-5: LGTM!Clean abstraction layer that provides a project-specific provider name while delegating to the nuqs library's adapter.
src/renderer/src/routes/pdf-viewer/config.tsx (1)
12-18: Nuqs provider placement looks solid.Keeping
NuqsProviderinside the theme wrapper gives the page access to query-state utilities without losing theme context, matching how the other upgraded routes are structured.src/main/controllers/sessions-controller/protocols/_protocols/flow/index.ts (1)
11-29: Consolidated flow protocol handler reads clean.Registering every route on a single Hono app with
transformPathForRequestkeeps the hostname routing logic consistent and lets the static-domain catch-all sit safely after the specific endpoints—nicely done.scripts/frontend-routes-generator/common.ts (1)
5-12: Directory helper is tidy.Centralizing the renderer paths and using
withFileTypesfor directory detection keeps the generator/pruner logic DRY and efficient.electron.vite.config.ts (1)
53-68: Route generation pipeline fits neatly into Vite config.Pulling the generated inputs straight into
rollupOptions.inputwhile reusing the shared build settings keeps the multipage renderer build cohesive.src/main/controllers/sessions-controller/protocols/index.ts (1)
23-34: Type alignment is spot on.Switching to the shared
CustomProtocol[]keeps the registration callsites in sync with the new protocol definitions and avoids drift.src/main/controllers/sessions-controller/protocols/_protocols/flow/assets.ts (1)
20-29: LGTM: Solid path traversal protection.The combination of path normalization (line 21) and directory boundary enforcement (lines 26-29) effectively prevents directory traversal attacks.
src/main/controllers/sessions-controller/protocols/_protocols/flow-internal/index.ts (1)
7-24: LGTM: Clean protocol handler implementation.The Hono app configuration with custom path transformation and the protocol delegation pattern via
app.fetchis well-structured and follows a consistent approach across protocol handlers.src/main/controllers/sessions-controller/protocols/_protocols/flow-external/index.ts (1)
6-23: LGTM: Consistent with flow-internal implementation.The structure mirrors the flow-internal protocol handler, maintaining consistency across the codebase.
src/main/controllers/sessions-controller/protocols/utils.ts (2)
18-44: LGTM: Clean extension of serveStaticFile with options.The addition of
ServeStaticFileOptionsand the recursive call pattern to handleoverrideRouteNameis well-designed and maintains backward compatibility with the default empty options object.
86-96: LGTM: Path transformation logic is correct.The
transformPathForRequestfunction correctly combines hostname and path to create a routable path for the Hono app.src/main/controllers/sessions-controller/protocols/_protocols/flow-internal/active-favicon.ts (1)
16-57: LGTM: Robust favicon caching with proper validation.The handler validates all required inputs (tabId parsing, tab existence, favicon and profile availability) and correctly uses
Response.clone()to prevent cache corruption. The cache invalidation logic in the cleanup interval appropriately checks both tab destruction and favicon URL changes.src/main/controllers/sessions-controller/protocols/static-domains/serve-static.ts (3)
38-55: LGTM: Strong security and UX measures.The path traversal prevention (line 39) and trailing slash redirect (lines 52-54) demonstrate good security practices and user experience considerations.
70-74: LGTM: Important security boundary.Preventing direct access to route entrypoints (lines 70-73) ensures routes can only be served through their intended domain mappings, maintaining proper isolation between different protocol domains.
83-101: LGTM: Well-integrated hot reload support.The development server integration properly handles path transformation with
extraBaseDirand falls back gracefully when the dev server isn't available.scripts/frontend-routes-generator/generator.ts (1)
8-31: Document the auto-generated workflow or add a safety check in the generator.The route HTML files are handled by a separate
pruner.tsthat removes old files before generation runs. However, the generator itself has no safeguards—it directly overwrites files withfs.writeFile(). While the typical workflow (pruner runs first) prevents conflicts, the generator can silently overwrite files if:
- It runs independently without the pruner
- Files are manually edited between runs
Either add a warning check in the generator before writing, or document that these files are auto-generated and should not be manually edited.
src/main/controllers/sessions-controller/protocols/static-domains/types.ts (3)
1-1: LGTM! Proper type-only import.The
import typesyntax is best practice for type-only imports, eliminating runtime overhead.
3-12: LGTM! Well-structured discriminated union.The discriminated union pattern with the
typeliteral field is properly implemented, enabling type-safe exhaustive checking and narrowing in consuming code.
14-18: LGTM! Clean type composition.The exported type properly composes the imported
CustomProtocoland internalActualDomainInfotypes. The structure is clear and follows good TypeScript practices.
src/main/controllers/sessions-controller/protocols/_protocols/flow-internal/active-favicon.ts
Show resolved
Hide resolved
src/main/controllers/sessions-controller/protocols/static-domains/serve-static.ts
Show resolved
Hide resolved
There was a problem hiding this comment.
Actionable comments posted: 10
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (3)
src/main/controllers/windows-controller/interfaces/onboarding.ts (1)
20-26: Consider makingtoggle()async to awaitshow().The
toggle()method callsonboarding.show()without awaiting (line 24). Sinceshow()is now async, this fire-and-forget call could lead to race conditions iftoggle()is called multiple times before the window finishes showing. The window might not be visible yet whenisVisible()is checked in subsequent calls.Consider making
toggle()async:- toggle: () => { + toggle: async () => { if (onboarding.isVisible()) { onboarding.hide(); } else { - onboarding.show(); + await onboarding.show(); } },src/main/controllers/windows-controller/interfaces/settings.ts (1)
20-26: Consider makingtoggle()async to awaitshow().The
toggle()method callssettings.show()without awaiting (line 24). Sinceshow()is now async, this fire-and-forget call could lead to race conditions iftoggle()is called multiple times before the window finishes showing. The window might not be visible yet whenisVisible()is checked in subsequent calls.Consider making
toggle()async:- toggle: () => { + toggle: async () => { if (settings.isVisible()) { settings.hide(); } else { - settings.show(); + await settings.show(); } },src/renderer/src/routes/extensions/page.tsx (1)
24-50: ResetisProcessingeven whenflowcalls reject.If
flow.extensions.setExtensionEnabledor.setExtensionPinnedthrows, thesetIsProcessing(false)lines never run, leaving the UI locked in a permanently disabled state and causing unhandled rejections. Wrap these calls intry/catch/finallysoisProcessingalways resets and unexpected errors surface via a toast. Example fix forsetExtensionEnabled:const setExtensionEnabled = async (id: string, enabled: boolean) => { setIsProcessing(true); - const success = await flow.extensions.setExtensionEnabled(id, enabled); - if (success) { - toast.success(`This extension has been successfully ${enabled ? "enabled" : "disabled"}!`); - } else { - toast.error(`Failed to ${enabled ? "enable" : "disable"} this extension!`); - } - - setIsProcessing(false); - return success; + try { + const success = await flow.extensions.setExtensionEnabled(id, enabled); + if (success) { + toast.success(`This extension has been successfully ${enabled ? "enabled" : "disabled"}!`); + } else { + toast.error(`Failed to ${enabled ? "enable" : "disable"} this extension!`); + } + return success; + } catch (error) { + toast.error(`Unexpected error while trying to ${enabled ? "enable" : "disable"} this extension.`); + return false; + } finally { + setIsProcessing(false); + } };Please apply the same pattern to
setExtensionPinned.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: ASSERTIVE
Plan: Pro
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (67)
docs/contributing/dependencies.md(1 hunks)electron.vite.config.ts(2 hunks)package.json(2 hunks)scripts/frontend-routes-generator/common.ts(1 hunks)scripts/frontend-routes-generator/generator.ts(1 hunks)scripts/frontend-routes-generator/pruner.ts(1 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow-external.ts(0 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow-external/index.ts(1 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow-internal.ts(0 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow-internal/active-favicon.ts(1 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow-internal/index.ts(1 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow.ts(0 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow/assets.ts(1 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow/extension-icon.ts(1 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow/favicon.ts(1 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow/index.ts(1 hunks)src/main/controllers/sessions-controller/protocols/_protocols/flow/pdf-cache.ts(1 hunks)src/main/controllers/sessions-controller/protocols/index.ts(2 hunks)src/main/controllers/sessions-controller/protocols/static-domains/config.ts(1 hunks)src/main/controllers/sessions-controller/protocols/static-domains/index.ts(1 hunks)src/main/controllers/sessions-controller/protocols/static-domains/serve-static.ts(1 hunks)src/main/controllers/sessions-controller/protocols/static-domains/types.ts(1 hunks)src/main/controllers/sessions-controller/protocols/types.ts(1 hunks)src/main/controllers/sessions-controller/protocols/utils.ts(3 hunks)src/main/controllers/windows-controller/interfaces/onboarding.ts(1 hunks)src/main/controllers/windows-controller/interfaces/settings.ts(1 hunks)src/main/controllers/windows-controller/types/base.ts(3 hunks)src/main/controllers/windows-controller/types/settings.ts(1 hunks)src/main/modules/typed-event-emitter.ts(1 hunks)src/main/modules/utils.ts(1 hunks)src/renderer/.gitignore(1 hunks)src/renderer/index.html(0 hunks)src/renderer/src/App.tsx(0 hunks)src/renderer/src/components/main/theme.tsx(3 hunks)src/renderer/src/components/providers/nuqs-provider.tsx(1 hunks)src/renderer/src/main.tsx(0 hunks)src/renderer/src/router/README.md(0 hunks)src/renderer/src/router/provider.tsx(0 hunks)src/renderer/src/router/route.tsx(0 hunks)src/renderer/src/routes/about/config.tsx(1 hunks)src/renderer/src/routes/about/route.tsx(0 hunks)src/renderer/src/routes/error/config.tsx(1 hunks)src/renderer/src/routes/error/route.tsx(0 hunks)src/renderer/src/routes/extensions/config.tsx(1 hunks)src/renderer/src/routes/extensions/page.tsx(2 hunks)src/renderer/src/routes/extensions/route.tsx(0 hunks)src/renderer/src/routes/games/config.tsx(1 hunks)src/renderer/src/routes/games/route.tsx(0 hunks)src/renderer/src/routes/main-ui/config.tsx(1 hunks)src/renderer/src/routes/main-ui/route.tsx(0 hunks)src/renderer/src/routes/new-tab/config.tsx(1 hunks)src/renderer/src/routes/new-tab/route.tsx(0 hunks)src/renderer/src/routes/omnibox-debug/config.tsx(1 hunks)src/renderer/src/routes/omnibox-debug/route.tsx(0 hunks)src/renderer/src/routes/omnibox/config.tsx(1 hunks)src/renderer/src/routes/omnibox/route.tsx(0 hunks)src/renderer/src/routes/onboarding/config.tsx(1 hunks)src/renderer/src/routes/onboarding/route.tsx(0 hunks)src/renderer/src/routes/pdf-viewer/config.tsx(2 hunks)src/renderer/src/routes/pdf-viewer/page.tsx(1 hunks)src/renderer/src/routes/pdf-viewer/route.tsx(0 hunks)src/renderer/src/routes/popup-ui/config.tsx(1 hunks)src/renderer/src/routes/popup-ui/route.tsx(0 hunks)src/renderer/src/routes/settings/config.tsx(1 hunks)src/renderer/src/routes/settings/route.tsx(0 hunks)src/renderer/src/types/routes.ts(0 hunks)tsconfig.node.json(1 hunks)
💤 Files with no reviewable changes (22)
- src/renderer/src/router/README.md
- src/renderer/src/routes/onboarding/route.tsx
- src/renderer/src/routes/omnibox/route.tsx
- src/renderer/src/routes/popup-ui/route.tsx
- src/renderer/src/routes/pdf-viewer/route.tsx
- src/renderer/src/routes/settings/route.tsx
- src/renderer/src/routes/about/route.tsx
- src/renderer/src/router/provider.tsx
- src/main/controllers/sessions-controller/protocols/_protocols/flow-internal.ts
- src/renderer/src/App.tsx
- src/renderer/src/types/routes.ts
- src/renderer/src/main.tsx
- src/renderer/src/router/route.tsx
- src/renderer/src/routes/new-tab/route.tsx
- src/main/controllers/sessions-controller/protocols/_protocols/flow.ts
- src/renderer/src/routes/games/route.tsx
- src/renderer/index.html
- src/renderer/src/routes/extensions/route.tsx
- src/renderer/src/routes/error/route.tsx
- src/renderer/src/routes/omnibox-debug/route.tsx
- src/renderer/src/routes/main-ui/route.tsx
- src/main/controllers/sessions-controller/protocols/_protocols/flow-external.ts
🧰 Additional context used
📓 Path-based instructions (4)
**/*.{js,jsx,ts,tsx}
📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)
**/*.{js,jsx,ts,tsx}: Usebun <file>instead ofnode <file>orts-node <file>
Bun automatically loads .env, so don't use dotenv.
UseBun.serve()for HTTP servers and WebSockets instead ofexpress.
Usebun:sqlitefor SQLite instead ofbetter-sqlite3.
UseBun.redisfor Redis instead ofioredis.
UseBun.sqlfor Postgres instead ofpgorpostgres.js.
Use built-inWebSocketinstead ofws.
PreferBun.fileovernode:fs's readFile/writeFile.
UseBun.$for shell commands instead of execa.
Files:
src/main/modules/utils.tssrc/renderer/src/routes/settings/config.tsxsrc/main/controllers/sessions-controller/protocols/types.tsscripts/frontend-routes-generator/generator.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow/assets.tssrc/renderer/src/components/providers/nuqs-provider.tsxsrc/main/controllers/sessions-controller/protocols/_protocols/flow-internal/active-favicon.tssrc/renderer/src/routes/error/config.tsxsrc/renderer/src/routes/onboarding/config.tsxsrc/main/controllers/sessions-controller/protocols/_protocols/flow-external/index.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow/pdf-cache.tssrc/renderer/src/routes/pdf-viewer/config.tsxsrc/renderer/src/routes/main-ui/config.tsxsrc/main/controllers/sessions-controller/protocols/index.tssrc/renderer/src/routes/new-tab/config.tsxsrc/main/controllers/sessions-controller/protocols/_protocols/flow/extension-icon.tssrc/renderer/src/routes/pdf-viewer/page.tsxsrc/main/controllers/sessions-controller/protocols/static-domains/index.tssrc/renderer/src/routes/omnibox/config.tsxsrc/renderer/src/routes/about/config.tsxsrc/main/controllers/sessions-controller/protocols/static-domains/types.tssrc/renderer/src/routes/popup-ui/config.tsxsrc/renderer/src/routes/extensions/page.tsxsrc/renderer/src/routes/extensions/config.tsxsrc/main/controllers/sessions-controller/protocols/_protocols/flow/favicon.tssrc/main/modules/typed-event-emitter.tssrc/renderer/src/routes/games/config.tsxsrc/main/controllers/windows-controller/interfaces/onboarding.tssrc/main/controllers/windows-controller/types/settings.tssrc/renderer/src/routes/omnibox-debug/config.tsxscripts/frontend-routes-generator/common.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow-internal/index.tssrc/renderer/src/components/main/theme.tsxsrc/main/controllers/sessions-controller/protocols/static-domains/config.tsscripts/frontend-routes-generator/pruner.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow/index.tssrc/main/controllers/windows-controller/interfaces/settings.tssrc/main/controllers/sessions-controller/protocols/utils.tselectron.vite.config.tssrc/main/controllers/sessions-controller/protocols/static-domains/serve-static.tssrc/main/controllers/windows-controller/types/base.ts
**/*.{html,ts,css}
📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)
Use
bun build <file.html|file.ts|file.css>instead ofwebpackoresbuild
Files:
src/main/modules/utils.tssrc/main/controllers/sessions-controller/protocols/types.tsscripts/frontend-routes-generator/generator.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow/assets.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow-internal/active-favicon.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow-external/index.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow/pdf-cache.tssrc/main/controllers/sessions-controller/protocols/index.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow/extension-icon.tssrc/main/controllers/sessions-controller/protocols/static-domains/index.tssrc/main/controllers/sessions-controller/protocols/static-domains/types.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow/favicon.tssrc/main/modules/typed-event-emitter.tssrc/main/controllers/windows-controller/interfaces/onboarding.tssrc/main/controllers/windows-controller/types/settings.tsscripts/frontend-routes-generator/common.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow-internal/index.tssrc/main/controllers/sessions-controller/protocols/static-domains/config.tsscripts/frontend-routes-generator/pruner.tssrc/main/controllers/sessions-controller/protocols/_protocols/flow/index.tssrc/main/controllers/windows-controller/interfaces/settings.tssrc/main/controllers/sessions-controller/protocols/utils.tselectron.vite.config.tssrc/main/controllers/sessions-controller/protocols/static-domains/serve-static.tssrc/main/controllers/windows-controller/types/base.ts
**/*.{js,jsx,tsx}
📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)
Import .css files directly in .tsx, .jsx, or .js files and it works with Bun.
Files:
src/renderer/src/routes/settings/config.tsxsrc/renderer/src/components/providers/nuqs-provider.tsxsrc/renderer/src/routes/error/config.tsxsrc/renderer/src/routes/onboarding/config.tsxsrc/renderer/src/routes/pdf-viewer/config.tsxsrc/renderer/src/routes/main-ui/config.tsxsrc/renderer/src/routes/new-tab/config.tsxsrc/renderer/src/routes/pdf-viewer/page.tsxsrc/renderer/src/routes/omnibox/config.tsxsrc/renderer/src/routes/about/config.tsxsrc/renderer/src/routes/popup-ui/config.tsxsrc/renderer/src/routes/extensions/page.tsxsrc/renderer/src/routes/extensions/config.tsxsrc/renderer/src/routes/games/config.tsxsrc/renderer/src/routes/omnibox-debug/config.tsxsrc/renderer/src/components/main/theme.tsx
package.json
📄 CodeRabbit inference engine (.cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc)
package.json: Usebun installinstead ofnpm installoryarn installorpnpm install
Usebun run <script>instead ofnpm run <script>oryarn run <script>orpnpm run <script>
Files:
package.json
🧠 Learnings (10)
📚 Learning: 2025-07-24T08:49:07.217Z
Learnt from: CR
PR: MultiboxLabs/flow-browser#0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-07-24T08:49:07.217Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Use `bun <file>` instead of `node <file>` or `ts-node <file>`
Applied to files:
tsconfig.node.jsonpackage.json
📚 Learning: 2025-07-24T08:49:07.217Z
Learnt from: CR
PR: MultiboxLabs/flow-browser#0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-07-24T08:49:07.217Z
Learning: Applies to **/*.{test,spec}.{js,jsx,ts,tsx} : Use `bun test` instead of `jest` or `vitest`
Applied to files:
tsconfig.node.jsonpackage.json
📚 Learning: 2025-07-24T08:49:07.217Z
Learnt from: CR
PR: MultiboxLabs/flow-browser#0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-07-24T08:49:07.217Z
Learning: Applies to **/*.{html,ts,css} : Use `bun build <file.html|file.ts|file.css>` instead of `webpack` or `esbuild`
Applied to files:
src/renderer/.gitignorepackage.json
📚 Learning: 2025-07-24T08:49:07.217Z
Learnt from: CR
PR: MultiboxLabs/flow-browser#0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-07-24T08:49:07.217Z
Learning: Applies to **/*.html : HTML files can import .tsx, .jsx, or .js files directly and Bun's bundler will transpile & bundle automatically.
Applied to files:
src/renderer/.gitignore
📚 Learning: 2025-07-24T08:49:07.217Z
Learnt from: CR
PR: MultiboxLabs/flow-browser#0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-07-24T08:49:07.217Z
Learning: Applies to **/*.html : Use HTML imports with `Bun.serve()` instead of `vite`.
Applied to files:
src/renderer/.gitignore
📚 Learning: 2025-07-24T08:49:07.217Z
Learnt from: CR
PR: MultiboxLabs/flow-browser#0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-07-24T08:49:07.217Z
Learning: Applies to **/*.{js,jsx,tsx} : Import .css files directly in .tsx, .jsx, or .js files and it works with Bun.
Applied to files:
src/renderer/.gitignore
📚 Learning: 2025-07-24T08:49:07.217Z
Learnt from: CR
PR: MultiboxLabs/flow-browser#0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-07-24T08:49:07.217Z
Learning: Applies to package.json : Use `bun run <script>` instead of `npm run <script>` or `yarn run <script>` or `pnpm run <script>`
Applied to files:
package.json
📚 Learning: 2025-07-24T08:49:07.217Z
Learnt from: CR
PR: MultiboxLabs/flow-browser#0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-07-24T08:49:07.217Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Use `Bun.$` for shell commands instead of execa.
Applied to files:
package.json
📚 Learning: 2025-07-24T08:49:07.217Z
Learnt from: CR
PR: MultiboxLabs/flow-browser#0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-07-24T08:49:07.217Z
Learning: Applies to package.json : Use `bun install` instead of `npm install` or `yarn install` or `pnpm install`
Applied to files:
package.json
📚 Learning: 2025-07-24T08:49:07.217Z
Learnt from: CR
PR: MultiboxLabs/flow-browser#0
File: .cursor/rules/use-bun-instead-of-node-vite-npm-pnpm.mdc:0-0
Timestamp: 2025-07-24T08:49:07.217Z
Learning: Applies to **/*.{js,jsx,ts,tsx} : Use `Bun.serve()` for HTTP servers and WebSockets instead of `express`.
Applied to files:
src/main/controllers/sessions-controller/protocols/utils.tssrc/main/controllers/sessions-controller/protocols/static-domains/serve-static.ts
🧬 Code graph analysis (20)
scripts/frontend-routes-generator/generator.ts (1)
scripts/frontend-routes-generator/common.ts (3)
getDirectories(9-12)ROUTES_PATH(6-6)FRONTEND_PATH(5-5)
src/main/controllers/sessions-controller/protocols/_protocols/flow/assets.ts (3)
src/main/controllers/sessions-controller/protocols/_protocols/flow/index.ts (1)
HonoApp(14-14)src/main/modules/paths.ts (1)
PATHS(18-23)src/main/modules/utils.ts (2)
getContentType(23-25)bufferToArrayBuffer(115-117)
src/main/controllers/sessions-controller/protocols/_protocols/flow-internal/active-favicon.ts (2)
src/main/controllers/tabs-controller/index.ts (1)
tabsController(758-758)src/main/controllers/sessions-controller/protocols/_protocols/flow-internal/index.ts (1)
HonoApp(11-11)
src/main/controllers/sessions-controller/protocols/_protocols/flow-external/index.ts (2)
src/main/controllers/sessions-controller/protocols/utils.ts (1)
transformPathForRequest(86-96)src/main/controllers/sessions-controller/protocols/static-domains/index.ts (1)
registerStaticDomainsRoutes(13-51)
src/main/controllers/sessions-controller/protocols/_protocols/flow/pdf-cache.ts (2)
src/main/controllers/sessions-controller/protocols/_protocols/flow/index.ts (1)
HonoApp(14-14)src/main/modules/pdf-cache.ts (2)
getPdfResponseFromCache(12-14)removePdfResponseFromCache(16-18)
src/renderer/src/routes/pdf-viewer/config.tsx (2)
src/renderer/src/components/main/theme.tsx (1)
ThemeProvider(33-106)src/renderer/src/components/providers/nuqs-provider.tsx (1)
NuqsProvider(3-5)
src/main/controllers/sessions-controller/protocols/index.ts (1)
src/main/controllers/sessions-controller/protocols/types.ts (1)
CustomProtocol(1-1)
src/main/controllers/sessions-controller/protocols/_protocols/flow/extension-icon.ts (4)
src/main/controllers/sessions-controller/protocols/_protocols/flow/index.ts (1)
HonoApp(14-14)src/main/controllers/loaded-profiles-controller/index.ts (1)
loadedProfilesController(325-325)src/main/modules/extensions/management.ts (1)
getExtensionIcon(99-151)src/main/modules/utils.ts (1)
bufferToArrayBuffer(115-117)
src/main/controllers/sessions-controller/protocols/static-domains/index.ts (3)
src/main/controllers/sessions-controller/protocols/types.ts (1)
CustomProtocol(1-1)src/main/controllers/sessions-controller/protocols/static-domains/config.ts (1)
STATIC_DOMAINS(3-132)src/main/controllers/sessions-controller/protocols/static-domains/serve-static.ts (1)
serveStaticDomainFile(35-132)
src/main/controllers/sessions-controller/protocols/static-domains/types.ts (1)
src/main/controllers/sessions-controller/protocols/types.ts (1)
CustomProtocol(1-1)
src/renderer/src/routes/extensions/config.tsx (3)
src/renderer/src/types/routes.ts (1)
RouteConfigType(3-5)src/renderer/src/components/main/theme.tsx (1)
ThemeProvider(33-106)src/renderer/src/components/providers/nuqs-provider.tsx (1)
NuqsProvider(3-5)
src/main/controllers/sessions-controller/protocols/_protocols/flow/favicon.ts (2)
src/main/controllers/sessions-controller/protocols/_protocols/flow/index.ts (1)
HonoApp(14-14)src/main/modules/utils.ts (1)
bufferToArrayBuffer(115-117)
src/main/controllers/sessions-controller/protocols/_protocols/flow-internal/index.ts (3)
src/main/controllers/sessions-controller/protocols/utils.ts (1)
transformPathForRequest(86-96)src/main/controllers/sessions-controller/protocols/_protocols/flow-internal/active-favicon.ts (1)
registerActiveFaviconRoutes(16-57)src/main/controllers/sessions-controller/protocols/static-domains/index.ts (1)
registerStaticDomainsRoutes(13-51)
src/main/controllers/sessions-controller/protocols/static-domains/config.ts (1)
src/main/controllers/sessions-controller/protocols/static-domains/types.ts (1)
StaticDomainInfo(14-18)
scripts/frontend-routes-generator/pruner.ts (1)
scripts/frontend-routes-generator/common.ts (3)
getDirectories(9-12)ROUTES_PATH(6-6)FRONTEND_PATH(5-5)
src/main/controllers/sessions-controller/protocols/_protocols/flow/index.ts (6)
src/main/controllers/sessions-controller/protocols/utils.ts (1)
transformPathForRequest(86-96)src/main/controllers/sessions-controller/protocols/_protocols/flow/favicon.ts (1)
registerFaviconRoutes(5-20)src/main/controllers/sessions-controller/protocols/_protocols/flow/assets.ts (1)
registerAssetsRoutes(7-43)src/main/controllers/sessions-controller/protocols/_protocols/flow/extension-icon.ts (1)
registerExtensionIconRoutes(6-39)src/main/controllers/sessions-controller/protocols/_protocols/flow/pdf-cache.ts (1)
registerPdfCacheRoutes(4-21)src/main/controllers/sessions-controller/protocols/static-domains/index.ts (1)
registerStaticDomainsRoutes(13-51)
src/main/controllers/sessions-controller/protocols/utils.ts (1)
src/main/modules/paths.ts (1)
PATHS(18-23)
electron.vite.config.ts (1)
scripts/frontend-routes-generator/generator.ts (1)
generateRoutes(8-73)
src/main/controllers/sessions-controller/protocols/static-domains/serve-static.ts (4)
src/main/modules/paths.ts (1)
PATHS(18-23)src/main/modules/flags.ts (1)
FLAGS(16-40)src/main/controllers/sessions-controller/protocols/static-domains/hot-reload.ts (3)
setupHotReloadFileDescriptors(9-15)isDevelopmentServerRunning(21-27)fetchFromDevServer(45-81)src/main/modules/utils.ts (2)
getContentType(23-25)bufferToArrayBuffer(115-117)
src/main/controllers/windows-controller/types/base.ts (1)
src/main/modules/typed-event-emitter.ts (1)
TypedEventEmitter(11-130)
🔇 Additional comments (35)
tsconfig.node.json (1)
3-3: tsconfig.node.json narrowing is correct and properly architected.The change to restrict
includeto only application source directories (src/main,src/preload,src/shared) is intentional and well-supported. Build-time artifacts—includingelectron.vite.config.tsand all scripts inscripts/—are now explicitly covered by the dedicatedtsconfig.scripts.json, which includes"electron.vite.config.*"and"scripts/**/*". This represents a clean separation: Node application code vs. build tooling. Type-checking coverage is maintained across all code paths.src/main/controllers/windows-controller/interfaces/onboarding.ts (1)
7-10: LGTM! Properly awaiting the async show() method.The change correctly awaits the async
show()method from BaseWindow, ensuring the show operation completes before the function returns.src/main/controllers/windows-controller/types/base.ts (3)
6-14: LGTM! Well-designed additions for deferred window loading.The new
loadedevent anddeferShowUntilAfterLoadoption provide clean control over window show timing, allowing callers to wait for load completion before displaying the window.
71-76: LGTM! Clean extraction of immediate show logic.The new
showImmediately()method provides a synchronous way to show the window without waiting for load completion, which is useful when the window is already loaded.
78-83: LGTM! Correctly implements deferred show logic.The async
show()method properly waits for theloadedevent whendeferShowUntilAfterLoadis enabled and the window hasn't finished loading yet. The use ofwaitUntil()fromTypedEventEmitterensures the show operation is deferred until load completion.src/main/controllers/windows-controller/types/settings.ts (1)
31-31: LGTM! Correctly enables deferred showing for SettingsWindow.The addition of
{ deferShowUntilAfterLoad: true }ensures that the settings window won't be displayed until after it finishes loading, providing a better user experience by avoiding flickering or incomplete content.src/main/controllers/windows-controller/interfaces/settings.ts (1)
7-10: LGTM! Properly awaiting the async show() method.The change correctly awaits the async
show()method from BaseWindow, ensuring the show operation completes before the function returns.src/renderer/.gitignore (1)
1-2: LGTM!The ignore patterns correctly target generated artifacts from the new frontend route generation system, preventing them from being committed to version control.
docs/contributing/dependencies.md (1)
100-101: LGTM!Documentation correctly reflects the dependency changes, replacing
use-query-paramswithnuqsfor query parameter management and addinghonofor custom protocol routing.src/renderer/src/components/main/theme.tsx (2)
22-31: LGTM!The
applyThemeClasshelper cleanly encapsulates theme application logic, ensuring mutual exclusivity of theme classes.
71-81: Excellent refactor to prevent theme flicker.Switching to
useLayoutEffectensures the theme is applied synchronously before the browser paints, eliminating the flash of incorrect theme on initial load or theme changes.scripts/frontend-routes-generator/common.ts (1)
9-12: LGTM!The
getDirectorieshelper is cleanly implemented using modern fs APIs with proper filtering and mapping.package.json (2)
22-22: LGTM!The build script correctly integrates the pruning step after the build completes, ensuring generated artifacts don't ship with the production bundle.
30-31: LGTM!The new script entries correctly use
bun runand follow the project's naming conventions. Based on coding guidelines.src/renderer/src/routes/games/config.tsx (1)
5-9: LGTM!The removal of the
Fallbackproperty simplifies the route configuration and aligns with the broader RouteConfig type refactoring across the PR.scripts/frontend-routes-generator/generator.ts (1)
34-63: No issues found — all route directories contain required files.Verification confirms that all routes have both
config.tsxandpage.tsxfiles. The generator's assumptions are valid, and the relative imports will resolve correctly.src/renderer/src/routes/omnibox/config.tsx (1)
5-8: LGTM: RouteConfig simplified.The removal of
Fallback: nullsimplifies theRouteConfigobject and aligns with the broader refactoring pattern across multiple route configurations in this PR.src/renderer/src/routes/error/config.tsx (1)
5-8: LGTM: Consistent with RouteConfig refactoring.The
Fallbackremoval matches the pattern applied consistently across route configurations.src/renderer/src/routes/new-tab/config.tsx (1)
5-8: LGTM: RouteConfig simplified.The
Fallbackremoval is consistent with the broader refactoring. Thepersistprop onThemeProvideris correctly preserved.src/renderer/src/routes/settings/config.tsx (1)
5-8: LGTM: Consistent RouteConfig simplification.The removal of
Fallbackmatches the refactoring pattern applied across all route configurations.src/main/modules/utils.ts (1)
110-117: LGTM: Standard Buffer to ArrayBuffer conversion.The implementation correctly converts a Node.js
Bufferto anArrayBufferusing the standard pattern. Note that the returnedArrayBuffershares the underlying memory with the originalBuffer, so mutations to theBufferwould be reflected in theArrayBuffer. This is typically fine for one-time conversions (e.g., serving HTTP responses), but be mindful if the sourceBufferis reused or mutated elsewhere.src/renderer/src/routes/main-ui/config.tsx (1)
5-8: LGTM: RouteConfig simplified.The
Fallbackremoval is consistent with the broader refactoring. ThePortalsProviderwrapper is correctly preserved.src/renderer/src/routes/pdf-viewer/page.tsx (1)
1-1: Migration verification complete—no issues found.The
nuqsmigration is properly executed:
nuqsis installed in devDependencies (v2.7.2)use-query-paramsis completely removed from package.json and codebase- The
useQueryStatedestructuring pattern on lines 7-8 is identical to the previous implementation- The null/undefined check on line 9 (
if (!url)) correctly handles both cases, consistent with previous behavior- Nullish coalescing on line 15 (
cacheURL ?? url) is appropriate for handling potential undefined valuessrc/main/controllers/sessions-controller/protocols/types.ts (1)
1-1: Type definition is clean and properly used across the codebase.The verification confirms that
CustomProtocolis correctly typed in theregisterProtocolsWithSessionfunction signature asCustomProtocol[], and all calls pass valid protocol values. Hardcoded strings elsewhere (Electron API calls likeprotocol.registerSchemesAsPrivilegedandprotocol.handle) are necessary and appropriate for those APIs.src/renderer/src/routes/omnibox-debug/config.tsx (1)
5-9: LGTM! Clean removal of Fallback property.The RouteConfig now correctly contains only the Providers property, aligning with the updated RouteConfigType interface.
src/renderer/src/routes/about/config.tsx (1)
5-9: LGTM! Consistent with the RouteConfig refactor.The change correctly removes the Fallback property while maintaining the ThemeProvider wrapper.
src/renderer/src/routes/popup-ui/config.tsx (1)
5-9: LGTM! Consistent refactor with appropriate provider.The Fallback removal is consistent with other route configs, and the PortalsProvider is suitable for the popup UI route.
src/renderer/src/components/providers/nuqs-provider.tsx (1)
1-5: LGTM! Clean abstraction over NuqsAdapter.The NuqsProvider component is a simple, well-typed wrapper that provides a consistent API for integrating nuqs query parameter management across routes.
src/renderer/src/routes/pdf-viewer/config.tsx (1)
11-19: LGTM! Consistent NuqsProvider integration.The provider nesting is correct and consistent with the extensions route. The PDF viewer route appropriately uses NuqsProvider for query parameter management, likely for passing the PDF URL.
src/main/controllers/sessions-controller/protocols/_protocols/flow/index.ts (3)
11-14: LGTM! Proper Hono app initialization.The Hono app is correctly initialized with a custom
getPathtransformer, which enables hostname-based routing for the Flow protocol.
16-23: LGTM! Well-organized route registration.All route handlers are registered in a logical order, with static domains correctly registered last as the catch-all handler.
26-30: LGTM! Clean protocol handler implementation.The Flow protocol handler correctly delegates requests to the Hono app, aligning with the PR's objective to use Hono for routing.
src/renderer/src/routes/onboarding/config.tsx (1)
5-9: LGTM! Consistent with the RouteConfig refactor.The removal of the Fallback property aligns with the updated RouteConfigType interface across all route configurations.
src/renderer/src/routes/extensions/config.tsx (1)
6-14: Selective NuqsProvider usage is intentional and correct.The codebase shows different query parameter patterns that justify selective NuqsProvider usage:
- error route: Uses native
URLSearchParamsfor one-time query param reads (errorCode,url) with URL history manipulation. No reactive state management needed.- extensions & pdf-viewer routes: Use NuqsProvider for reactive query state management, likely for features requiring reactive URL param tracking.
The nesting and selective application are appropriate given the distinct use cases.
src/main/controllers/sessions-controller/protocols/utils.ts (1)
92-95: Fix the URL parsing implementation.Line 92 calls
URL.parse(request.url), but the WHATWGURLclass exposed in Electron/Node does not ship a staticparsemethod. In practice this throwsTypeError: URL.parse is not a function, so the protocol handler crashes on every request. Swap tonew URL(request.url)(and fall back gracefully if parsing fails) or importparsefrom"node:url".- const url = URL.parse(request.url); - const hostname = url?.hostname; - - return `/${hostname}${realPath}`; + try { + const hostname = new URL(request.url).hostname; + return hostname ? `/${hostname}${realPath}` : realPath; + } catch { + return realPath; + }⛔ Skipped due to learnings
Learnt from: iamEvanYT PR: MultiboxLabs/flow-browser#24 File: electron/browser/tabs/tab.ts:309-310 Timestamp: 2025-04-18T23:20:02.623Z Learning: In the Flow Browser codebase, `URL.parse` is preferred over `new URL()` for URL parsing because it works without errors in the Electron runtime environment, even though TypeScript's type definitions require `ts-ignore` comments.
hono/tinyfor Routinguse-query-paramswithnuqsSummary by CodeRabbit
New Features
Bug Fixes
Refactor