-
Notifications
You must be signed in to change notification settings - Fork 15
feat: update selkies web client build process and add no-sidebar diagnosis documentation #46
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
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
64 changes: 64 additions & 0 deletions
64
.devcontainer/skills/codespace-webtop/references/web-client-no-sidebar.md
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,64 @@ | ||
| # Web client: no-sidebar diagnosis & correct build | ||
|
|
||
| ## Symptom | ||
| Webtop launches: video renders, mouse/keyboard work, clipboard syncs, WS | ||
| handshake returns `MODE websockets`, `curl /` returns HTTP 200 — but the | ||
| Selkies **sidebar** (video/audio/screen settings, stats, clipboard, file | ||
| transfer, keyboard shortcuts) is missing. The page is just the bare desktop. | ||
|
|
||
| ## Root cause | ||
| The selkies repo ships TWO web addons under `addons/`: | ||
| - `selkies-web-core` — the **embeddable streaming Core** only. Its README | ||
| literally states it is "for an external dashboard to interact with the | ||
| client." The built bundle mounts with the sidebar CLOSED | ||
| (`_isSidebarOpen = !1`) and only opens it when a separate dashboard posts a | ||
| `window.postMessage({type:'toggleDashboard'})`. Served alone it is a desktop | ||
| feed with no sidebar chrome. | ||
| - `selkies-dashboard` — the **standalone UI** (React app, `react`/`react-dom`). | ||
| Its `prebuild` (`copy-core.js`) copies `../selkies-web-core/dist/selkies-core.js` | ||
| into `src/`; vite then bundles the Core *plus* the full sidebar UI. | ||
|
|
||
| Serving `selkies-web-core/dist` as `--web-root` is the wrong client. The | ||
| correct `--web-root` is `selkies-dashboard/dist`. | ||
|
|
||
| ## Confirm which client is being served | ||
| ```bash | ||
| # download the served bundle | ||
| curl -s http://127.0.0.1:3000/selkies-core.js > /tmp/core.js 2>/dev/null \ | ||
| || curl -s "http://127.0.0.1:3000/$(curl -s http://127.0.0.1:3000/ | grep -oE 'assets/index-[A-Za-z0-9]+\.js' | head -1)" > /tmp/core.js | ||
|
|
||
| # bare Core has almost no sidebar refs and starts closed: | ||
| grep -oE "_isSidebarOpen=![01]" /tmp/core.js # bare core: !1 (closed) | ||
| grep -oc "sidebar" /tmp/core.js # bare core: ~0-4 ; dashboard: ~90 | ||
| grep -oc "toggle" /tmp/core.js # bare core: ~0 ; dashboard: ~100 | ||
|
|
||
| # also: index.html. Dashboard's <div id="root"></div> + jsdb/ + assets/ dir; | ||
| # bare core's is a single selkies-core.js module with no assets/ folder. | ||
| curl -s http://127.0.0.1:3000/ | head | ||
| ls ~/.selkies/web_root/ | ||
| ``` | ||
|
|
||
| ## Correct build + serve (do this, not bare core) | ||
| ```bash | ||
| cd ~/.selkies | ||
| rm -rf selkies-src && git clone --depth 1 https://github.com/selkies-project/selkies.git selkies-src | ||
|
|
||
| for a in selkies-web-core selkies-dashboard; do | ||
| ( cd selkies-src/addons/$a && { npm ci --no-audit --no-fund 2>/dev/null || npm install --no-audit --no-fund; } && npm run build ) | ||
| done | ||
| # web-core FIRST (dashboard prebuild imports its dist); both must be siblings. | ||
|
|
||
| # swap web_root to the dashboard dist | ||
| rm -rf ~/.selkies/web_root && cp -r ~/.selkies/selkies-src/addons/selkies-dashboard/dist ~/.selkies/web_root | ||
|
|
||
| # restart (selkies reads --web-root at startup) | ||
| bash ~/.hermes/skills/codespace/codespace-webtop/scripts/selkies-native.sh restart | ||
| ``` | ||
| Verify: `curl /` now references `assets/index-*.js`; the served JS contains | ||
| ~90 `sidebar` refs; open the forwarded port — sidebar chrome present. | ||
|
|
||
| ## Pitfalls recap | ||
| - Build `selkies-web-core` before `selkies-dashboard` (prebuild dependency). | ||
| - `npm ci` can fail on a fresh `--depth 1` clone (no lockfile) → use `|| npm install`. | ||
| - The control script `cmd_build_web` now does this; older versions built bare | ||
| `selkies-web-core` (no sidebar) — the #1 historical cause of this bug. |
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.
When dependency installation or either addon build fails,
cmd_build_webcontinues, can clearweb_root, and can return success from the finalls;cmd_installthen creates the installed marker and reports completion even though Selkies has an empty, stale, or incompatible frontend.Prompt To Fix With AI