Skip to content

Session recovery UX#15

Merged
qyinm merged 5 commits into
mainfrom
session-recovery-ux
May 4, 2026
Merged

Session recovery UX#15
qyinm merged 5 commits into
mainfrom
session-recovery-ux

Conversation

@qyinm
Copy link
Copy Markdown
Owner

@qyinm qyinm commented May 4, 2026

Summary

Adds sessionStatus-driven transcript screens and compact note-list indicators for recording, degraded, finalizing, transcribing, recoverable, failed, and completed sessions.

Why

MirrorNote now has session recovery state, but the renderer still needed a clear user-facing contract. Failed or interrupted local STT sessions should present one recovery action without exposing internal chunk ledger details.

Changes

  • Added a renderer session-status mapping helper with tests for transcript screen state selection.
  • Updated the Transcript tab to show recording, degraded, progress, recoverable, failed, empty, and completed transcript states.
  • Added compact sidebar indicators for degraded, transcribing, recoverable, failed, recording, and finalizing states.
  • Kept stt-chunks.jsonl and chunk IDs internal to recovery metadata instead of rendering debug chunk UI.
  • Added English and Korean copy for the new status and activity states.

Validation:

  • npm run desktop:check
  • git diff --check main..HEAD

Summary by CodeRabbit

  • New Features

    • Note activity indicators now show degraded, recoverable, and transcribing states.
    • Transcript view displays state-specific status panels and contextual retry/regenerate actions; transcript body shown only when appropriate.
    • Added localized strings for new activity and transcript statuses.
  • Styles

    • New styles for activity states, transcript status layout, color variants, and a primary action button.
  • Tests

    • Added unit tests covering activity determination and transcript-screen mappings.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 4, 2026

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: 582c74e0-7cea-4d8e-9177-038d8498d189

📥 Commits

Reviewing files that changed from the base of the PR and between c0b685c and ccd174b.

📒 Files selected for processing (5)
  • apps/desktop/src/components/TranscriptView.tsx
  • apps/desktop/src/i18n.tsx
  • apps/desktop/src/styles.css
  • apps/desktop/src/utils/sessionStatus.test.ts
  • apps/desktop/src/utils/sessionStatus.ts
🚧 Files skipped from review as they are similar to previous changes (4)
  • apps/desktop/src/utils/sessionStatus.ts
  • apps/desktop/src/utils/sessionStatus.test.ts
  • apps/desktop/src/i18n.tsx
  • apps/desktop/src/components/TranscriptView.tsx

📝 Walkthrough

Walkthrough

The PR expands NoteActivity and session-derived transcript states (adds degraded, transcribing, recoverable), updates activity resolution and UI rendering to use session status, introduces transcript status UI/components and translations, and updates styles and tests to cover the new states.

Changes

Transcript Session State Management

Layer / File(s) Summary
Type Definitions
apps/desktop/src/types.ts
NoteActivity union expanded to include "degraded", "transcribing", and "recoverable".
Session State Utilities
apps/desktop/src/utils/sessionStatus.ts
New transcriptScreenForNote and exported types map AppSessionStatus + flags to TranscriptScreenState (kind, tone, canRetry, showTranscript, action). Helper constructors centralize screen creation.
Activity Resolution
apps/desktop/src/utils/captureActivity.ts
activityForNote signature now accepts optional sessionStatus; resolves activity first from active-note captureState, then from sessionStatus.state for non-active notes (records degraded/transcribing/recoverable/failed/finalizing).
Activity Indicator Expansion
apps/desktop/src/components/NoteActivityIndicator.tsx
Renders new UI branches for "degraded", "recoverable", and "transcribing" with distinct labels and indicator elements; preserves failed and finalizing fallback.
Transcript View Refactor
apps/desktop/src/components/TranscriptView.tsx
Derives screen via transcriptScreenForNote; conditionally renders transcript segments or new TranscriptStatusPanel; adds transcriptStatusContent to map screen kinds to localized title/body and tone-aware iconography; header retry/regenerate button gated by screen state.
Sidebar Integration
apps/desktop/src/components/Sidebar.tsx
Passes note.sessionStatus into activityForNote when computing NoteActivity for list items.
Styling & Theming
apps/desktop/src/styles.css
Adds .on-air-dot.degraded, .progress-ring.transcribing, .note-activity-recoverable, .transcript-action-button.primary, and a .transcript-status layout with icon/title/body/action and warning/danger icon variants.
Internationalization
apps/desktop/src/i18n.tsx
Extends I18nKey and translations with transcript.status.* keys (completedEmpty/degraded/empty/failed/finalizing/recording/recoverable/transcribing) and `activity.degraded
Tests
apps/desktop/src/utils/captureActivity.test.ts, apps/desktop/src/utils/sessionStatus.test.ts
Updates captureActivity tests (expect degraded) and adds tests validating activityForNote fallback to persisted session status; adds sessionStatus.test.ts suite validating transcriptScreenForNote mappings and empty-note behaviors.

Sequence Diagram

sequenceDiagram
    participant User
    participant Sidebar as Sidebar
    participant ActivityUtils as captureActivity
    participant NoteActivity as NoteActivityIndicator
    participant TranscriptView
    participant SessionStatus as sessionStatus Utils
    participant UI as UI Rendering

    User->>Sidebar: note (id, captureState, sessionStatus)
    Sidebar->>ActivityUtils: activityForNote(id, activeId, captureState, sessionStatus)
    ActivityUtils-->>ActivityUtils: resolve from active captureState or sessionStatus.state
    ActivityUtils-->>Sidebar: NoteActivity (degraded/transcribing/etc.)
    Sidebar->>NoteActivity: render activity indicator
    NoteActivity->>UI: show dot/progress/alert

    Sidebar->>TranscriptView: open note (sessionStatus, hasTranscript, isGenerating)
    TranscriptView->>SessionStatus: transcriptScreenForNote(sessionStatus, hasTranscript, hasRecording, isGenerating)
    SessionStatus-->>TranscriptView: TranscriptScreenState (kind,tone,canRetry,showTranscript,action)
    alt showTranscript true
        TranscriptView->>UI: render transcript segments
    else
        TranscriptView->>UI: render TranscriptStatusPanel (icon,title,body,action)
    end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~22 minutes

Poem

🐰 New states hop into the light,
Degraded, transcribing through the night.
Status panels bloom with care,
Retry and rings now brightly flare,
Translations sing — the UI’s right.


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Review rate limit: 1/3 review remaining, refill in 29 minutes and 7 seconds.

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request enhances the transcript and recording status UI by introducing new activity states such as 'degraded', 'recoverable', and 'transcribing', along with a dedicated status panel in the transcript view. The changes include updated utility functions, expanded translation keys, and new styling for these states. Feedback highlights a missing CSS variable (--agent-blue), redundant logic in the session status utility, and the need for icon consistency using 'CircleAlert'. Additionally, it is recommended to centralize the logic for determining retry labels to improve maintainability.

Comment thread apps/desktop/src/styles.css Outdated
Comment thread apps/desktop/src/utils/sessionStatus.ts Outdated
Comment thread apps/desktop/src/components/TranscriptView.tsx Outdated
Comment thread apps/desktop/src/components/TranscriptView.tsx Outdated
Comment thread apps/desktop/src/components/TranscriptView.tsx Outdated
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c0b685c25d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread apps/desktop/src/utils/sessionStatus.ts Outdated
Comment thread apps/desktop/src/components/TranscriptView.tsx
@qyinm qyinm merged commit 19df4d6 into main May 4, 2026
2 checks passed
@qyinm qyinm deleted the session-recovery-ux branch May 4, 2026 04:23
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