Skip to content

Fix request type visibility, mobile layout overflow, and overnight polling (#23, #24, #25) - #26

Open
pataniaeli wants to merge 5 commits into
devfrom
fix/issues-23-24-25
Open

Fix request type visibility, mobile layout overflow, and overnight polling (#23, #24, #25)#26
pataniaeli wants to merge 5 commits into
devfrom
fix/issues-23-24-25

Conversation

@pataniaeli

Copy link
Copy Markdown
Collaborator

Fixes #23, #24, and #25.

#25 — User reports high usage overnight

Rather than guess at a polling bug, I checked the actual Supabase request logs (edge_logs, filtered to the service-role/node user agent) for the overnight window. Two spaces' /display/[spaceId] kiosk pages were each generating ~270 identical requests to spaces/space_bookings/space_blackouts over 16 hours — continuous polling every 50s regardless of whether anyone could see the screen. That matches the reported Screen Time chart exactly: solid, uninterrupted usage attributed to the site across 12AM–5AM.

Fix: both the 50s data poll and the 1s clock tick now check document.visibilityState before doing anything, so a display left open in a backgrounded tab (screen off, phone locked, tab switched away) stops generating traffic. A visibilitychange listener fetches immediately on return so it catches up rather than waiting out the interval. A kiosk whose screen genuinely stays on the whole time — the feature's actual use case — is unaffected.

#23 — Request types not visible or filterable

Requests have carried scope/division/room_request_bodies since #19, but nothing rendered it anywhere. Added:

  • scope, division, and room_request_bodies(body_id, bodies(name)) to the /api/administrator/requests and /api/me/requests selects.
  • ScopeLabel (already used for bookings) on every request surface: the admin Requests tab, the Fulfill Request modal, the Open Requests sidebar in all three admin creation forms, and leadership's own My Requests list.
  • A type filter (All / Single Body / Divisional / Multi-Body) on the admin Requests tab and each Open Requests sidebar, alongside their existing filters.

#24 — Mobile layout clipping and overflow

Traced each of the seven reported symptoms to a specific cause rather than a general responsive pass:

  • The fixed mobile hamburger button reserves no layout space; two of the reported screens had a right-aligned control sitting directly underneath it. Content now gets pt-20 clearance on mobile.
  • My Rooms' header row now wraps instead of forcing the day-range buttons against the notification bell.
  • The notification dropdown's fixed w-80 overflowed off-screen since the bell sits near the left of its row — clamped to the viewport.
  • Settings' "Add a body" <select> hit the classic flexbox min-width: auto gotcha (pinned to its widest <option>, ignoring flex-1) and pushed the Join/Request button off-screen — same root cause broke the Weekly Room Start/End Date fields in the request form.
  • The request-a-booking type tabs didn't scroll, hiding the "Viewing Previous Requests" toggle — now uses the same overflow-x-auto pattern already established for the Administrator tab bar (Administrator Tab will not scroll on mobile #10).
  • SGA Spaces' range filter buttons now wrap instead of running off the page; the blackout create/edit forms' Date+Time grid stacks to one column below sm instead of cramming a 3-select TimePicker into half a row; Active Blackouts was overflow-hidden (clipping) instead of overflow-x-auto (scrollable).

Verification

tsc --noEmit clean, npm run build compiles all 61 routes. Lint on the touched files shows only three pre-existing setState-in-effect errors in code I didn't modify (confirmed via git diff that none of my changes touch those effects) — no new errors or warnings introduced.

I did not do a live authenticated click-through of the mobile fixes in a browser — verification here is build/typecheck plus a careful read of each fix against the reported screenshot. Worth a manual pass on a real phone before merging, particularly the notification dropdown clamp and the blackout form stacking.

🤖 Generated with Claude Code

pataniaeli and others added 3 commits August 26, 2026 09:52
Traced via Supabase request logs (edge_logs, filtered to the node/service-role
user agent): two spaces' /display/[spaceId] pages were each generating ~270
identical requests to spaces/space_bookings/space_blackouts over a 16-hour
window, continuing straight through the night regardless of whether anyone
could see the screen. That is exactly the profile in the reported Screen Time
chart -- solid, continuous usage attributed to this site across 12AM-5AM.

Both the 50s data poll and the 1s clock tick now check
document.visibilityState before doing anything, so a display left open in a
backgrounded tab (screen off, phone locked, tab switched away) stops
generating traffic and CPU wake-ups. A visibilitychange listener fetches
immediately on return so the display catches up rather than waiting out the
rest of the interval. A kiosk whose screen genuinely stays on and visible the
whole time -- the feature's actual use case -- is unaffected, since
visibilityState stays 'visible' for as long as it's actually on screen.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Requests have carried scope/division/room_request_bodies since #19, but
nothing rendered it: every request list showed only the originating body,
with no way to tell a single-body request from a divisional or multi-body
one, and no way to filter by it.

- /api/administrator/requests and /api/me/requests now select scope,
  division, and room_request_bodies(body_id, bodies(name)) alongside what
  they already returned.
- ScopeLabel (already used for bookings) now renders on every request
  surface: the admin Requests tab, the Fulfill Request modal's summary card,
  the Open Requests sidebar in all three admin creation forms, and
  leadership's own My Requests list.
- A type filter (All / Single Body / Divisional / Multi-Body) is added
  alongside the Requests tab's existing status grouping, and to each Open
  Requests sidebar next to its existing per-body filter -- mirroring the
  scope selector's own option set so the two stay in sync.

FulfillModal takes the owning body's name, scope, division and linked bodies
as plain fields on `request` rather than the raw row, since its only source
is the caller passing through what it already rendered -- avoids re-deriving
ScopedRow shape in a component that isn't otherwise scope-aware.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Each fix targets the specific reported symptom, no broader redesign:

- Dashboard content now clears the fixed mobile hamburger button (top-4,
  ~40px tall, no reserved layout space) with pt-20 on small screens,
  restored to the normal pt-8 at md+. This was the root cause behind two of
  the reported screens, where a right-aligned control sat directly under it.
- My Rooms' title/bell/filter-buttons header row now wraps instead of
  forcing the "Next 1/3/7 Days" buttons hard against the bell.
- The notification dropdown's fixed w-80 overflowed off the right edge on
  mobile, since the bell sits near the left of that row -- clamped to
  w-[min(20rem,calc(100vw-2rem))].
- Settings' "Add a body" <select> ignored its flex-1 and stayed pinned to
  its widest <option>'s content width (the classic flexbox min-width:auto
  gotcha), pushing the Join/Request button off-screen -- fixed with min-w-0.
- The request-a-booking type tabs didn't scroll, hiding the "Viewing
  Previous Requests" toggle past the screen edge -- now uses the same
  overflow-x-auto + whitespace-nowrap pattern already established for the
  Administrator tab bar (issue #10). The Weekly Room Start/End Date inputs
  overlapped for the same min-width:auto reason as the body select above.
- SGA Spaces' booking-range filter buttons (This Week/Month/Semester/All)
  now wrap instead of running off the page; the blackout create/edit forms'
  Date+Time grid now stacks to one column below sm instead of cramming a
  3-select TimePicker into half a row; Active Blackouts was overflow-hidden
  (clipping) instead of overflow-x-auto (scrolling), so it could never be
  scrolled to see cut-off columns.

public/sw.js is the regenerated next-pwa artifact.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@vercel

vercel Bot commented Aug 26, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
chambers Ready Ready Preview Aug 26, 2026 2:48pm

The grid-cols-1 stacking fix in the previous commit solved the layout
collision, but a distinct bug remained: on a WebKit-based mobile browser
(reported via Opera on iOS -- Apple requires all iOS browsers to render on
WebKit, so this reproduces in Safari too, and anywhere else on iOS), the
Start/End Date `<input type="date">` fields themselves rendered wider than
their bordered box and spilled past its right edge, regardless of width or
min-width.

Root cause: globals.css applies the site's custom font (Space Grotesk) to
every input, including native date inputs. iOS's date-picker widget sizes
its internal day/month/year segments using the input's own font metrics, and
Space Grotesk's glyph widths differ enough from the system font that WebKit
miscalculates and renders wider than the CSS box.

Fixed with one rule: `input[type="date"]` falls back to the system font,
letting iOS size it against the metrics its own picker expects. Confirmed
via grep that every date field in the app (17 call sites across 10 files --
SGA Spaces blackouts, all three admin booking create/edit forms, and all
three Request a Booking date fields) is a plain native `<input type="date">`
with no local font override, so this single global rule covers every
instance rather than needing a per-file fix.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Isolates the reported "Date field uncontained/blank" symptom into four
minimal cases (empty w/ Space Grotesk, empty w/ system font, a filled value,
and a plain text input for comparison) so it can be checked directly on the
device where the bug reproduces, without needing an authenticated session.

Not a fix -- remove once the real cause is confirmed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

1 participant