Skip to content

Force single-column vote list on phone widths (fixes 'tiny text' on the vote page) - #456

Open
JeffreyBLewis wants to merge 2 commits into
fix-sticky-vote-chart-overlapfrom
fix-vote-list-mobile-columns
Open

Force single-column vote list on phone widths (fixes 'tiny text' on the vote page)#456
JeffreyBLewis wants to merge 2 commits into
fix-sticky-vote-chart-overlapfrom
fix-vote-list-mobile-columns

Conversation

@JeffreyBLewis

Copy link
Copy Markdown
Collaborator

Summary

Stacks on #455 (same underlying branch work, just so this diff doesn't duplicate that one) -- the actual new change here is one commit, 0d7e23f.

voteTable.js picks 1-4 CSS columns for the rollcall page's member vote list based on how many members are shown (10 per column) -- sized for desktop, where a full Senate vote needs #voteList's 1100px min-width to fit 4 columns. On a phone that doesn't fit even one column's width, so the extra columns render entirely off-screen.

That's what was actually behind the "text is tiny" report: the font size itself is normal, but faced with a several-times-too-wide, partly-cut-off layout, a real phone user pinches out to see the rest of it -- and that zoom-out is what shrinks the text. Confirmed this by loading the page with headless Chromium at a phone viewport and inspecting the actual rendered column count/width, not just guessing from CSS.

Fix: force columns: 1 below 768px (the breakpoint already used elsewhere for stacking) and drop #voteList's min-width there so the single column can shrink to fit. Desktop is untouched.

Known remaining issue, not addressed here: the page still has some horizontal overflow left from the DW-NOMINATE scatter plot and vote map (a fixed 890px chart), which is a separate problem from this text/column issue. Flagging rather than fixing, since that's the same area that caused trouble last time (closed #454) -- happy to take another pass at it if wanted, verified with headless Chromium this time.

Test plan

Verified with headless Chromium (Playwright):

  • At 390px width: vote list renders as one column at 360px (fits the viewport) instead of 4 columns forcing ~1100px; every row fully visible, no horizontal cut-off (screenshot below)
  • At 1280px width: unchanged 4-column layout -- desktop path not touched
  • No console or page errors
  • Manual eyeball on an actual phone, if you get a chance

🤖 Generated with Claude Code

https://claude.ai/code/session_013KJMYfgTNsxrmjHZpZKAHT

JeffreyBLewis and others added 2 commits September 7, 2026 20:57
$("#vote_chart_float").stick_in_parent() pins the vote page's party
vote-count bar chart to the viewport as you scroll past it, so it stays
visible alongside the member vote list below. That's fine at >=992px
where the two columns sit side by side, but Bootstrap stacks them to
full width below that -- so the "stuck" chart became a full-width bar
fixed to the top of the viewport, floating directly over the member
list as it scrolled underneath.

Gate the sticky behavior on window width (>=992px, matching the
Bootstrap md breakpoint where the columns are actually side by side),
and detach/reattach it on resize so someone resizing the window mid-
scroll doesn't get stuck in a broken state either way.

Verified with headless Chromium (Playwright) at 375/768/900/992/1280px,
scrolling the full height of a rollcall page and checking the chart's
bounding box against the vote list's at every 100px of scroll: no
overlap at any sampled position after the fix (previously overlapped
at 375/768/900px), desktop sticky behavior at >=992px is unchanged,
and a resize across the breakpoint mid-scroll correctly attaches/
detaches with no console or page errors.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013KJMYfgTNsxrmjHZpZKAHT
… text

voteTable.js picks 1-4 CSS columns for the rollcall page's member vote
list based on how many members are shown (10 per column), sized for a
desktop-width layout -- a full Senate vote renders 4 columns needing
#voteList's 1100px min-width. On a phone that layout doesn't fit even
one full column's width, let alone four, so the extra columns get cut
off entirely off-screen.

That's what was actually behind "text is tiny on the vote page": the
text itself is a normal size, but faced with a several-times-too-wide,
partly-cut-off layout, a real phone user pinches out to see the rest of
it -- and that zoom-out is what shrinks the text. Confirmed by loading
the page with headless Chromium at a phone viewport and checking the
actual rendered column count/width, not just scrollWidth.

Force columns:1 below 768px (matching the breakpoint already used
elsewhere for stacking) and drop #voteList's min-width there so the
single column can shrink to fit -- above that the layout is untouched.

Verified with headless Chromium:
- At 390px: vote list renders as one column at 360px wide (fits the
  viewport) instead of 4 columns forcing ~1100px; every row fully
  visible with no horizontal cut-off
- At 1280px: unchanged 4-column layout, confirming the desktop path
  wasn't touched
- No console or page errors

Note: the page still has some horizontal overflow left from the
DW-NOMINATE scatter plot and vote map, which are a separate, still-
fixed-pixel-width issue (890px chart in a chart container) unrelated
to this text/column problem -- not addressed here.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_013KJMYfgTNsxrmjHZpZKAHT
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