Repository navigation
Fix side menu height on play.html when web terminal is open - #105087
Conversation
The left panel had a fixed `height: 100vh`, so opening the web terminal pushed its bottom (with the terminal/GitHub icons) below the viewport. Track the panel height via a `--terminal-height` CSS variable and size the menu as `100vh - terminal_height`. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
Workflow [PR], commit [6982670] Summary: ✅ AI ReviewSummaryThis PR adjusts Findings
Final VerdictStatus: Minimum required actions:
|
When `play.html` is opened locally with a `?url=...` query parameter overriding the server, the HEAD check for `/webterminal` was still issued against the page's own URL (e.g. `file:///webterminal`) and always failed. Resolve it against the configured server instead. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
… server URL The availability probe was updated in cdd5e96 to resolve `/webterminal` against `url_elem.value`, but `getTerminalURL` still returned the relative path `/webterminal`, which the iframe resolves against the page's own origin. When the page is opened locally with `?url=...`, the probe would succeed on the configured server while the iframe loaded a non-existent endpoint on the page origin. Make `getTerminalURL` resolve against `url_elem.value` so the probe and the iframe use the same URL source. Capture the iframe origin at creation time and use it as the target origin for `postMessage`, so credential and refit messages still reach the iframe when it is cross-origin. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
This was fixed by #105146. Let's update the branch. |
|
@groeneai, please fix this error: Stress test (arm_release) FAIL |
|
@alexey-milovidov — Existing fix in flight: PR #102033 — "Fix Family evidence (CIDB, last 30 days): STID 2606-* family has 19 total failures — 4 on master + 14 across 15 distinct PRs — confirming this is a chronic trunk bug, not anything specific to PR #105087's play.html change. The single 2606-44c0 hit in CIDB right now is exactly the one you flagged here on Closing the loop on the directive: tracked, fix exists, waiting on review. — @groeneai (session cron:clickhouse-ci-task-worker:20260517-234500) |
`getTerminalURL` resolved `/webterminal` against `url_elem.value` without validation. If the value is not an absolute URL (e.g. `?url=localhost:8123` or a temporarily invalid value while the user is editing), `new URL(...)` threw synchronously, and because the probe runs at module initialization the exception could abort the rest of `play.html` initialization. Catch the parse failure, return `null`, and treat that as "terminal unavailable" - skip the probe and bail out of `activateTerminal` before mutating any state. Addresses review feedback on PR #105087. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
The only failing CI check is @groeneai, please investigate and fix in a separate PR if it is not yet covered. |
|
@alexey-milovidov — confirming this STID is already covered. Quick rundown: STID 2606-44c0 ⊆ same chronic family as STID 2606-4a47 / issue #102037. Identical error message ( Existing fix-in-flight: PR #102033 — "Fix LOGICAL_ERROR crash in IcebergMetadata::iterate when datalake_table_state is missing". Same file, same line 1037. Body explicitly cites STID 2606-4a47 evidence. Defense-in-depth: falls back to Why it hasn't merged yet: PR #102033 is stale — last activity 2026-04-28, 8714 commits behind master, only review was @alesapin's dismissal on day-of-open (2026-04-08) with no comments. It's been sitting awaiting a fresh look from comp-datalake for ~5 weeks. So this is a review-stall, not a "fix not yet written" situation. Next action on my side: I'll rebase #102033 onto current master and re-request review. Tagging the comp-datalake owners again so this finally moves: cc @alesapin @Michicosun @scanhex12 @kssenii — could one of you re-check #102033? Same fix unblocks all 18+ hits across this PR and the other 13 PRs hitting the family in CIDB. — @groeneai (session |
pamarcos
left a comment
There was a problem hiding this comment.
The fix seems to work.
Before
Now
However, apart of the typo, GPT-5.5 reports the following:
programs/server/play.html:4305-4309 now probes http://server/webterminal from the page origin. When play.html is opened from file:// or another host/port, this fetch needs CORS headers, but /webterminal does not add them, so the probe is blocked and the terminal icon stays hidden.
programs/server/play.html:4313-4318 posts credentials to the remote iframe, but programs/server/webterminal.html:320-322 rejects messages unless e.origin === window.location.origin. For a local/static play.html, the parent origin differs from the iframe origin, so credentials/refit messages are dropped even if the iframe is forced open.
Suggested fix: either scope this PR back to same-origin layout only, or define a safe explicit cross-origin embedding contract. Don’t just accept * in webterminal.html; that same-origin check is currently the main guard against arbitrary pages embedding /webterminal and sending credentials.
`codespell` flagged the comment word `unparseable` in `getTerminalURL`'s guard clause. Replace with `unparsable` so the `Style check` passes. Addresses the only unresolved review thread on #105087.
| terminalIcon.style.display = 'none'; | ||
| const terminalProbeURL = getTerminalURL(); | ||
| if (terminalProbeURL) { | ||
| fetch(terminalProbeURL, {method: 'HEAD'}).then(function(resp) { |
There was a problem hiding this comment.
fetch(terminalProbeURL, {method: 'HEAD'}) requires CORS whenever url_elem.value points to a different origin (for example file://.../play.html?url=http://host:8123). The /webterminal HTML response path does not add CORS headers, so this probe is rejected by the browser and the terminal icon stays hidden even when the endpoint exists.
Can we avoid a cross-origin fetch as the availability check (for example, optimistic show + lazy fallback on iframe load failure)?
| function sendCredentialsToTerminal() { | ||
| if (terminalIframe && terminalIframe.contentWindow) { | ||
| if (terminalIframe && terminalIframe.contentWindow && terminalOrigin) { | ||
| terminalIframe.contentWindow.postMessage({ |
There was a problem hiding this comment.
This now posts webterminal-credentials to terminalOrigin, but programs/server/webterminal.html accepts parent messages only from same-origin or *.clickhouse.com / *.clickhouse.cloud. For local/static play.html (origin = "null"), credentials/refit messages are dropped.
With auth enabled, webterminal.html then waits for parent credentials after initial auth fails, so the embedded terminal cannot recover. If local embedding is intended here, this needs a compatible handshake/allowlist contract.
|
GPT-5.5 found the same as Opus: Findings
|
|
This nitpick is secondary to this PR. |
`getTerminalURL` resolved `/webterminal` against `url_elem.value` without validation. If the value is not an absolute URL (e.g. `?url=localhost:8123` or a temporarily invalid value while the user is editing), `new URL(...)` threw synchronously, and because the probe runs at module initialization the exception could abort the rest of `play.html` initialization. Catch the parse failure, return `null`, and treat that as "terminal unavailable" - skip the probe and bail out of `activateTerminal` before mutating any state. Addresses review feedback on PR ClickHouse#105087. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
`codespell` flagged the comment word `unparseable` in `getTerminalURL`'s guard clause. Replace with `unparsable` so the `Style check` passes. Addresses the only unresolved review thread on ClickHouse#105087.
…-with-terminal Fix side menu height on play.html when web terminal is open
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Fix the left panel height on the
play.htmlpage when the web terminal is open, so the terminal toggle button at the bottom stays visible.Documentation entry for user-facing changes
Description
The side menu on
play.htmlhad a fixedheight: 100vh, so opening the web terminal panel above it pushed its bottom (the terminal toggle and GitHub icons) below the viewport.This change tracks the panel's height via a
--terminal-heightCSS variable and sizes the menu ascalc(100vh - var(--terminal-height, 0px)). The variable is updated whenever the terminal is activated, hidden, or drag-resized, so the menu's bottom icons stay visible at all times.Version info
26.6.1.111