Skip to content

Show header status badge for shared (read-only) views and refine header responsiveness/styles - #107

Merged
alvin000009238 merged 3 commits into
devfrom
codex/reduce-header-height-for-better-ux-l3icpc
Mar 31, 2026
Merged

Show header status badge for shared (read-only) views and refine header responsiveness/styles#107
alvin000009238 merged 3 commits into
devfrom
codex/reduce-header-height-for-better-ux-l3icpc

Conversation

@alvin000009238

Copy link
Copy Markdown
Owner

Motivation

  • Surface a clear read-only status when viewing shared grade links by updating the header UI rather than inserting a separate indicator element.
  • Improve header layout, spacing and responsive behavior across breakpoints so title/subtitle truncate properly on small screens.
  • Harmonize button sizes, accessibility attributes and localised labels for header controls.
  • Update built asset references in public/index.html after a build.

Description

  • Replaced the previous DOM-inserted share indicator in frontend/share.js with setting the text of a new #headerStatusBadge element and retained body.read-only-mode class for styling.
  • Added a .header-status-badge element to the header in public/index.html and adjusted header markup to include a .subtitle-row wrapper and ARIA labels on header buttons.
  • Made multiple CSS adjustments across frontend/styles/header.css, frontend/styles/compatibility.css, frontend/styles/responsive.css and frontend/styles/utilities.css to tighten paddings, adjust icon sizes, enable truncation/overflow handling, show the status badge when body.read-only-mode is active, and improve responsive wrapping/spacing for narrow viewports.
  • Updated static asset references in public/index.html to the new build filenames and tweaked some button labels (for clarity/localization).

Testing

  • Ran a production build with npm run build and the build completed successfully.
  • Ran the linter via npm run lint and no lint errors were reported.
  • Performed automated CSS/asset inclusion verification as part of the build pipeline and it passed without errors.

Codex Task

Copilot AI review requested due to automatic review settings March 31, 2026 15:13

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors the header UI, improves mobile responsiveness, and updates the share indicator logic. Key changes include layout adjustments, the addition of a status badge, and accessibility enhancements via ARIA labels. Feedback suggests centralizing hardcoded UI strings and removing redundant CSS rules to improve maintainability.

Comment thread frontend/share.js
const timeBox = document.querySelector('.data-time-box');
header.insertBefore(indicator, timeBox);
const headerStatusBadge = document.getElementById('headerStatusBadge');
if (headerStatusBadge) headerStatusBadge.textContent = '僅供檢視';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The status text '僅供檢視' is hardcoded here. To improve maintainability and simplify potential future internationalization, consider defining UI strings as constants in a central location rather than hardcoding them directly in the component logic.

Comment on lines +169 to +171
.time-label {
display: none;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

This rule is redundant because .time-label is already set to display: none; in frontend/styles/header.css for all screen sizes. Removing this rule will help keep the stylesheets DRY and easier to maintain.

@alvin000009238
alvin000009238 merged commit 518ed78 into dev Mar 31, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the app header to better communicate shared-link read-only status and to improve header responsiveness/truncation across breakpoints, aligning UI controls and styles with the revised header layout.

Changes:

  • Replace the DOM-inserted shared-link indicator with a dedicated #headerStatusBadge element in the header and set its text in share.js.
  • Refine header markup (subtitle row, status badge, ARIA labels) and adjust multiple header/responsive CSS rules for spacing, truncation, and button sizing.
  • Update public/index.html to reference the latest built /dist/* asset filenames.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Show a summary per file
File Description
public/index.html Adds header status badge element + subtitle row wrapper, tweaks header button labels/ARIA, updates built asset filenames.
frontend/share.js Sets read-only header badge text for shared-link views instead of inserting an indicator element.
frontend/styles/header.css Implements truncation/min-width fixes and adds styling/visibility rules for the new header status badge; adjusts header sizing.
frontend/styles/responsive.css Refines header layout behavior at 768px/480px breakpoints (wrapping, spacing, hiding text on very small screens).
frontend/styles/compatibility.css Updates read-only-mode header layout rules.
frontend/styles/utilities.css Adjusts theme toggle sizing and removes the old .readonly-badge utility style.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@alvin000009238
alvin000009238 deleted the codex/reduce-header-height-for-better-ux-l3icpc branch April 1, 2026 03:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants