Web UI: add user name to the Documentation link URL#109419
Conversation
The Documentation link in the Web UI (`play.html`) now carries the Play username over to the `/docs` page as a `user` query parameter, so the docs page connects as the same user instead of falling back to the server default user. The password is intentionally omitted to avoid leaking it in the URL. The link stays in sync as the username changes, matching the existing behavior of the Web Terminal link. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Workflow [PR], commit [c7e3914] Summary: ✅
AI ReviewSummaryThis PR updates Findings
Final Verdict |
Address review feedback: `#user` is a browser-autofillable credential field, so the browser can fill a saved login without firing an `input` event. In that case `updateDocsURL` never reran, `docs_icon.href` stayed stale, and opening Documentation fell back to the server default user even though the visible field showed the saved one. Refresh the `href` on `pointerdown` as well, right before navigation, mirroring how the Web Terminal link (`updateTerminalHref`) already avoids the same stale-`href` problem. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The previous fix refreshed `docs_icon.href` only on `pointerdown`, which does not fire when the Documentation link is activated from the keyboard (tab to the link, then Enter). In that case, if the browser had autofilled `#user` after the initial `updateDocsURL` without firing `input`, the href stayed stale and `/docs` opened as the server's default user. Add a `click` listener in addition to `pointerdown`. `click` fires for both mouse and keyboard activation and runs before the browser's default navigation, so the href is refreshed on every navigation path (`pointerdown` still covers middle-button `auxclick`, which produces no `click`). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
| try { | ||
| docs_icon.href = new URL('/docs', url_elem.value).href; | ||
| const url = new URL('/docs', url_elem.value); | ||
| if (user_elem.value) url.searchParams.set('user', user_elem.value); |
There was a problem hiding this comment.
play.html already treats the connection user as "explicit user field first, otherwise the username embedded in url_elem.value" (see effectiveConnectionUser). This update only forwards user_elem.value, so a connection like http://alice@host:8123/ with an empty user field still opens /docs without ?user=alice. docs.html then seeds $url from location.origin and only restores $user from the query string, so its later queries run as the server default user instead of alice.
Please forward the effective connection user here (field first, otherwise URL userinfo) rather than only the visible field value.
There was a problem hiding this comment.
Isn't a big deal.
The Documentation link in the Web UI (
play.html) now carries the Play username over to the/docspage as auserquery parameter, so the docs page connects as the same user instead of falling back to the server default user.The password is intentionally omitted to avoid leaking it in the URL. The link stays in sync as the username changes, matching the existing behavior of the Web Terminal link.
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Web UI: the Documentation link now carries the current user name in the URL.
🤖 Generated with Claude Code
Version info
26.7.1.1195(included in26.7and later)