Skip to content

fix(meetings): Copy notes copies the open template report, not the Standard note#318

Open
Optic00 wants to merge 3 commits into
ruzin:mainfrom
Optic00:fix/copy-notes-active-report
Open

fix(meetings): Copy notes copies the open template report, not the Standard note#318
Optic00 wants to merge 3 commits into
ruzin:mainfrom
Optic00:fix/copy-notes-active-report

Conversation

@Optic00

@Optic00 Optic00 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator

Problem

With a generated template report open in MeetingDetail, the header "Copy notes" action still copied the Standard structured note. The clipboard silently disagreed with what was on screen.

Fix

  • Extract the clipboard builder into app/renderer/src/lib/notesCopy.ts (pure, unit-tested): when a report is open it copies title + date/duration + that report's markdown; otherwise the Standard sections exactly as before (byte-identical output for the standard path).
  • Disable "Copy notes" while a summary/report stream is on screen (streamPhase !== 'idle', all transient states) — same bug class: the body shows in-flux streamed text while the clipboard would get the old note.

Coverage

  • Vitest unit tests for buildNotesCopyText (standard path, report path, empty-section omission, whitespace-only report).
  • New T1 e2e spec copy-notes-report.t1.spec.ts driving the real pill switch + Copy notes action against a seeded meeting carrying a report. New STENOAI_E2E_SEED_REPORT seam in the mock IPC (env-gated so transcript-export.t1 keeps its report-less meeting), with a stateful set-active-report mock so the pill switch survives the post-mutation refetch like the real sidecar.

Full T1 suite 19/19, vitest 78/78, typecheck + lint clean.

Not changed (by design)

Template reports intentionally live in the <stem>_reports.json sidecar, not as standalone .md files (src/report_store.py) — "view containing folder" not showing a report md is the designed storage model, out of scope here.


Summary by cubic

Fixes “Copy notes” to copy the open template report (not always the Standard note), strips hidden reasoning blocks, and disables the action while streaming to avoid stale copies.

  • Bug Fixes

    • Copies title + date/duration + the active report’s markdown; otherwise falls back to the Standard structured note.
    • Strips reasoning blocks (e.g., ) from both Standard summaries and report content before copying, matching what’s rendered.
    • Disables “Copy notes” when streamPhase !== 'idle' to prevent clipboard/display mismatches.
  • Refactors

    • Extracted builder to app/renderer/src/lib/notesCopy.ts with unit tests.
    • Added e2e spec copy-notes-report.t1.spec.ts; mock IPC now supports STENOAI_E2E_SEED_REPORT and a stateful set-active-report (seeded report includes a block to verify stripping).

Written for commit 37926a7. Summary will update on new commits.

Review in cubic

@Optic00

Optic00 commented Jul 6, 2026

Copy link
Copy Markdown
Collaborator Author

Heads-up on overlap with #317: that PR's latest revision also touches copyNotes (stripping reasoning blocks from the copied summary). This PR already incorporates that behaviour for both copy sources (Standard summary and open report content), so if #317 merges first the MeetingDetail.tsx conflict resolves by taking this branch's copyNotes; if this merges first, #317's copyNotes hunk becomes redundant. Details in #317 (comment).

@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.

1 issue found and verified against the latest diff

Prompt for AI agents (unresolved issues)

Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.


<file name="app/renderer/src/routes/MeetingDetail.tsx">

<violation number="1" location="app/renderer/src/routes/MeetingDetail.tsx:498">
P2: Copy notes can show a false success state when clipboard write fails, because the handler marks `copied` immediately instead of after a successful write. Matching the transcript copy pattern (or chaining `.then`) would keep feedback aligned with actual clipboard outcome.</violation>
</file>

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

Re-trigger cubic

},
activeReport ? { content: stripReasoning(activeReport.content) } : null,
);
void navigator.clipboard.writeText(text);

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.

P2: Copy notes can show a false success state when clipboard write fails, because the handler marks copied immediately instead of after a successful write. Matching the transcript copy pattern (or chaining .then) would keep feedback aligned with actual clipboard outcome.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At app/renderer/src/routes/MeetingDetail.tsx, line 496:

<comment>Copy notes can show a false success state when clipboard write fails, because the handler marks `copied` immediately instead of after a successful write. Matching the transcript copy pattern (or chaining `.then`) would keep feedback aligned with actual clipboard outcome.</comment>

<file context>
@@ -474,36 +475,25 @@ function DetailContent({ meeting }: { meeting: Meeting }) {
+      },
+      activeReport,
+    );
+    void navigator.clipboard.writeText(text);
     setCopied(true);
     setTimeout(() => setCopied(false), 2000);
</file context>

Optic00 added 3 commits July 6, 2026 20:20
… the Standard note

copyNotes built the clipboard payload from the Standard structured fields
unconditionally, so with a generated template report on screen the copy
silently disagreed with the displayed note. Extract the builder into
lib/notesCopy.ts (pure, unit-tested) and route it through the component's
activeReport: report open -> title + meta + the report's markdown,
otherwise the Standard sections as before.

Coverage: vitest unit tests for the builder + a T1 e2e spec driving the
real pill switch and Copy notes action against a seeded meeting carrying
a report (new STENOAI_E2E_SEED_REPORT seam in the mock IPC, gated so
transcript-export.t1 keeps its report-less meeting).
- Disable Copy notes while a summary/report stream is on screen (all
  non-idle phases are transient in-flux states) so the clipboard can't
  get the old note while the body shows streamed text (Codex finding).
- Make the mock IPC's set-active-report stateful for the seeded report
  so the pill switch survives the post-mutation refetch like the real
  sidecar does, keeping the T1 spec faithful rather than relying on the
  re-sync effect's unchanged-dep skip.
Align the copy paths with the rendered views (and with ruzin#317, which makes
the report view render stripReasoning'd content): both the Standard
summary and an open report's markdown are stripped before hitting the
clipboard. Seeded T1 report now carries a leading <think> block and the
spec asserts it never reaches the clipboard.
@Optic00 Optic00 force-pushed the fix/copy-notes-active-report branch from a067e89 to 37926a7 Compare July 6, 2026 18: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.

2 participants