fix(sites): repair broken links, env-gated cross-nav, prefix and offline fixes - #1
Draft
moortekweb-art wants to merge 5 commits into
Draft
fix(sites): repair broken links, env-gated cross-nav, prefix and offline fixes#1moortekweb-art wants to merge 5 commits into
moortekweb-art wants to merge 5 commits into
Conversation
…ine fixes - service worker: precache only real routes (drop /chat and /recipes redirect stubs), bump cache to v11; gate SW registration off under path-prefix deploys to match the documented prefix story - manifest: point stale /chat and /recipes shortcuts at live routes - /models redirect now carries ?section=models so Configure opens the Models section instead of Overview - align controller-URL fallbacks with the proxy's trusted default origin, fixing the fresh-install 403 loop on the Status dashboard - Logs docs link targets the CDN-free OpenAPI spec panel instead of the CSP-blocked Swagger UI; GPU monitoring row no longer renders "null" - /quick gets a way back into the full app - new env-driven sidebar network links (NEXT_PUBLIC_PORTAL_URL / NEXT_PUBLIC_SIBLING_LINKS): private hostnames stay in gitignored env files, never in the repo; remote preset URL likewise env-gated via LOCAL_STUDIO_REMOTE_PRESET_URL - README: document the services/agent-runtime install step required for a clean-clone build; deploy-remote.sh ships the frontend env file when present Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MydtMsZwYyuKYamq5FEfoo
Owner
Author
|
CI note — the Dependency Review failure is a repository setting, not this diff. The job errors before analyzing anything:
This fork has Dependency Graph disabled (GitHub disables it on forks by default), so Owner-side fixes (either works):
Generated by Claude Code |
The security workflow only listened for pull_request/push on main, so the TruffleHog, CodeQL and Dependency Review gates that docs/workflow.md lists as required for merges into dev never ran on a dev PR. Dependency Review also failed unconditionally here: GitHub keeps the dependency graph disabled on forked repositories, and the action hard-fails with "Dependency review is not supported on this repository" — a red required check that no diff could turn green. Skip the job on forks instead.
NEXT_PUBLIC_SIBLING_LINKS entries went into an href unvalidated, so a javascript: or relative value in a deployment env file would render as a live link. Accept only absolute http(s) URLs, require a non-empty label, and apply the same check to NEXT_PUBLIC_PORTAL_URL. Malformed JSON, a non-array value or an unset variable still degrade to an empty list, never a throw. The links only rendered inside the desktop sidebar footer, which is hidden below md — on a phone and in the installed PWA they were unreachable. Render them in the mobile navigation drawer too, so the same links are present wherever app navigation is.
… uncached cache.addAll rejected the whole install if any one precached route was unavailable, leaving the app with no service worker at all; each asset is now added independently and failures are tolerated. On a cache miss the fetch handler resolved to undefined, which surfaces as a network error — an offline navigation to a page that was never cached looked like a broken app rather than an offline one. Fall back to the cached app shell for navigations and to an explicit 503 otherwise. Redirected and cross-origin responses are no longer stored: replaying a cached redirect for a navigation trips Chromium's redirect-mode check.
…ders
The .env.example entries used your-host.example.ts.net placeholders, putting
tailnet-shaped hostnames in a public repository; use example.invalid instead.
Document the literal NEXT_PUBLIC_SIBLING_LINKS format an operator has to
produce — a one-line JSON array of {label, href} objects, http(s) only — along
with both injection shapes (an inline env assignment for next build, and the
unquoted .env.local form) and the degrade-to-empty behaviour.
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.
Repairs broken internal links, PWA/service-worker behaviour, a 403 on fresh installs and a CSP-blocked docs link, and adds an env-gated cross-navigation mechanism for linking out to sibling services.
Targets
devperdocs/workflow.md.Cross-navigation:
NEXT_PUBLIC_SIBLING_LINKSTwo build-time variables drive the sidebar network links. There is no fallback URL in the source — when neither is set, nothing renders.
NEXT_PUBLIC_PORTAL_URLNEXT_PUBLIC_SIBLING_LINKS{"label": string, "href": string}objects.Both are inlined by
next build, so they must be in the build environment, not the runtime one. Either export them for the build (single-quote the JSON so the double quotes survive) or put them infrontend/.env.localunquoted;scripts/deploy-remote.shships that file to the remote. Full spec in the README under "Sidebar network links".Entries are dropped unless
labelis a non-empty string andhrefis an absolutehttp(s)URL —javascript:,data:and relative paths are rejected. An absent, blank, non-JSON or non-array value degrades to an empty list, so the app renders normally with no links rather than crashing. Covered byfrontend/src/features/shell/network-links.test.ts.The links render in both the desktop sidebar footer and the mobile navigation drawer, so they are reachable wherever app navigation is.
Broken links and flow fixes
/modelsredirected to/configure#models;ConfigurePageselects its section from?section, so the hash alone landed on Overview. Now redirects to/configure?section=models#models./chatand/recipes, a dead route and a redirect stub. Now/agentand/configure?section=models./chatand/recipes;cache.addAllrejected the whole install if any one route was unavailable, leaving the app with no service worker. Assets are now added individually and failures tolerated.undefined, which surfaces as a network error — an offline navigation to an uncached page looked like a broken app. Now falls back to the cached app shell, then an explicit 503. Redirected and cross-origin responses are no longer stored./quickhides the app sidebar and has no bridge in a plain browser, making it a navigation dead end. It now offers an "Open full app" link when no desktop bridge is present.http://127.0.0.1:8080while the proxy's trusted origin ishttp://localhost:8080— different origins, so every first status poll 403'd. Both spellings aligned.cdn.jsdelivr.netand is blocked by the frontend CSP (and unreachable offline), rendering a blank page. It now links the raw spec; the in-app panel is the browsable reference.basePathis honoured by hand-written manifest/icon/sw.js/proxy references, and the service worker is disabled under a prefix because the static manifest'sstart_url/scopecannot be made prefix-safe.No topology in tracked files
The hardcoded
pop-os-1.tailadb2c1.ts.netremote preset is removed; the remote first-run lane now appears only whenLOCAL_STUDIO_REMOTE_PRESET_URLis set. All examples useexample.invalid.The only matches on added lines are the app's own loopback default, matching
shared/agent/backend-url.ts. Every.ts.netmatch in the diff is a removal.CI
Dependency Reviewfailed on every PR: GitHub keeps the dependency graph disabled on forked repositories and the action hard-fails with "Dependency review is not supported on this repository" — a red required check no diff could fix. The job is now skipped on forks (re-enable by turning on the dependency graph under Settings → Code security).Separately,
security.ymlonly listened formain, so the TruffleHog / CodeQL / Dependency Review gates thatdocs/workflow.mdlists as required for merges intodevnever ran on adevPR. It now covers both branches.Verified locally (macOS, node 22.20.0, bun 1.3.14)
controller:bun run typecheck && lint && check && testservices/agent-runtime:bun run testfrontend:npm run check:staticfrontend:bun test src desktopscripts/check-conventional-commits.mjs --rangefrontend:npm run build(no sibling env)frontend:npm run build(placeholder env)app/layoutchunkfrontend:npm run build(malformed env)With no env set,
example.invalidappears nowhere in.next/static; with it set, the portal and both sibling hrefs appear. E2E (e2e) anddesktop-packagewere not run locally.