Skip to content

Introduce 3 dots menu to notes - #60

Merged
koreyba merged 3 commits into
stagefrom
features/improve-ui-rag
Mar 3, 2026
Merged

Introduce 3 dots menu to notes#60
koreyba merged 3 commits into
stagefrom
features/improve-ui-rag

Conversation

@koreyba

@koreyba koreyba commented Mar 3, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

Release Notes

  • New Features

    • Added delete note functionality accessible via the More actions menu.
  • UI/UX Improvements

    • Consolidated RAG indexing controls and WordPress export options into a "More actions" dropdown menu, reducing visual clutter and providing a more streamlined interface experience.

@coderabbitai

coderabbitai Bot commented Mar 3, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This pull request refactors the notes UI by replacing inline action buttons with a "More actions" dropdown menu. The changes consolidate WordPress export, RAG index controls, and note deletion into a single dropdown interface across the NoteEditor and NoteView components, supported by comprehensive test coverage using new Supabase mocking utilities.

Changes

Cohort / File(s) Summary
Test Suites - Dropdown Menu Refactoring
cypress/component/features/notes/NoteEditor.cy.tsx, cypress/component/features/notes/NoteView.cy.tsx
Replaced tests for inline Export to WP button with tests validating the new "More actions" dropdown menu. Added new Supabase stub helper and SupabaseTestProvider wrapping for WordPress export flow testing. Expanded coverage for menu visibility, delete options, and menu interactions across different note states.
RagIndexPanel Tests
cypress/component/features/notes/RagIndexPanel.cy.tsx
Introduced new test suite for RagIndexPanel rendered inside a DropdownMenu with variant="menu". Added helper mountMenuVariant for menu-based testing and tests covering indexed/non-indexed states, menu lifecycle callbacks (onMenuClose), and dropdown preservation during AlertDialog interactions.
Component - More Actions Menu Implementation
ui/web/components/features/notes/NoteEditor.tsx, ui/web/components/features/notes/NoteView.tsx
Replaced inline action buttons with "More actions" dropdown menu containing RagIndexPanel, WordPress export option, and (in NoteEditor) a new Delete note action. Added moreMenuOpen state management and onDelete callback prop to NoteEditor. Updated component signatures to support new menu-driven UI pattern.
RagIndexPanel Component Enhancement
ui/web/components/features/notes/RagIndexPanel.tsx
Extended component with variant prop ('inline' or 'menu') and onMenuClose callback for menu lifecycle management. Unified AlertDialog handling across both UI variants using shared confirmDialog constant. Menu variant renders actions as DropdownMenuItems with status indicators and loading states.
Notes Shell Integration
ui/web/components/features/notes/NotesShell.tsx
Updated NoteEditor usage to pass onDelete handler, wiring the delete action through the editor's new public API.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • Stage to dev (WP integration) #46 — Directly related; both PRs modify the same notes UI and test suite around moving the WordPress export flow into the "More actions" dropdown menu and adding Supabase test stubs.

Poem

A rabbit hops through menus organized,
Where "More actions" are now disguised,
Export and delete in one nested burrow,
No scattered buttons to cause such sorrow! 🐰
Drop down the menu, so clean and divine,
RAG, WP, and delete—they align!

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 20.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: introducing a 3 dots (context) menu to notes, which aligns with the substantial refactoring across multiple note-related components.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch features/improve-ui-rag

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

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

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Mar 3, 2026

Copy link
Copy Markdown

Deploying everfreenote with  Cloudflare Pages  Cloudflare Pages

Latest commit: caefee4
Status: ✅  Deploy successful!
Preview URL: https://1519a541.everfreenote.pages.dev
Branch Preview URL: https://features-improve-ui-rag.everfreenote.pages.dev

View logs

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

Copy link
Copy Markdown

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: 036875cc09

ℹ️ 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".

AI index: {statusText()}
</DropdownMenuLabel>
<DropdownMenuItem
onClick={() => void handleIndex()}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Keep index action stateful across menu close

In menu mode this item triggers indexing via onClick without preventing the dropdown’s default close behavior, so DropdownMenuContent unmounts immediately and RagIndexPanel loses its operation state while the network call is still running; users can reopen the menu and fire multiple concurrent rag-index requests against the same note, which wastes embedding quota and can race status updates. The adjacent delete-item comment already documents this unmount behavior, so index should use the same mounted-state strategy (or lift pending state out of the menu content).

Useful? React with 👍 / 👎.

>
<Trash2 className="w-4 h-4 mr-2" />
Delete
<span className="hidden sm:inline">Delete</span>

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Add accessible name to mobile delete button

