Skip to content

Sidebar cleanup: fix double scroll and add collapsible sections - #2383

Open
k-g-k wants to merge 1 commit into
codeforboston:mainfrom
k-g-k:sidebar-cleanup
Open

k-g-k wants to merge 1 commit into
codeforboston:mainfrom
k-g-k:sidebar-cleanup

Conversation

@k-g-k

@k-g-k k-g-k commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Follows #2378, which carried #2369's work into dev. Improvements to sidebar behavior and collapsible groups.

Sidebar scroll

The sidebar had its own scroll inside the page (a known issue in #2369). When the list was taller than the space under the navbar, the sidebar and the page competed for the same scroll: scrolling over the sidebar moved the list instead of the page. Two scrolls in the same place will always compete, so the fix removes the sidebar's own scroll and ties it to the page scroll.

  • Removed the sidebar's max-height and overflow-y: auto. Kept position: sticky under the navbar.
  • When the content in the sidebar fits the browser window, it behaves the same as it does on dev. When it doesn't fit, the sidebar scrolls with the page until it reaches its top or bottom boundary.
  • Once it reaches a boundary, the sidebar stays put. Scrolling the other way moves it with the page again, until it reaches the other boundary.
  • This is handled by useTwoWaySticky (ConferenceRail.tsx), which switches the edge the sidebar rests on when the scroll changes direction. It updates at most once per frame, on scroll, resize, and changes to the sidebar's height (a ResizeObserver, for collapsible groups opening and closing), and sets the sidebar's position directly on the element while the browser does the scrolling.

Sidebar groups

The sidebar was getting busy, so I moved Not Covered conferences into their own sidebar group, building upon the collapsible group for closed conferences that is hidden in the UI. In order to add this functionality cleanly, I created a component (SidebarGroups) that builds each group from a small set of categories, so every group, including the hidden closed conferences, is set up the same way.

Collapsible group (Not Covered) behavior:

  • Not Covered (with its count) starts collapsed, with the helper text below it. When we add closed conferences, the helper text will move inside the collapsible group.
  • When the user opens the collapsible group, it stays open while moving between conferences, until it's closed or the page reloads (refresh or direct link).
  • If the user is on a Not Covered conference and closes the group, reloads the page, or arrives by a direct link, the group is collapsed but still shows that conference, with "1 selected" beside the chevron.

How the component is set up:

  • The groups live in a new SidebarGroups.tsx. ConferenceRail.tsx keeps the sidebar's frame and scroll.
  • There are six categories defined in categories.ts, each built from a conference's existing status, covered and reportBillId. No backend or data changes.
Category Holds conferences that are (rule) Items show (bills)
Active appointed and covered (taking testimony) Senate and House bills
Not Covered appointed and not covered Senate and House bills
Pending report filed, with a report bill the report bill
Enacted enacted, with a report bill the report bill
Failed dissolved, with a report bill the report bill
Dissolved dissolved, with no report bill Senate and House bills
  • Each entry in SIDEBAR_GROUPS has three fields: data (its category), display ("inline" for the main list, "grouped" for a collapsible group) and shown (on or off). A group's heading is its category's name (category.* in conferences.json).
  • Today Active (main list) and Not Covered (collapsible) are on. The four closed categories (Pending, Enacted, Failed, Dissolved) are built but off, so closed conferences stay out of the sidebar, as on dev. The closedConferences flag (on since Flipping conference committee flags on production #2380) still loads them across the rest of the site, including their own pages and bill and hearing pages.

Other User-Facing Changes

  • On mobile, the conference picker lists only the conferences taking testimony, to reduce complexity. We may revisit this once the feature develops.
  • The helper text under Not Covered now says "We do not cover bond bills" to match the group's name.

No User Impact

  • Refactored the sidebar styles.
  • Explorer now calls isSitting rather than manually hiding the closed conferences.
  • Tests: new ones for the categories, the sidebar groups and the pickers, and the switching tests now cover the Not Covered group. The old sidebar test is replaced.

Checklist

  • On the frontend, I've made my strings translate-able.
  • If I've added shared components, I've added a storybook story. (No new shared components; the sidebar groups are only used on conference pages.)
  • I've made pages responsive and look good on mobile.
  • If I've added new Firestore queries, I've added any new required indexes to firestore.indexes.json (No new queries.)

Screenshots

To follow.

Known issues

None.

Extra Deploy Steps

Frontend only.

Steps to test/reproduce

  1. Open a conference committee page in a short window, so the sidebar is taller than the space under the navbar.
  2. Scroll down: the sidebar scrolls with the page until its bottom boundary reaches the window's bottom, then stays put. Scroll back up: it moves with the page until its top boundary is under the navbar, then stays put.
  3. Scroll with the pointer over the sidebar: the page scrolls, not just the sidebar.
  4. Not Covered starts collapsed, with its count and the helper text below it. Open it and click a Not Covered conference: the group stays open. Click an active conference: it's still open.
  5. Reload a Not Covered conference: the group is collapsed and shows only that conference, with "1 selected" beside the chevron.
  6. On a phone, open the conference picker: it lists only the conferences taking testimony.
  7. Open the explorer: it lists the same conferences as on dev, with Not Covered ones at the bottom.

@vercel

vercel Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
maple-dev Ready Ready Preview Nov 20, 2026 7:58pm UTC

Request Review

This branch was successfully deployed

1 active deployment
Preview – maple-dev — f1070682 Deployed Nov 20, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant