Skip to content

Let attendees collapse the chat panel and presenters hide it - #251

Open
nataliamelissas wants to merge 3 commits into
ClaperCo:devfrom
nataliamelissas:feature/attendee-chat-panel-toggle
Open

nataliamelissas wants to merge 3 commits into
ClaperCo:devfrom
nataliamelissas:feature/attendee-chat-panel-toggle

Conversation

@nataliamelissas

Copy link
Copy Markdown

On a phone the attendee room gives the chat panel a fixed share of the viewport. When the
current interaction is a poll, a quiz, or a form with more than a handful of options, the
question and its answers scroll inside roughly 40dvh while the panel below keeps its space,
even when nobody is reading the chat.

This adds two ways to give that space back:

  • Attendees can collapse the chat panel to a single "Show messages" bar. The choice is
    remembered per event in localStorage, the same pattern the focus slot and the caption
    panel already use.
  • Presenters get a "Hide chat panel" toggle in the attendee options, alongside the
    existing ones. It is a new chat_panel_visible field on the presentation state, so it
    broadcasts live and survives a reload. It is separate from "deactivate messages": that
    keeps the panel and removes the composer, this removes the panel entirely.

In both cases the focus slot takes the freed row, so the interaction uses the whole viewport.
When the panel is hidden with nothing on screen the room shows a short "Waiting for the
presenter" line rather than going blank.

Notes for review

  • #attendee-room moves from grid-rows-[…] to a flex column. The rows were enumerated in
    three static class strings; with a fourth toggle the enumeration doubles, and the flex
    version expresses the same layout with shrink-0 on the fixed rows.
  • The interaction wrapper inside #focus-slot no longer carries its own max-h-[40dvh].
    That cap was what kept a poll at 40dvh even after the panel was collapsed; the slot's own
    height governs now, and the cap stays on the slot for the default layout.
  • No inline styles or <style> blocks: the collapse states are classes in assets/css/app.css,
    toggled by the AttendeeChat hook. This keeps the templates usable behind a style-src 'self'
    CSP with no hashes.
  • mix format, mix credo (no issues), and mix test (344 tests) pass; mix gettext.extract
    and mix gettext.merge priv/gettext have been run.

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