This change hides the only visible text label on small screens (hidden sm:inline) but does not add an aria-label to the button, so at mobile breakpoints the destructive delete action becomes an icon-only control with no accessible name for screen-reader users.

Useful? React with 👍 / 👎.

@koreyba

koreyba commented Mar 3, 2026

Copy link
Copy Markdown
Owner Author

@CodeRabbit it's time to review

@coderabbitai

coderabbitai Bot commented Mar 3, 2026

Copy link
Copy Markdown

@koreyba: Sure! I'll start reviewing the PR now. 🐰

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
ui/web/components/features/notes/NoteEditor.tsx (1)

193-227: Consider extracting a shared “More actions” menu composition.

This block now mirrors the menu structure in ui/web/components/features/notes/NoteView.tsx (RAG panel + optional WP export + separators). A shared subcomponent would reduce UI drift and test duplication over time.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ui/web/components/features/notes/NoteEditor.tsx` around lines 193 - 227, The
More actions menu is duplicated between NoteEditor and NoteView; extract a
shared component (e.g., MoreActionsMenu) that encapsulates the DropdownMenu
composition and accepts props for noteId, moreMenuOpen/setMoreMenuOpen state
handlers, getExportNote, handleExportRequest, wordpressConfigured, onDelete, and
variant/trigger options; replace the inline menu in NoteEditor (and the
duplicate in NoteView) with <MoreActionsMenu .../> passing RagIndexPanel and
ExportToWordPressButton behavior via these props so separators and conditional
rendering remain identical and tests can target the single component.
cypress/component/features/notes/NoteView.cy.tsx (1)

7-48: Extract the WordPress Supabase mock into a shared test helper.

createSupabaseForExportDialog duplicates logic also present in cypress/component/features/notes/NoteEditor.cy.tsx (Line 27-68). Moving this into a shared Cypress utility will reduce fixture drift across note-view/editor tests.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@cypress/component/features/notes/NoteView.cy.tsx` around lines 7 - 48,
createSupabaseForExportDialog duplicates the WordPress Supabase mock used in
NoteEditor tests; extract this factory into a shared Cypress test helper (e.g.,
export a createSupabaseForExportDialog function from a new utils module) and
replace the inline mock in NoteView.cy.tsx and NoteEditor.cy.tsx with an import
from that helper so both tests reuse the same implementation; ensure the helper
exports the same shape (returns { supabase, invoke }) and update both test files
to import and call the shared createSupabaseForExportDialog, removing the
duplicated inline code.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@cypress/component/features/notes/NoteView.cy.tsx`:
- Around line 7-48: createSupabaseForExportDialog duplicates the WordPress
Supabase mock used in NoteEditor tests; extract this factory into a shared
Cypress test helper (e.g., export a createSupabaseForExportDialog function from
a new utils module) and replace the inline mock in NoteView.cy.tsx and
NoteEditor.cy.tsx with an import from that helper so both tests reuse the same
implementation; ensure the helper exports the same shape (returns { supabase,
invoke }) and update both test files to import and call the shared
createSupabaseForExportDialog, removing the duplicated inline code.

In `@ui/web/components/features/notes/NoteEditor.tsx`:
- Around line 193-227: The More actions menu is duplicated between NoteEditor
and NoteView; extract a shared component (e.g., MoreActionsMenu) that
encapsulates the DropdownMenu composition and accepts props for noteId,
moreMenuOpen/setMoreMenuOpen state handlers, getExportNote, handleExportRequest,
wordpressConfigured, onDelete, and variant/trigger options; replace the inline
menu in NoteEditor (and the duplicate in NoteView) with <MoreActionsMenu .../>
passing RagIndexPanel and ExportToWordPressButton behavior via these props so
separators and conditional rendering remain identical and tests can target the
single component.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6702cc3 and 5879772.

📒 Files selected for processing (7)
  • cypress/component/features/notes/NoteEditor.cy.tsx
  • cypress/component/features/notes/NoteView.cy.tsx
  • cypress/component/features/notes/RagIndexPanel.cy.tsx
  • ui/web/components/features/notes/NoteEditor.tsx
  • ui/web/components/features/notes/NoteView.tsx
  • ui/web/components/features/notes/NotesShell.tsx
  • ui/web/components/features/notes/RagIndexPanel.tsx

@koreyba
koreyba merged commit 913922e into stage Mar 3, 2026
8 checks passed
@koreyba
koreyba deleted the features/improve-ui-rag branch March 3, 2026 22:47
@coderabbitai coderabbitai Bot mentioned this pull request Apr 29, 2026
@coderabbitai coderabbitai Bot mentioned this pull request Jul 16, 2026
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