-
Notifications
You must be signed in to change notification settings - Fork 76
feat(macos): menu-bar Tray + extract main-window.ts + flip accessory mode (LUM-1965, PR 1) #32630
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
466b44f
feat(macos): menu-bar (Tray) status item with click + context menu (L…
claude df99ef0
refactor(macos): extract main-window.ts, fix focus-before-dispatch, f…
claude 06ac37a
fix(macos): wire dock visibility filter, tray ready-await, app-config…
claude 9656699
fix(macos): gate main-window readiness on both did-finish-load AND re…
claude d0513f3
fix(macos): drop /index.html suffix on prod main-window load target
claude ab43bc6
fix(macos): per-window readiness state + dispatch by reference (proac…
claude 1bbc6c3
fix(macos): existing-window ensureVisible returns the in-flight readi…
claude bc8184e
fix(macos): strip /assistant mount prefix in app:// protocol handler
claude 8eb44e1
fix(macos): dock policy is a function of main-window visibility, not …
claude File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| /** | ||
| * Shared application identity constants for the main process. | ||
| * | ||
| * `app-protocol` and `app-host` define the custom scheme the packaged | ||
| * renderer is served from. They're referenced from at least three | ||
| * places today (`index.ts` for `protocol.registerSchemesAsPrivileged` | ||
| * + the `protocol.handle` registration, `main-window.ts` for the | ||
| * BrowserWindow load URL and the same-origin navigation guard, | ||
| * `about.ts` for the About window's prod URL), so they live here as a | ||
| * single source of truth. Drift between callers would have shown up | ||
| * as a broken renderer load rather than a build error, which is | ||
| * exactly the kind of thing a small shared module prevents. | ||
| * | ||
| * The renderer-base URLs are derived: `RENDERER_BASE_PROD` is the | ||
| * packaged path the `app://` protocol handler resolves to; the dev | ||
| * path is honored from `VELLUM_DEV_URL` (vel's edge proxy, or the | ||
| * local Vite default at port 5173). Both end at the `/assistant` | ||
| * suffix that `apps/web/vite.config.ts`'s `base` setting requires. | ||
| */ | ||
|
|
||
| export const APP_PROTOCOL = "app"; | ||
| export const APP_HOST = "vellum.ai"; | ||
|
|
||
| const DEV_SERVER_FALLBACK_URL = "http://localhost:5173/assistant"; | ||
|
|
||
| /** | ||
| * Renderer-base URL for the packaged app. Auxiliary windows append | ||
| * their own subpath (`/about`, future `/conversations/<id>`, etc.). | ||
| */ | ||
| export const RENDERER_BASE_PROD = `${APP_PROTOCOL}://${APP_HOST}/assistant`; | ||
|
|
||
| /** | ||
| * Renderer-base URL in dev. Honors `VELLUM_DEV_URL` so the launcher | ||
| * can point at whichever Vite-or-equivalent is up (standalone Vite | ||
| * at :5173, or vel's edge proxy at :3000). Strips any trailing slash | ||
| * so callers can append `/<subpath>` without producing `//`. | ||
| */ | ||
| export const getDevRendererBase = (): string => | ||
| (process.env.VELLUM_DEV_URL ?? DEV_SERVER_FALLBACK_URL).replace(/\/+$/, ""); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/assistantprefix before packagingIn packaged builds this base causes the loaded HTML to request assets under
/assistant/assets/...becauseapps/web/vite.config.tssetsbase: "/assistant/", but theapp://handler inapps/macos/src/main/index.tsjoins the full URL pathname directly underrendererRootand only serves files that exist there. Since the web build emits files underrendererRoot/assets/...(notrendererRoot/assistant/assets/...), the main JS/CSS requests 404 and the packaged Electron app opens a blank/broken renderer unless the protocol handler strips the/assistantmount prefix or the files are copied under that prefix.Useful? React with 👍 / 👎.