[PR #325] [MERGED] feat: random-pool tickbox editor in quick connection switcher #4563

Closed
opened 2026-10-22 04:08:45 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/325
Author: @LukaTheHero
Created: 4/30/2026
Status: ✅ Merged
Merged: 4/30/2026
Merged by: @LukaTheHero

Base: main ← Head: feat/quick-switcher-random-pool-toggle


📝 Commits (1)

  • 4f8357a feat: random-pool tickbox editor in quick connection switcher

📊 Changes

2 files changed (+134 additions, -48 deletions)

View changed files

📝 packages/client/src/components/chat/QuickConnectionSwitcher.tsx (+69 -28)
📝 packages/client/src/components/chat/QuickSwitcherMobile.tsx (+65 -20)

📄 Description

Summary

Editing the random connection pool used to require opening the Connections panel and toggling the shuffle button on each connection card. This PR moves that editor into the Quick Connection Switcher itself so it can be managed inline from any chat.

Desktop (QuickConnectionSwitcher.tsx)

  • Removed the standalone "🎲 Random" entry above the connection list.
  • Added a dice icon in the dropdown header next to "Connections".
  • Clicking the dice toggles the active chat's connection between "random" and unset, and highlights the dice in amber while active.
  • While the dice is active, every connection row renders as a tickbox showing the connection's useForRandom state. Tapping a row toggles pool membership through the same useUpdateConnection mutation used by ConnectionsPanel.tsx, so the pool stays consistent everywhere.
  • When the dice is inactive, rows behave exactly as before (click to switch the chat to that connection).

Mobile (QuickSwitcherMobile.tsx)

  • The "🎲 Random" row at the top of the Connections tab is preserved (as requested — that layout has less room for a dedicated header icon).
  • When tapped, the row itself becomes the toggle: it switches the chat to random and gets an amber background + ring + "active" label.
  • While random is active, the connection rows below render as the same tickbox editor as the desktop version.

Both flows read the existing useForRandom flag and call useUpdateConnection — no new endpoints or schema changes.

Test plan

  • Manually verify desktop: open Quick Connection Switcher in a chat. Click the dice — chat switches to random, dice highlights amber, rows show tickboxes that match the current pool.
  • Tick / untick a connection in dice mode — verify the change persists and is reflected on the Connections panel's shuffle button.
  • Click the dice again — chat connection clears, rows revert to plain switcher behavior.
  • Click a connection row in normal mode — chat switches to that connection (existing behavior unchanged).
  • Manually verify mobile: open Quick Switcher, Connections tab. Tap "🎲 Random" — row highlights amber, rows below become tickboxes.
  • Tick / untick a connection on mobile — verify pool updates and matches desktop / Connections panel.
  • Tap "🎲 Random" again — random clears, rows revert to switch-to-connection behavior.
  • Verify the existing Connections panel shuffle button still works and stays in sync with the Quick Switcher tickboxes.

No linked issue — one should be opened before this PR is merged if Pasta-Devs requires it for tracking.

Summary by CodeRabbit

New Features

  • Added random connection pool management—toggle random mode with a dice icon in the connection switcher
  • Connection list now adapts based on mode: select active connection directly or manage random pool membership with visual indicators
  • Updated UI in both desktop and mobile switchers for improved connection selection workflow

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Pasta-Devs/Marinara-Engine/pull/325 **Author:** [@LukaTheHero](https://github.com/LukaTheHero) **Created:** 4/30/2026 **Status:** ✅ Merged **Merged:** 4/30/2026 **Merged by:** [@LukaTheHero](https://github.com/LukaTheHero) **Base:** `main` ← **Head:** `feat/quick-switcher-random-pool-toggle` --- ### 📝 Commits (1) - [`4f8357a`](https://github.com/Pasta-Devs/Marinara-Engine/commit/4f8357abef7074710199fca175b6f801799a032e) feat: random-pool tickbox editor in quick connection switcher ### 📊 Changes **2 files changed** (+134 additions, -48 deletions) <details> <summary>View changed files</summary> 📝 `packages/client/src/components/chat/QuickConnectionSwitcher.tsx` (+69 -28) 📝 `packages/client/src/components/chat/QuickSwitcherMobile.tsx` (+65 -20) </details> ### 📄 Description ## Summary Editing the random connection pool used to require opening the Connections panel and toggling the shuffle button on each connection card. This PR moves that editor into the Quick Connection Switcher itself so it can be managed inline from any chat. ### Desktop (`QuickConnectionSwitcher.tsx`) - Removed the standalone "🎲 Random" entry above the connection list. - Added a **dice icon** in the dropdown header next to "Connections". - Clicking the dice toggles the active chat's connection between `"random"` and unset, and highlights the dice in amber while active. - While the dice is active, every connection row renders as a tickbox showing the connection's `useForRandom` state. Tapping a row toggles pool membership through the same `useUpdateConnection` mutation used by `ConnectionsPanel.tsx`, so the pool stays consistent everywhere. - When the dice is inactive, rows behave exactly as before (click to switch the chat to that connection). ### Mobile (`QuickSwitcherMobile.tsx`) - The "🎲 Random" row at the top of the Connections tab is preserved (as requested — that layout has less room for a dedicated header icon). - When tapped, the row itself becomes the toggle: it switches the chat to random and gets an amber background + ring + "active" label. - While random is active, the connection rows below render as the same tickbox editor as the desktop version. Both flows read the existing `useForRandom` flag and call `useUpdateConnection` — no new endpoints or schema changes. ## Test plan - [x] Manually verify desktop: open Quick Connection Switcher in a chat. Click the dice — chat switches to random, dice highlights amber, rows show tickboxes that match the current pool. - [x] Tick / untick a connection in dice mode — verify the change persists and is reflected on the Connections panel's shuffle button. - [x] Click the dice again — chat connection clears, rows revert to plain switcher behavior. - [x] Click a connection row in normal mode — chat switches to that connection (existing behavior unchanged). - [x] Manually verify mobile: open Quick Switcher, Connections tab. Tap "🎲 Random" — row highlights amber, rows below become tickboxes. - [x] Tick / untick a connection on mobile — verify pool updates and matches desktop / Connections panel. - [x] Tap "🎲 Random" again — random clears, rows revert to switch-to-connection behavior. - [x] Verify the existing Connections panel shuffle button still works and stays in sync with the Quick Switcher tickboxes. > No linked issue — one should be opened before this PR is merged if Pasta-Devs requires it for tracking. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit ## New Features * Added random connection pool management—toggle random mode with a dice icon in the connection switcher * Connection list now adapts based on mode: select active connection directly or manage random pool membership with visual indicators * Updated UI in both desktop and mobile switchers for improved connection selection workflow <!-- end of auto-generated comment: release notes by coderabbit.ai --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-10-22 04:08:45 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Pasta-Devs/Marinara-Engine#4563
No description provided.