Skip to content

✨ Redesign Document Editor Sidebar with Improved UX#181

Merged
ritz078 merged 9 commits intomasterfrom
ritesh/design-review
Feb 9, 2026
Merged

✨ Redesign Document Editor Sidebar with Improved UX#181
ritz078 merged 9 commits intomasterfrom
ritesh/design-review

Conversation

@ritz078
Copy link
Contributor

@ritz078 ritz078 commented Jan 30, 2026

User problem

The Document Editor sidebar in the UI customization example had an outdated design that didn't align with modern UX patterns. The toolbar was not responsive, making it difficult to use on smaller screen sizes. Additionally, users had no visual indication when they had unsaved changes, which could lead to accidental data loss.

How it is solved

The sidebar has been completely redesigned with a new layout structure featuring a proper header, collapsible toolbar with icon buttons, and responsive behavior using CSS container queries. An "unsaved changes" notification badge now appears when users have pending operations. The toolbar automatically adapts to narrower widths by switching from a 3-column to 2-column layout.

What this enables

  • 🎨 Users can now enjoy a more polished and professional Document Editor interface
  • 📱 Users can now use the sidebar comfortably at various container widths with responsive layout
  • ⚠️ Users can now see a clear visual indicator when they have unsaved changes
  • 🔧 Users can now access all page operations (rotate, delete, add, duplicate, import, move, export) via a collapsible toolbar

How to test

cd web/ui-customization-doc-editor-sidebar
pnpm i 
pnpm dev

Manual QA steps

  • Open the UI customization document editor sidebar example in the preview deployment
  • Click the Document Editor toolbar button to open the sidebar
  • Select one or more pages and verify the toolbar buttons work correctly (rotate, delete, duplicate, etc.)
  • Make changes and verify the "You have unsaved changes" notification appears
  • Resize the browser window to verify the header layout switches from 3 columns to 2 columns at narrow widths
  • Click "Save" to apply changes or "Save As..." to export the modified PDF

Risks / notes

  • ⚠️ Baseline UI dependencies upgraded from v0.45.8 to v0.48.5 - verify no breaking changes in other components
  • 📝 Uses @ts-expect-error for a private layoutTransition API on ImageGallery - may need updates if Baseline UI changes

- Updated versions of various dependencies in pnpm-lock.yaml for improved stability and security.
- Added new CSS styles for the image gallery in document-editor.css to enhance layout and responsiveness.
- Modified App.tsx to set a fixed sidebar width for better user experience.
- Refactored DocumentEditor.tsx to ensure consistent thumbnail dimensions and improved layout for page organization.
…nctionality

- Upgraded Baseline UI dependencies in package.json and pnpm-lock.yaml to version 0.48.5 for improved features and performance.
- Adjusted CSS styles in document-editor.css for better layout and responsiveness of the image gallery.
- Refactored DocumentEditor.tsx to implement a new toolbar layout, improve action button functionality, and ensure consistent thumbnail dimensions for document pages.
- Added a notification tag to indicate unsaved changes in the Document Editor.
- Adjusted layout styles for better positioning of the notification.
- Imported theme variables for improved styling consistency.
- Replaced existing icons with new ones for better clarity and functionality.
- Swapped the rotate action icons and updated their corresponding aria-labels.
- Introduced new actions for importing documents, moving pages left and right, and exporting selected pages.
- Enhanced the toolbar layout for improved user experience.
- Added a ResizeObserver to dynamically adjust the toolbar's maximum width based on the container size.
- Updated CSS to enhance spacing in the toolbar layout for improved visual consistency.
- Introduced a new state variable to manage the maximum width of the toolbar.
- Updated CSS for the toolbar to improve button padding and alignment.
- Adjusted the DocumentEditor component to include a reference for the toolbar container and refined layout properties for better responsiveness.
- Enhanced the styling of menu triggers for improved visual consistency.
- Centered toolbar items in the CSS for better alignment.
- Introduced container queries for responsive header layout in the Document Editor.
- Refactored thumbnail dimensions to use constants for consistency.
- Removed unused state and effects related to toolbar resizing for cleaner code.
@ritz078 ritz078 changed the title Ritesh/design review ✨ Redesign Document Editor Sidebar with Improved UX Jan 30, 2026
@ritz078 ritz078 marked this pull request as ready for review January 30, 2026 18:08
@ritz078 ritz078 self-assigned this Jan 30, 2026
@ritz078 ritz078 requested a review from a team January 30, 2026 18:50
- Modified CSS for the toolbar to improve button layout and responsiveness.
- Replaced toolbar icon with a new design for better clarity.
- Introduced state management for unsaved changes, allowing users to dismiss the unsaved changes notification.
- Adjusted action button labels and sizes for improved user experience.
@ritz078
Copy link
Contributor Author

ritz078 commented Feb 2, 2026

Copy link
Contributor

@miguelcalderon miguelcalderon left a comment

Choose a reason for hiding this comment

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

I've had an initial glance at the demo and I like the new UI very much. Things that I'd improve, but no deal breakers:

  • Cannot drag and drop to move pages around.
  • Personally I don't like flexible icon spacing, but that may be just me.
    Thank you for this update!

@ritz078
Copy link
Contributor Author

ritz078 commented Feb 2, 2026

Thank you for the review.

Cannot drag and drop to move pages around.

Intentionally cut the scope. If ever required, it can be easily added.

Personally I don't like flexible icon spacing, but that may be just me.

That was a design requirement: https://pspdfkit.slack.com/archives/C08U3KQ5TAQ/p1770020956600179?thread_ts=1766756481.913789&cid=C08U3KQ5TAQ

- Replaced the inline definition of the document editor toolbar item with a dedicated function to improve readability and maintainability.
- Added a `selected` property to the toolbar item for better state management.
- Updated the toolbar items dynamically based on the current view state to enhance user experience.
@ritz078 ritz078 merged commit bdf41bd into master Feb 9, 2026
2 checks passed
@ritz078 ritz078 deleted the ritesh/design-review branch February 9, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants