UI: show read-only header badge for shared links and refine header layout/responsive styles - #103
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the header layout and styling, including the addition of a 'read-only' status badge and improved responsiveness for smaller screens. I have reviewed the changes and recommend adding a fallback background color for the color-mix() CSS function to ensure compatibility with older browsers.
| align-items: center; | ||
| <<<<<<< codex/reduce-header-height-for-better-ux-d99l1w | ||
| min-height: 18px; | ||
| padding: 1px 6px; |
There was a problem hiding this comment.
The color-mix() function is a modern CSS feature. While it has good support in recent browser versions, providing a fallback background color is recommended to ensure the badge remains visually distinct in older browsers that do not support this syntax.
| padding: 1px 6px; | |
| background: var(--color-warning-muted); /* Fallback for older browsers */ | |
| background: color-mix(in srgb, var(--color-warning-muted) 40%, transparent); |
There was a problem hiding this comment.
Pull request overview
This PR updates the header UX to better represent shared-link (read-only) mode via an existing header status badge, while also refining header layout/responsiveness and standardizing some header control sizing.
Changes:
- Add
#headerStatusBadgein the header and update shared-link logic to set its text instead of injecting a separate indicator node. - Refine header/layout CSS across breakpoints (flex behavior, spacing, truncation, button sizing).
- Update
public/index.htmlto reference newly built hashed bundle filenames and addaria-labels for header buttons.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| public/index.html | Adds #headerStatusBadge element in the header and updates hashed CSS/JS asset references; adds aria-labels to header buttons. |
| frontend/share.js | Updates checkSharedLink() to set the header badge text for shared links instead of inserting a new DOM node. |
| frontend/styles/header.css | Introduces .header-status-badge styling and adjusts header layout, sizing, and truncation behavior. |
| frontend/styles/responsive.css | Updates header/data-time responsive behavior, including 480px-specific wrapping and label hiding. |
| frontend/styles/utilities.css | Standardizes theme toggle button size and removes the legacy .readonly-badge style. |
| frontend/styles/compatibility.css | Adjusts read-only-mode visibility rules (no longer targets .time-info). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| } | ||
|
|
||
| .header-status-badge { | ||
| display: none; | ||
| align-items: center; | ||
| <<<<<<< codex/reduce-header-height-for-better-ux-d99l1w | ||
| min-height: 18px; | ||
| padding: 1px 6px; | ||
| border: 1px solid var(--color-warning-muted); | ||
| border-radius: var(--radius-pill); | ||
| color: var(--color-warning); | ||
| background: color-mix(in srgb, var(--color-warning-muted) 40%, transparent); | ||
| font-size: 10px; | ||
| font-weight: 500; | ||
| line-height: 1.2; | ||
| white-space: nowrap; | ||
| flex-shrink: 0; | ||
| ======= |
There was a problem hiding this comment.
body.read-only-mode makes .header-status-badge visible regardless of whether it has any content. Since checkSharedLink() adds read-only-mode before the fetch completes, the badge can render as an empty pill during the loading/error/redirect path. Consider only displaying the badge when it’s non-empty (e.g., via an :empty rule or :not(:empty) selector), or set a meaningful loading text before enabling the visible state.
Motivation
Description
checkSharedLink()to set the text of an existing#headerStatusBadgeelement for read-only state instead of inserting a new.share-indicatornode.span.header-status-badgewith idheaderStatusBadgetopublic/index.htmland addedaria-live="polite"for accessibility..header-status-badgestyles and toggled its visibility viabody.read-only-modeinfrontend/styles/header.css, and removed the old.readonly-badgeusage.header.css,responsive.css,compatibility.css, andutilities.cssto refine padding, gaps, flex behavior, icon/button sizes, truncation/ellipsis handling, and mobile breakpoints.public/index.htmlto the new hashed CSS and JS bundle filenames and addedaria-labelattributes to some header buttons.Testing
npm run buildand verified the production assets were emitted successfully.body.read-only-modeand that the#headerStatusBadgebecomes visible and shows the expected text.Codex Task