Skip to content

new search/replace bar + added pre meeting notes #972

Merged
yujonglee merged 10 commits intofastrepl:fix-duckfrom
duckduckhero:fix-duck-0618
Jun 20, 2025
Merged

new search/replace bar + added pre meeting notes #972
yujonglee merged 10 commits intofastrepl:fix-duckfrom
duckduckhero:fix-duck-0618

Conversation

@duckduckhero
Copy link
Contributor

No description provided.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 18, 2025

📝 Walkthrough

Walkthrough

This change introduces support for "Pre Meeting Notes" in the note enhancement workflow. It adds a new preMeetingNote parameter to relevant hooks and components, updates templates to incorporate this data, and implements store logic to persist and update pre-meeting notes. The transcript search UI is refactored, replacing an inline panel with a new SearchHeader component.

Changes

File(s) Change Summary
apps/desktop/src/components/editor-area/index.tsx Added preMeetingNote parameter to useEnhanceMutation and its usage in EditorArea.
apps/desktop/src/components/right-panel/components/search-header.tsx Introduced new exported SearchHeader component for search and replace UI.
apps/desktop/src/components/right-panel/views/transcript-view.tsx Removed SearchAndReplace component; integrated SearchHeader; updated search state and header rendering.
crates/template/assets/enhance.system.jinja Updated system prompt to describe "Pre Meeting Note" input and its role in enhancement.
crates/template/assets/enhance.user.jinja Added <pre_meeting_note> tag to include pre-meeting note in user message template.
packages/utils/src/stores/ongoing-session.ts Enhanced start method to persist and update pre-meeting note if present.
packages/utils/src/stores/session.ts Added updatePreMeetingNote method to session store actions and implementation.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant EditorArea
    participant useEnhanceMutation
    participant LanguageModel
    participant SessionStore

    User->>EditorArea: Trigger Enhance
    EditorArea->>useEnhanceMutation: Call with preMeetingNote
    useEnhanceMutation->>LanguageModel: Send user message (includes preEditor/preMeetingNote)
    LanguageModel-->>useEnhanceMutation: Return enhanced note
    useEnhanceMutation-->>EditorArea: Update UI with result
Loading
sequenceDiagram
    participant User
    participant TranscriptView
    participant SearchHeader
    participant EditorRef

    User->>TranscriptView: Press Ctrl+F / Cmd+F
    TranscriptView->>SearchHeader: Render with editorRef
    User->>SearchHeader: Enter search/replace terms, navigate results
    SearchHeader->>EditorRef: Update search/replace state and perform actions
    User->>SearchHeader: Click close or press Escape
    SearchHeader->>TranscriptView: Call onClose, hide search UI
Loading

Possibly related PRs

  • fastrepl/hyprnote#935: Modifies useEnhanceMutation to accept an onSuccess callback for auto title generation. Both PRs modify the same hook and component, focusing on different parameters and behaviors.
  • fastrepl/hyprnote#946: Adds backend support for storing and handling the pre_meeting_memo_html field in sessions. This PR builds on those backend changes to utilize the pre-meeting note data in the frontend enhancement flow.
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

‼️ IMPORTANT
Auto-reply has been disabled for this repository in the CodeRabbit settings. The CodeRabbit bot will not respond to your replies unless it is explicitly tagged.

  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@yujonglee
Copy link
Contributor

@coderabbitai review

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jun 18, 2025

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Nitpick comments (7)
packages/utils/src/stores/session.ts (1)

53-61: Implementation mirrors existing update-helpers – consider minor DRY refactor

The new block works, but you now have three nearly-identical setters (updatePreMeetingNote, updateRawNote, updateEnhancedNote). A tiny utility like makeFieldUpdater<'pre_meeting_memo_html' | 'raw_memo_html' | 'enhanced_memo_html'>(key) could cut the boilerplate and ensure future tweaks (e.g. throttling strategy) stay consistent.

crates/template/assets/enhance.system.jinja (1)

21-23: Fix typos in the new Pre-Meeting-Note section

Minor spelling issues hurt polish:

