feat(widget): optional dev-overlay hook + notification plugin#11
Closed
urbanlama wants to merge 1 commit into
Closed
feat(widget): optional dev-overlay hook + notification plugin#11urbanlama wants to merge 1 commit into
urbanlama wants to merge 1 commit into
Conversation
Public-facing changes that lay the ground for an optional, build-time
dev overlay loaded into the widget WebView. Default builds are
unaffected: the JS hook is tree-shaken when VITE_TOKENBBQ_DEV_OVERLAY
is unset, and the new Rust deps/permissions are dormant until JS code
calls them.
- widget/src/dev-overlay.ts: dynamic import of $VITE_TOKENBBQ_DEV_OVERLAY
if set at build time (~10 LOC, tree-shaken otherwise)
- widget/src/main.ts: import the hook near the top
- widget/.gitignore: ignore widget/public/tokenbbq-dev-overlay.js (drop
target for the private overlay's prod build)
- src-tauri/Cargo.toml: add tauri-plugin-notification (dev-overlay uses
it for OS notifications; harmless if unused)
- src-tauri/src/lib.rs: register notification plugin; tag the tray with
a stable id 'main' so JS code can grab it via TrayIcon.getById('main')
- src-tauri/capabilities/default.json: notification:default,
core:tray:default, core:image:default permissions
- src-tauri/tauri.conf.json: relax CSP to allow https connect-src and
blob: img/media-src (needed for any future cross-origin asset loads;
default builds don't make any such requests)
Collaborator
Author
|
Switching to a private fork so the public repo stays untouched. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Adds a tiny opt-in hook that lets a private dev companion mount additional UI into the widget's WebView at build time. Default builds are completely unaffected — the JS hook is tree-shaken when
VITE_TOKENBBQ_DEV_OVERLAYis unset, and the new Rust deps stay dormant until JS calls them.The reason this lands here rather than as a fork: the overlay needs a stable Tauri-side anchor (tray with id `"main"`, notification plugin registered, CSP that allows HTTPS `connect-src`). Forking the widget for those four lines would be unmaintainable; a documented opt-in hook is much smaller and the changes are useful even on their own (CSP relaxation is the only one that has any visible effect, and it only matters if the WebView ever fetches HTTPS — currently it doesn't).
Changes
Risk profile
Test plan
🤖 Generated with Claude Code