Skip to content

Add resizable sidebar and improve frontmatter tab toggles - #59

Merged
chris-c-thomas merged 4 commits into
mainfrom
feat/ui
Mar 21, 2026
Merged

Add resizable sidebar and improve frontmatter tab toggles#59
chris-c-thomas merged 4 commits into
mainfrom
feat/ui

Conversation

@chris-c-thomas

Copy link
Copy Markdown
Owner

This pull request introduces several enhancements and UI improvements to the content viewer and sidebar components, as well as better handling and display of raw YAML frontmatter in content pages. The main changes include adding a frontmatter toggle with raw YAML view, moving copy/download buttons to the page header, and making the sidebar resizable with persistent width.

Frontmatter and Content Viewing Improvements:

Copy/Download Button Placement:

  • Moved the copy and download buttons for the full file content out of the ContentViewer component and into the page header, next to the title, for better discoverability and to clarify that they refer to the entire file (frontmatter + body). The buttons are now rendered in the main content pages (ecfr/[...slug].astro and usc/[...slug].astro). (apps/astro/src/pages/ecfr/[...slug].astroL183-R207, apps/astro/src/pages/usc/[...slug].astroL144-R168)
  • Removed the copy/download buttons from the ContentViewer toolbar, and updated its description and props accordingly. [1] [2]

Sidebar Usability:

  • Made the sidebar resizable by adding a drag handle, with width persisted to local storage. The sidebar width is clamped between minimum and maximum values, and the drag logic is implemented with pointer events. [1] [2]

File Content Handling:

These changes collectively improve the user experience for viewing, copying, and downloading content and metadata, as well as provide a more flexible and accessible sidebar.

  Add drag-to-resize sidebar with pointer capture, localStorage persistence,
  and 200-500px width range. Restructure sidebar into outer positioning
  container and inner scrollable area so the drag handle stays fixed
  regardless of scroll position.
  Use scrollbar-gutter: stable to reserve scrollbar space during loading,
  and initialize sidebar width from localStorage synchronously to prevent
  a flash from default width on navigation.
@chris-c-thomas chris-c-thomas self-assigned this Mar 21, 2026
@chris-c-thomas chris-c-thomas added enhancement Enhancements made to exisiting features or codebase main astro labels Mar 21, 2026
Signed-off-by: Chris Thomas <chris.c.thomas@icloud.com>
@sonarqubecloud

Copy link
Copy Markdown

@chris-c-thomas
chris-c-thomas merged commit 89c8f33 into main Mar 21, 2026
8 checks passed
@chris-c-thomas
chris-c-thomas deleted the feat/ui branch March 21, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

astro enhancement Enhancements made to exisiting features or codebase main

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant