Document View Layout — Compact Sidebar & PDF Max Width

Date: 2026-04-09

Goal

On the document detail view, reclaim horizontal space for the data panel by:

  1. Collapsing the sidebar into its existing 60px icon rail (no expansion).
  2. Capping the PDF pane at 720px so the data panel grows to fill the remaining width.

All other pages keep their current 300px (or responsive 220/60px) sidebar and the current 50/50 pdf/data split.

Motivation

The document detail view is where users spend the most time reading extracted data — matches, validation, line items, payment summary. The current 50/50 split between PDF and data panel wastes horizontal space on wide monitors: the PDF is already legible well below half-width, while the data panel has to wrap or scroll.

Collapsing the sidebar on this view also reduces visual noise during deep-focus review. The user explicitly does not want an expansion affordance — clicking a sidebar icon navigates away from the detail view anyway, so the icon rail with title tooltips is sufficient.

Current State

Layout (src/com/getorcha/app/ui/layout.clj)

Document view CSS

Document view rendering

Design

1. Compact sidebar flag in layout

Add a :compact-sidebar? option to app.ui.layout/base (default false). When truthy:

The sidebar remains in the DOM and stays navigable; the user can still click any icon to leave the detail view.

2. Compact sidebar CSS

Add a new CSS rule block scoped to body.compact-sidebar-mode that mirrors the current @media (max-width: 1023px) sidebar-collapse rules:

The existing @media (max-width: 1023px) block stays untouched. The duplication is intentional: it keeps viewport-based and page-based triggers independent, and avoids having one rule silently depend on the other.

No hover, no click-to-expand, no JS. The sidebar is a static 60px icon rail on the detail view.

3. PDF pane max width

In .pdf-panel (style.css:1523), change:

max-width: 100%;

to:

max-width: 720px;

Leave flex: 1, min-width: 300px, and resize: horizontal as-is.

.data-panel stays flex: 1 with no changes. Flexbox redistribution means that once the PDF hits its 720px cap, the remaining horizontal space flows to the data panel automatically.

Behavior by viewport width (accounting for the 60px compact sidebar, 24+24px .content padding, and 16px flex gap between the two panels):

The 1564px crossover is where half of the flex inner width hits 720px. Above that, every extra pixel of viewport flows into the data panel.

4. Wire it up on the detail page

In src/com/getorcha/app/http/documents/view/shared.clj::detail-page (line 766), add :compact-sidebar? true to the options map passed to app.ui.layout/base.

Out of Scope

Testing

Manual verification on the document detail view at several viewport widths:

Files Touched