Skip to content

feat(station-viewer): Add chat prototype#52

Open
r3nya wants to merge 4 commits into
norma-core:devfrom
r3nya:add-chat-prototype
Open

feat(station-viewer): Add chat prototype#52
r3nya wants to merge 4 commits into
norma-core:devfrom
r3nya:add-chat-prototype

Conversation

@r3nya

@r3nya r3nya commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a feature-flagged Chat route to station-viewer.

The chat UI is hidden by default behind features.json (chat: false). When enabled, the app shows a /chat route and navigation link with a Telegram-like layout: sessions on the left and the active conversation on the right.

What changed

  • Added FEATURE_FLAGS loading from features.json and guarded the Chat route/navigation entry.
  • Added a Chat page split into focused src/chat/* modules for controller logic, formatting, message grouping, scroll behavior, session state reduction, and presentational components.
  • Added a NormFS-backed chat store:
    • session events: session.create, session.update, session.delete
    • message events: message.create
    • deletion is modeled as an append-only session tombstone/state-machine event, not as physical NormFS deletion
  • Added chat UX basics:
    • session search/filter
    • new chat, refresh, and delete session actions
    • text-only composer
    • Enter inserts newline, Ctrl+Enter / Cmd+Enter sends
    • optimistic message sending with pending, saved, and failed states
    • retry for failed message saves
    • empty/offline states
    • date separators and compact message timestamps
  • Added large-history handling:
    • initial message load reads the latest page from the NormFS tail
    • scrolling near the top loads older messages by absolute NormFS entry index
    • prepending older messages preserves the reader's scroll position
    • auto-scroll only happens when the user is already near the bottom
  • Added responsive behavior:
    • desktop shows sessions and conversation side by side
    • mobile switches between session list and conversation screens instead of squeezing both columns

Notes

  • The feature flag is disabled in the PR by default. Local checkouts can flip software/station/clients/station-viewer/src/features.json to {"chat": true} for manual testing.
  • NormFS does not expose physical delete here; session delete is represented as a queued session.delete event and reduced in client state.

Validation

  • npm run type-check
  • npm run lint (passes with existing warnings outside the chat code)
  • npx vite build (passes with the existing large chunk warning)
  • Browser smoke checked /chat desktop and mobile layouts locally.

@r3nya r3nya changed the title WIP: Add chat prototype (station-viewer): Add chat prototype Jun 10, 2026
@r3nya r3nya changed the title (station-viewer): Add chat prototype feat(station-viewer): Add chat prototype Jun 10, 2026
@r3nya r3nya marked this pull request as ready for review June 10, 2026 09:49
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