Skip to content

feat(web): add optional memo quick action buttons#6086

Open
RitheshKumar26 wants to merge 1 commit into
usememos:mainfrom
RitheshKumar26:main
Open

feat(web): add optional memo quick action buttons#6086
RitheshKumar26 wants to merge 1 commit into
usememos:mainfrom
RitheshKumar26:main

Conversation

@RitheshKumar26

Copy link
Copy Markdown

Closes #6055

Summary

Adds optional quick-action buttons (pin, edit, archive, delete) that appear on hover over memo cards. The feature is disabled by default and can be enabled from Settings → Preferences → Behavior.

Changes

  • Added a new MemoQuickActions component.
  • Integrated quick actions into MemoHeader while preserving the existing overflow menu.
  • Added a "Behavior" preference for enabling/disabling quick action buttons.
  • Added localization strings for the new preference.
  • Reused existing memo action handlers instead of duplicating action logic.

Behaviour

  • Disabled by default.
  • Only shown when the preference is enabled.
  • Hidden for readonly users.
  • Matches existing visibility rules for comment memos.
  • Delete uses the existing confirmation dialog.

Testing

  • Ran pnpm lint
  • Ran pnpm build
  • Verified quick action buttons appear after enabling the preference.
  • Verified pin, edit, archive, and delete actions work correctly.
  • Verified disabling the preference restores the previous behavior.

@RitheshKumar26
RitheshKumar26 requested a review from a team as a code owner July 12, 2026 17:09
@coderabbitai

coderabbitai Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

Changes

Memo quick actions

Layer / File(s) Summary
Quick-action controls
web/src/components/MemoView/components/MemoQuickActions.tsx
Adds configurable pin, edit, archive, restore, and delete controls with memo-state handling and delete confirmation.
Memo header integration
web/src/components/MemoView/components/MemoHeader.tsx
Replaces the existing action menu with MemoQuickActions while preserving its props.
Preference configuration
web/src/components/Settings/PreferencesSection.tsx, web/src/locales/en.json
Adds persisted quick-action state, a behavior switch, and English preference text.
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: optional memo quick action buttons.
Description check ✅ Passed The description matches the implemented feature and summarizes the changes accurately.
Linked Issues check ✅ Passed The PR satisfies #6055 by adding optional, preference-controlled memo action buttons that are off by default.
Out of Scope Changes check ✅ Passed The changes stay within the requested memo quick-actions feature and related settings/localization updates.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

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.

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@web/src/components/MemoView/components/MemoQuickActions.tsx`:
- Around line 35-92: Add accessible aria-label values to all four icon-only
Buttons in the MemoQuickActions action group: use the existing translated action
text for pin/unpin, edit, archive/restore, and delete. Keep the labels dynamic
where the button action changes based on memo.pinned or isArchived.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 520f7d38-be32-47e9-a335-c06baecc265a

📥 Commits

Reviewing files that changed from the base of the PR and between a9fcd45 and cf64daa.

📒 Files selected for processing (4)
  • web/src/components/MemoView/components/MemoHeader.tsx
  • web/src/components/MemoView/components/MemoQuickActions.tsx
  • web/src/components/Settings/PreferencesSection.tsx
  • web/src/locales/en.json

Comment on lines +35 to +92
<div className="hidden sm:group-hover:flex items-center gap-0.5">
{!isComment && !isArchived && (
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Button variant="ghost" size="icon" className="size-6" onClick={handleTogglePinMemoBtnClick}>
{memo.pinned ? (
<BookmarkMinusIcon className="w-4 h-auto text-muted-foreground" />
) : (
<BookmarkPlusIcon className="w-4 h-auto text-muted-foreground" />
)}
</Button>
</TooltipTrigger>
<TooltipContent>{memo.pinned ? t("common.unpin") : t("common.pin")}</TooltipContent>
</Tooltip>
</TooltipProvider>
)}

{!isArchived && (
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Button variant="ghost" size="icon" className="size-6" onClick={handleEditMemoClick}>
<Edit3Icon className="w-4 h-auto text-muted-foreground" />
</Button>
</TooltipTrigger>
<TooltipContent>{t("common.edit")}</TooltipContent>
</Tooltip>
</TooltipProvider>
)}

{!isComment && (
<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Button variant="ghost" size="icon" className="size-6" onClick={handleToggleMemoStatusClick}>
{isArchived ? (
<ArchiveRestoreIcon className="w-4 h-auto text-muted-foreground" />
) : (
<ArchiveIcon className="w-4 h-auto text-muted-foreground" />
)}
</Button>
</TooltipTrigger>
<TooltipContent>{isArchived ? t("common.restore") : t("common.archive")}</TooltipContent>
</Tooltip>
</TooltipProvider>
)}

<TooltipProvider>
<Tooltip>
<TooltipTrigger asChild>
<Button variant="ghost" size="icon" className="size-6" onClick={handleDeleteMemoClick}>
<TrashIcon className="w-4 h-auto text-muted-foreground" />
</Button>
</TooltipTrigger>
<TooltipContent>{t("common.delete")}</TooltipContent>
</Tooltip>
</TooltipProvider>

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.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Add aria-label to icon-only buttons for screen reader accessibility.

All four action buttons contain only icons with no text or aria-label. Radix Tooltip sets aria-describedby (a description), not aria-label (the accessible name). Screen readers will announce "button" without identifying the action, failing WCAG 4.1.2.

[accessibility]

♿ Proposed fix: add `aria-label` to each button
                 <Button variant="ghost" size="icon" className="size-6" onClick={handleTogglePinMemoBtnClick}>
+                  aria-label={memo.pinned ? t("common.unpin") : t("common.pin")}
                   {memo.pinned ? (
                 <Button variant="ghost" size="icon" className="size-6" onClick={handleEditMemoClick}>
+                  aria-label={t("common.edit")}
                   <Edit3Icon className="w-4 h-auto text-muted-foreground" />
                 <Button variant="ghost" size="icon" className="size-6" onClick={handleToggleMemoStatusClick}>
+                  aria-label={isArchived ? t("common.restore") : t("common.archive")}
                   {isArchived ? (
                 <Button variant="ghost" size="icon" className="size-6" onClick={handleDeleteMemoClick}>
+                  aria-label={t("common.delete")}
                   <TrashIcon className="w-4 h-auto text-muted-foreground" />
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@web/src/components/MemoView/components/MemoQuickActions.tsx` around lines 35
- 92, Add accessible aria-label values to all four icon-only Buttons in the
MemoQuickActions action group: use the existing translated action text for
pin/unpin, edit, archive/restore, and delete. Keep the labels dynamic where the
button action changes based on memo.pinned or isArchived.

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.

[Feature Request] Add UI buttons

1 participant