Skip to content

Add dedicated chat and preset routes - #51

Open
johannesschiessl wants to merge 2 commits into
mainfrom
t3code/add-chat-presets-routes
Open

Add dedicated chat and preset routes#51
johannesschiessl wants to merge 2 commits into
mainfrom
t3code/add-chat-presets-routes

Conversation

@johannesschiessl

Copy link
Copy Markdown
Member

What changed

  • moved non-live Chat and Presets actions out of the title bar and into dedicated show routes
  • reused the existing tabbed chat workspace as a full-page experience
  • added a responsive preset library with destination-channel selection, field/reply summaries, and quick use/edit/delete actions
  • preserved prepared-answer prompts outside chat by extracting their shared behavior from the live drawer
  • updated notification navigation to open the dedicated Chat route outside Live

Why

Chat and message presets need enough room to be easy to scan and operate during soundcheck. Dedicated routes make them predictable across desktop and mobile while keeping the title bar focused.

User impact

Non-live show navigation now includes Chat and Presets on desktop and mobile. Live behavior remains unchanged.

Validation

  • focused format, lint, and type checks for all changed source files
  • all monorepo tests: 234 passed
  • pnpm --filter @showtime/web build
  • local browser smoke test (connection gate only; no paired backend was available)

@johannesschiessl
johannesschiessl marked this pull request as ready for review August 8, 2026 21:20

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 9 files

Architecture diagram
sequenceDiagram
    participant User as User (Browser)
    participant Router as TanStack Router
    participant ShowLayout as ShowLayout
    participant ChatNav as ChatNavigation
    participant ChatRoute as Chat Route
    participant ChatWorkspace as ChatWorkspace
    participant ChatAnswers as ChatAnswerPrompts
    participant PresetRoute as Presets Route
    participant PresetsWS as ChatPresetsWorkspace
    participant PresetDialog as ChatPresetDialog
    participant Backend as Backend API

    Note over User,Backend: NEW: Dedicated /chat and /presets routes

    User->>Router: Navigate to /shows/$showId/chat
    Router->>ShowLayout: Render ShowLayout
    ShowLayout->>ChatRoute: Outlet renders ChatRoute

    Note over ChatNav: CHANGED: activeShowId only for /live/ or /chat paths
    ChatNav-->>ChatRoute: If notification, consumeChatOpenRequest(showId)
    ChatRoute->>ChatWorkspace: Render ChatWorkspace(showId, requestedChannelId)
    ChatWorkspace->>Backend: Subscribe to chat state via chatAtoms
    Backend-->>ChatWorkspace: Snapshot (channels, messages)

    Note over ShowLayout, ChatAnswers: ShowLayout also renders ChatAnswerPrompts outside /chat
    ShowLayout->>ChatAnswers: chatOpen = isChatRoute (false here)
    ChatAnswers->>Backend: Subscribe to chat state, plan answer requests

    User->>Router: Navigate to /shows/$showId/presets
    Router->>ShowLayout: Render ShowLayout
    ShowLayout->>PresetRoute: Outlet renders PresetRoute
    PresetRoute->>PresetsWS: Render ChatPresetsWorkspace(showId)
    PresetsWS->>Backend: Subscribe to chat state
    Backend-->>PresetsWS: Snapshot (channels, presets)
    PresetsWS->>PresetsWS: Select destination channel
    User->>PresetsWS: Click "Use preset"
    PresetsWS->>PresetDialog: Open ChatPresetDialog(initialMode = { type:"use", preset })
    User->>PresetDialog: Confirm send (fill fields)
    PresetDialog->>Backend: sendMessage(channelId, preset fields, answer)
    Backend-->>PresetDialog: Success
    PresetDialog->>PresetsWS: Notify sent (close dialog)

    alt If not on /chat route and pending answer exists
        ChatAnswers->>ChatAnswers: Show ChatPresetAnswerDialog
        User->>ChatAnswers: Respond to prompt
        ChatAnswers->>Backend: Send answer
    end
Loading

Reply with feedback, questions, or to request a fix.

Re-trigger cubic

Comment thread apps/web/src/components/chats/ChatAnswerPrompts.tsx
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