Skip to content

feat/web: add memo detail shortcut button - #6138

Open
howtoexitvim wants to merge 1 commit into
usememos:mainfrom
howtoexitvim:feature/memo-detail-shortcut-pr
Open

feat/web: add memo detail shortcut button#6138
howtoexitvim wants to merge 1 commit into
usememos:mainfrom
howtoexitvim:feature/memo-detail-shortcut-pr

Conversation

@howtoexitvim

Copy link
Copy Markdown

Summary

Adds a small hover quick action for opening a memo detail page directly from the memo header.

This uses an ArrowUpRight icon link next to the existing inline actions, visible on mobile and on memo hover for larger screens. It is intended as a lightweight shortcut for users who frequently jump from the feed into a memo detail view.

This is related to #6055, which asks for quicker inline memo actions without going through the overflow menu.

Changes

  • Add MemoDetailLinkButton to MemoHeader
  • Link the button to the memo detail route
  • Add a focused test for the generated detail link

Checks

  • ./node_modules/.bin/vitest run tests/memo-detail-link-button.test.tsx
  • pnpm lint
  • pnpm release

@coderabbitai

coderabbitai Bot commented Aug 2, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 05ec00eb-a562-46a3-91ea-e05ba12ebdc5

📥 Commits

Reviewing files that changed from the base of the PR and between 454ee66 and e84ff45.

📒 Files selected for processing (2)
  • web/src/components/MemoView/components/MemoHeader.tsx
  • web/tests/memo-detail-link-button.test.tsx

Walkthrough

Adds the exported MemoDetailLinkButton component to the memo header. The component renders conditionally outside the memo detail page with an accessible label, view-transition support, navigation state, and an arrow icon. Adds a routed test that verifies the /memos/abc123 destination and /explore originating page state.

Suggested reviewers: boojack, johnnyjoygh

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the new memo detail shortcut button.
Description check ✅ Passed The description directly explains the memo header quick action, routing behavior, test coverage, and related issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@howtoexitvim
howtoexitvim marked this pull request as ready for review August 2, 2026 13:21
@howtoexitvim
howtoexitvim requested a review from a team as a code owner August 2, 2026 13:21
Copilot AI review requested due to automatic review settings August 2, 2026 13:21
@greptile-apps

greptile-apps Bot commented Aug 2, 2026

Copy link
Copy Markdown

Greptile Summary

Adds a MemoDetailLinkButton shortcut in MemoHeader that links directly to a memo's detail page, visible on mobile and on hover for larger screens. The button correctly passes parentPage as router state and is suppressed when already on the detail page via the isInMemoDetailPage guard.

  • MemoDetailLinkButton is exported as a named export so the accompanying test can import it in isolation, and the test properly exercises both the generated href and the forwarded router state.
  • The aria-label is composed from \"attachment-library.actions.open\", a key scoped to a different feature namespace — a dedicated key would be safer as locales evolve.
  • The button is the only icon-only action in the header row without a <Tooltip>, making it harder for desktop users to discover its purpose.

Confidence Score: 5/5

Safe to merge — the button is correctly gated, navigation state is properly forwarded, and the change is isolated to a small new component with a test.

Both previously flagged issues are resolved: parentPage is forwarded as router state and the button is hidden on the detail page via the isInMemoDetailPage guard. The change is small, well-tested, and does not touch any critical paths.

Files Needing Attention: No files require special attention.

Important Files Changed

Filename Overview
web/src/components/MemoView/components/MemoHeader.tsx Adds MemoDetailLinkButton (exported) with correct parentPage state and isInMemoDetailPage guard; minor i18n key reuse and missing tooltip
web/tests/memo-detail-link-button.test.tsx New focused test verifying href and router state — correctly uses MemoryRouter + fireEvent to confirm navigation state is forwarded

Reviews (2): Last reviewed commit: "feat(web): add memo detail shortcut butt..." | Re-trigger Greptile

Copilot AI 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.

Pull request overview

This PR adds a small “open memo detail” shortcut in the memo header UI to let users jump directly to the memo detail route from a memo card, and introduces a unit test validating the generated link.

Changes:

  • Add a new MemoDetailLinkButton icon-link to MemoHeader that routes to /${memo.name}.
  • Show the button on mobile and on memo hover for larger screens via Tailwind responsive/hover classes.
  • Add a focused test to ensure the detail link href is generated correctly.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
web/src/components/MemoView/components/MemoHeader.tsx Adds the new memo detail shortcut button component and renders it in the header actions.
web/tests/memo-detail-link-button.test.tsx Adds a unit test asserting the shortcut link targets the correct memo detail URL.
Suppressed comments (1)

web/src/components/MemoView/components/MemoHeader.tsx:123

  • MemoDetailLinkButton should forward the "from" navigation context (derived from parentPage) into the Link's state so MemoDetail can retain navigation context (locationState?.from). Right now the button drops that state entirely.
export const MemoDetailLinkButton: React.FC<{ memoName: string }> = ({ memoName }) => (
  <Link
    aria-label="Open memo"
    className="h-6 w-6 flex sm:hidden sm:group-hover:flex justify-center items-center cursor-pointer transition-colors text-muted-foreground hover:text-foreground"
    to={`/${memoName}`}
    viewTransition
  >
    <ArrowUpRightIcon className="w-4 h-4" />
  </Link>

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

/>
)}

<MemoDetailLinkButton memoName={memo.name} />

export const MemoDetailLinkButton: React.FC<{ memoName: string }> = ({ memoName }) => (
<Link
aria-label="Open memo"
Comment thread web/src/components/MemoView/components/MemoHeader.tsx Outdated
Comment thread web/src/components/MemoView/components/MemoHeader.tsx Outdated

@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: 2

🤖 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/MemoHeader.tsx`:
- Line 117: Update the accessible name in MemoHeader to use the existing
useTranslate hook and an appropriate translation key instead of hard-coded “Open
memo” text. Add or reuse the corresponding localized string, then update
memo-detail-link-button.test.tsx to assert the translated accessible name.
- Line 118: Update the MemoHeader link className using the existing cn() helper:
replace the sm:hidden display behavior with opacity-based hiding that preserves
keyboard focusability, and reveal it on both sm:group-hover and
sm:focus-visible. Split the classes into Biome-formatted lines within the
140-character limit while preserving the existing styling and interaction
classes.
🪄 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 Plus

Run ID: b47c594d-e494-4518-af38-b93b6a010b85

📥 Commits

Reviewing files that changed from the base of the PR and between 156ee7e and 454ee66.

📒 Files selected for processing (2)
  • web/src/components/MemoView/components/MemoHeader.tsx
  • web/tests/memo-detail-link-button.test.tsx


export const MemoDetailLinkButton: React.FC<{ memoName: string }> = ({ memoName }) => (
<Link
aria-label="Open memo"

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.

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Localize the accessible name.

aria-label="Open memo" is hard-coded in English, while MemoHeader already uses useTranslate. In other locales, screen readers receive English text. Use a translation key and update web/tests/memo-detail-link-button.test.tsx to assert the localized name.

🤖 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/MemoHeader.tsx` at line 117, Update
the accessible name in MemoHeader to use the existing useTranslate hook and an
appropriate translation key instead of hard-coded “Open memo” text. Add or reuse
the corresponding localized string, then update memo-detail-link-button.test.tsx
to assert the translated accessible name.

Comment thread web/src/components/MemoView/components/MemoHeader.tsx Outdated
@howtoexitvim
howtoexitvim force-pushed the feature/memo-detail-shortcut-pr branch from 454ee66 to e84ff45 Compare August 2, 2026 13:38
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