Skip to content

feat(desktop): add Set Icon to the folder tab row context menu - #2150

Merged
h4yfans merged 1 commit into
mainfrom
feat/folder-tab-set-icon
Sep 11, 2026
Merged

feat(desktop): add Set Icon to the folder tab row context menu#2150
h4yfans merged 1 commit into
mainfrom
feat/folder-tab-set-icon

Conversation

@h4yfans

@h4yfans h4yfans commented Sep 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

Closes #1985.

Opening a folder as a tab is the one icon path the reporter of #1984 found reliable, but the right-click menu on a note row there had no icon entry, so that path was not reachable from where they reached for it.

  • Set Icon (and Remove Icon, only when the row already has one) in row-context-menu.tsx, gated on isNote like the other note-only actions, so task and inbox rows under tag scope never offer it.
  • New updateNoteIcon(noteId, emoji) in useFolderView, a direct mirror of the existing updateNoteTags: optimistic cache write, notesService.update, rollback + toast on failure.
  • Threaded as onSetIcon through FolderTableView and GroupedTable — the two views that have a row context menu at all.

Assumptions, for review:

  • The picker is hosted in a centred Dialog, not the usual popover. IconPickerButton needs a visible trigger to anchor to; a context menu has none, and the row itself spans the whole table so anchoring to it puts the panel at the far edge. A centred dialog also cannot land off screen, which is the property the reporter asked for. The shared EmojiPicker is reused as-is in embedded mode — no icon logic is duplicated.
  • No new i18n strings for the menu items. notes:tree.actions.setIcon / removeIcon already exist and are translated in all 32 locales; the sidebar tree uses the same two. Only one genuinely new key was needed, phaseI.toasts.failedToUpdateIcon, added and translated across all 32.
  • List and gallery views are untouched: they have no row context menu at all, so wiring one there is a separate change.

Release note

Right-click a note row in a folder opened as a tab to set or remove its icon.

Test plan

  • pnpm lint
  • pnpm typecheck (incl. check:contracts, check:architecture, ipc:check — all up to date, no contract changes)
  • pnpm --filter @memry/desktop test:renderer — 730 files, 9003 tests green
  • New unit tests: row-context-menu.test.tsx (Set Icon opens the picker and writes the pick back; Remove Icon only when the row has an icon, and clears it; both hidden for non-note rows and when no handler is wired), use-folder-view.test.tsx (updateNoteIcon hits notesService.update with emoji, and rolls back with a toast on failure)
  • pnpm --filter @memry/desktop i18n:check
  • pnpm docs:impact --base origin/main --strict + pnpm docs:build

No E2E: the existing folder-view.e2e.ts suite cannot reach a folder tab in this local environment — its beforeEach never gets past navigateTo(page, 'notes') and T124 fails identically on main. Rather than land a spec I could not actually run, the behavior is covered by unit tests. Worth a separate look at why that suite only works in CI.

🤖 Generated with Claude Code

Closes #1985.

Right-clicking a note row in a folder-opened-as-tab had no way to change
the note's icon, so the one icon path the reporter of #1984 found reliable
was not reachable from where they reached for it.

Adds Set Icon (and Remove Icon, when the row already has one) to that menu,
backed by a new optimistic `updateNoteIcon` in `useFolderView` that mirrors
`updateNoteTags`. The shared EmojiPicker is reused as-is; it is hosted in a
centred dialog because a context menu has no stable element to anchor a
popover to.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@h4yfans
h4yfans marked this pull request as ready for review September 11, 2026 00:11
@github-actions github-actions Bot added documentation Improvements or additions to documentation enhancement New feature or request test labels Sep 11, 2026
@github-actions

Copy link
Copy Markdown

React Doctor found 2 new issues in 2 files · 2 warnings · score 83 / 100 (Needs work) · 2 fixed · vs main

2 warnings

src/renderer/src/components/folder-view/grouped-table.tsx

  • ⚠️ L308 React function has high control-flow complexity no-high-complexity-react-function

src/renderer/src/pages/folder-view.tsx

  • ⚠️ L86 React function has high control-flow complexity no-high-complexity-react-function

Reviewed by React Doctor for commit fdfefd7. See inline comments for fixes.

@h4yfans
h4yfans merged commit 3f4505c into main Sep 11, 2026
15 of 16 checks passed
@codecov

codecov Bot commented Sep 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 90.24390% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...er/src/components/folder-view/row-context-menu.tsx 90.90% 2 Missing ⚠️
...pps/desktop/src/renderer/src/pages/folder-view.tsx 0.00% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request test

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Add "Set Icon" to the right-click menu of a note row in a folder-opened-as-tab

1 participant