Repository navigation
Studio: open //host links as web links; run apt-get by absolute path; ignore the dev Studio home - #14190
Conversation
… ignore the dev Studio home
|
@codex review |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@codex security review |
🛡️ Codex Security ReviewSecurity review completed. No security issues were found in this pull request. Reviewed commit: Only the user who started this review can view the report in Codex. ℹ️ About Codex security reviews in GitHubThis is an experimental Codex feature. Security reviews are triggered when:
Once complete, Codex will leave suggestions, or a comment if no findings are found. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: ad94cfcb3a
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
|
||
| // `//host/path` (or with backslashes, which browsers read the same way) is another site, not a path in Studio: | ||
| // native navigation would replace Studio's page (the Desktop main window) with it. | ||
| if (/^[\\/]{2}/.test(url)) { |
There was a problem hiding this comment.
Normalize leading URL whitespace before classifying links
When untrusted Markdown uses a destination such as [x](< //evil.example/x>), Streamdown preserves the leading space, but the browser's URL parser strips it during native <a> navigation. This check therefore misses the protocol-relative URL, the later relative-URL branch returns false, and the Markdown click handler does not prevent the navigation, so the external site can still replace the Studio page. Normalize leading/trailing C0 controls and spaces before applying this test.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 8148fb5: leading and trailing C0 controls and spaces are trimmed (as the URL parser does) before any classification, so //host and \u0001\t//host open as web links too. Covered in the test.
|
@codex review |
|
Codex Review: Didn't find any major issues. Hooray! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
## Summary Main is over the startup bundle budget again, by 17 B raw, so `Frontend build + bundle sanity` fails on every PR based on it: ``` over the startup budget: raw 6665.9 KB > 6665.9 KB (main at 551dc28) ``` #14168 reset both limits to the measured build plus a 160 B raw / 189 B transfer margin. #14190 (open //host links as web links) then added 177 B raw / 52 B transfer to the eager startup chunks. It merged while its own bundle check was still queued, so the raise never happened. ## Cause `studio/frontend/src/lib/open-link.ts` is the shared link opener, and the eager shell imports it. #14190 adds leading/trailing control-character trimming and `//host` (scheme-relative) link handling there (+16 lines). That is real growth with no lazy home: the opener is needed from the first screen. #14187, the other commit since the reset, changes no frontend code. ## Change - **`check-bundle-budget.ts`:** a BUDGET comment entry for #14190, and both limits moved to the measured build plus the same margin: - `rawBytes`: 6,825,885 -> 6,826,062. - `transferBytes`: 2,054,261 -> 2,054,313. ## Testing One machine and build, Node 24, exact byte totals from the budget script, 95 chunks throughout. CI has matched this machine to the byte on every earlier budget change. | tree | raw B | transfer B | |---|---|---| | `4dc8bf0bd2` (after #14168, no frontend change since) | 6,825,725 | 2,054,072 | | main `551dc28123` (+ #14190, #14187) | 6,825,902 | 2,054,124 | - **Main against the old limits:** `over the startup budget: raw 6665.9 KB > 6665.9 KB`. - **With this change:** `within budget (0.2 KB transfer, 0.2 KB raw to spare)`.
Three small hardenings from a re-check of the security scan backlog. Each was approved in an earlier triage round and had not landed. No visible change for normal use.
//hostlinks open as web links (studio/frontend/src/lib/open-link.ts).openLinktreated a protocol-relative href (//evil.example/x, or the backslash forms browsers read the same way) as a path inside Studio and let native navigation run, which replaced Studio's page, and in Desktop the main window, with another site. Studio: open http(s): source links without slashes as web links; flag Windows theme downloads #13195 coveredhttps:hostwithout slashes; this covers//host. It is rewritten tohttps://host/...and opened like any other web link (browser panel or a new tab). Relative paths, anchors and ordinary links are unchanged./usr/bin/apt-getby absolute path (studio/src-tauri/src/install.rs). The code already checks that/usr/bin/apt-getexists, then ranapt-get updateandapt-get installby bare name under elevation. Both now use the checked path, asdebian_update.rsalready does./.studio/is ignored by git (.gitignore). The README's dev install keeps the Studio home in the checkout (UNSLOTH_STUDIO_HOME="$PWD/.studio"). Onlyauth.dbwas ignored, sogit add .would stagestudio.db(chats, saved connections),auth/,accounts/, the venv and caches.Tests:
studio/frontend/tests/open-link-scheme-without-slashes.test.ts://hostand the backslash forms open ashttps://host/...(fails on main); the existing cases still pass. Related link tests pass (32),tscandeslintclean.tests/test_installer_elevation_report.py: no bareapt-getcommand ininstall.rs, and the README's dev Studio home is ignored.cargo check --lockedfor Desktop passes on Linux.Before / after
A web-search source chip whose stored URL is
//host/landing(a local landing page), clicked in a chat. Markdown links are already normalised by the renderer, so a source chip is where a//hosthref reachesopenLink. Before: Studio's page is replaced by the landing page. After: Studio stays on the chat and the link opens as a web link in a new tab.