Skip to content

refactor: Extract duplicated perspective selector into Svelte 5 snippet#56

Merged
rodrigogs merged 2 commits into
feat/chat-header-options-menufrom
copilot/sub-pr-55
Jan 5, 2026
Merged

refactor: Extract duplicated perspective selector into Svelte 5 snippet#56
rodrigogs merged 2 commits into
feat/chat-header-options-menufrom
copilot/sub-pr-55

Conversation

Copilot AI commented Jan 5, 2026

Copy link
Copy Markdown
Contributor

The perspective selector UI was duplicated between the small screen options menu and large screen standalone dropdown, requiring changes in two places.

Changes

  • Extracted reusable snippet: Created perspectiveSelectorContent() containing the shared DropdownHeader, DropdownSearch, and participant list UI
  • Replaced both instances: Small screen menu (lines 657-691) and large screen dropdown (lines 757-789) now render the same snippet
  • Net reduction: 33 lines removed
{#snippet perspectiveSelectorContent()}
  <DropdownHeader title={m.perspective_view_as()} />
  <DropdownSearch bind:value={perspectiveSearchQuery} ... />
  <DropdownList>
    <!-- participant list items -->
  </DropdownList>
{/snippet}

<!-- Used in both small and large screen layouts -->
{@render perspectiveSelectorContent()}

This ensures both menus stay in sync and changes only need to be made once.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…ippet

Co-authored-by: rodrigogs <2362425+rodrigogs@users.noreply.github.com>

Copilot AI commented Jan 5, 2026

Copy link
Copy Markdown
Contributor Author

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • eu.posthog.com
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/whats-reader/whats-reader/node_modules/.bin/paraglide-js compile --project ./project.inlang --outdir ./src/lib/paraglide --strategy localStorage cookie preferredLanguage baseLocale (dns block)
    • Triggering command: /usr/local/bin/node node /home/REDACTED/work/whats-reader/whats-reader/node_modules/.bin/vite build (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Add responsive chat header options menu for small screens refactor: Extract duplicated perspective selector into Svelte 5 snippet Jan 5, 2026
Copilot AI requested a review from rodrigogs January 5, 2026 06:47
@rodrigogs rodrigogs marked this pull request as ready for review January 5, 2026 06:52
@rodrigogs rodrigogs merged commit dffc384 into feat/chat-header-options-menu Jan 5, 2026
1 check passed
@rodrigogs rodrigogs deleted the copilot/sub-pr-55 branch January 5, 2026 06:52
rodrigogs added a commit that referenced this pull request Jan 5, 2026
* feat: add responsive chat header options menu for small screens

- Add options menu button (3-dot vertical) for screens < md breakpoint
- Group perspective, media gallery, bookmarks, and stats into dropdown menu
- Keep locale switcher and theme toggle always visible
- Maintain individual buttons on large screens (>= md breakpoint)
- Improve mobile UX by reducing header button clutter

* fix: perspective dropdown now works properly on small screens

- Switch dropdown content instead of opening second dropdown
- Keep options menu open while showing perspective selector
- Reset perspective search on menu close
- Smoother UX without menu reopening required

* refactor: Extract duplicated perspective selector into Svelte 5 snippet (#56)

* Initial plan

* refactor: extract duplicated perspective selector UI into reusable snippet

Co-authored-by: rodrigogs <2362425+rodrigogs@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rodrigogs <2362425+rodrigogs@users.noreply.github.com>

* refactor: extract perspective selector to snippet and fix menu behavior

- Extract duplicate perspective selector UI into reusable snippet
- Close chat options menu after selecting a perspective
- Reduce code duplication from 2 instances to 1 snippet
- Improve consistency and maintainability

Addresses Copilot PR review comments

* fix: remove duplicate snippet declaration

- Remove duplicate perspectiveSelectorContent snippet
- Keep only the top-level snippet declaration
- Fix build error: Identifier already declared

---------

Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
Co-authored-by: rodrigogs <2362425+rodrigogs@users.noreply.github.com>
github-actions Bot pushed a commit that referenced this pull request Jan 5, 2026
# [1.26.0](v1.25.1...v1.26.0) (2026-01-05)

### Features

* Add responsive chat header options menu for small screens ([#55](#55)) ([4932bd2](4932bd2)), closes [#56](#56)
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.

2 participants