-Therefore, it is liekly to contain information that user wants to learn from the meeting (interview questions, decisiont to be made, etc.)
+Therefore, it is likely to contain information the user wants to learn from the meeting (interview questions, decisions to be made, etc.)
-However, the main focus should alwyas be the raw note as that was written during the actual meeting.
+However, the main focus should always be the raw note because it was written during the actual meeting.
apps/desktop/src/components/right-panel/components/search-header.tsx (2)

21-36: Clean-up the debounced callback on unmount

useDebouncedCallback returns a function that can be cancelled.
Cancelling in useEffect’s clean-up guards against the “state update on unmounted component” warning when the panel is closed quickly.

  const debouncedSetSearchTerm = useDebouncedCallback(
    (value: string) => { … },
    [editorRef],
    300,
  );

+  useEffect(() => () => debouncedSetSearchTerm.cancel?.(), []);

50-58: Stale handleClose reference inside outside-click listener

handleClose is re-created every render, but the effect installs the listener only once, meaning the listener will always call the first version. Wrap handleClose in useCallback and list it in the dependency array, or inline the logic to avoid the stale closure edge-case.

apps/desktop/src/components/right-panel/views/transcript-view.tsx (1)

85-94: Suppress the browser’s default find dialog

When running in a hybrid (Tauri/Electron) shell the native Ctrl/Cmd-F may still appear. Prevent the default to guarantee only the custom search bar opens:

-      if ((e.ctrlKey || e.metaKey) && e.key === "f") {
+      if ((e.ctrlKey || e.metaKey) && e.key === "f") {
+        e.preventDefault();
apps/desktop/src/components/editor-area/index.tsx (1)

225-228: Verify HTML→prompt sanitisation.

preMeetingNote (HTML) is injected into the prompt as preEditor.
If the LLM prompt expects markdown, consider converting or stripping tags to avoid extra tokens / hallucinations.

packages/utils/src/stores/ongoing-session.ts (1)

58-60: Remove stray debug log.

console.log("start", sessionId); will leak internal IDs in prod logs and violates the “why-not-what” comment guideline.

-      console.log("start", sessionId);
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f2242af and c40f030.

📒 Files selected for processing (7)
  • apps/desktop/src/components/editor-area/index.tsx (3 hunks)
  • apps/desktop/src/components/right-panel/components/search-header.tsx (1 hunks)
  • apps/desktop/src/components/right-panel/views/transcript-view.tsx (6 hunks)
  • crates/template/assets/enhance.system.jinja (2 hunks)
  • crates/template/assets/enhance.user.jinja (1 hunks)
  • packages/utils/src/stores/ongoing-session.ts (2 hunks)
  • packages/utils/src/stores/session.ts (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
`**/*.{js,ts,tsx,rs}`: 1. No error handling. 2. No unused imports, variables, or functions. 3. For comments, keep it minimal. It should be about "Why", not "What".

**/*.{js,ts,tsx,rs}: 1. No error handling.
2. No unused imports, variables, or functions.
3. For comments, keep it minimal. It should be about "Why", not "What".

  • packages/utils/src/stores/session.ts
  • packages/utils/src/stores/ongoing-session.ts
  • apps/desktop/src/components/editor-area/index.tsx
  • apps/desktop/src/components/right-panel/components/search-header.tsx
  • apps/desktop/src/components/right-panel/views/transcript-view.tsx
🔇 Additional comments (3)
packages/utils/src/stores/session.ts (1)

17-18: updatePreMeetingNote correctly surfaced in the public actions type

Adding the action to the Actions interface keeps the public store contract consistent with the existing update*Note helpers.

crates/template/assets/enhance.user.jinja (1)

7-9: New <pre_meeting_note> tag looks good – inclusion order matches the system prompt, so downstream templates remain deterministic.

apps/desktop/src/components/editor-area/index.tsx (1)

172-180: Keep hook signature changes in sync across the codebase.

useEnhanceMutation now requires preMeetingNote. Make sure every call site (web / mobile / tests) has been updated, otherwise TypeScript compilation will fail or, worse, downstream code will silently pass an empty string.

#!/bin/bash
# Locate still-outdated invocations of useEnhanceMutation (expects 0 hits)
rg --fixed-strings "useEnhanceMutation({" -A3 | grep -v "preMeetingNote"

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