feat(web): add optional memo quick action buttons#6086
Conversation
📝 WalkthroughWalkthroughChangesMemo quick actions
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (4)
web/src/components/MemoView/components/MemoHeader.tsxweb/src/components/MemoView/components/MemoQuickActions.tsxweb/src/components/Settings/PreferencesSection.tsxweb/src/locales/en.json
| <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> |
There was a problem hiding this comment.
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.
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
MemoQuickActionscomponent.MemoHeaderwhile preserving the existing overflow menu.Behaviour
Testing
pnpm lintpnpm build