Skip to content

feat: save selected text from a nearby Memos button - #21

Open
ObsidianArch02 wants to merge 2 commits into
usememos:mainfrom
ObsidianArch02:pr/selection-save-icon
Open

ObsidianArch02 wants to merge 2 commits into
usememos:mainfrom
ObsidianArch02:pr/selection-save-icon

Conversation

@ObsidianArch02

Copy link
Copy Markdown

Summary

  • Show a small Memos button next to the end of selected webpage text.
  • Preserve the selection during a click and capture its Markdown before asynchronous work.
  • Reuse the context menu save flow for templates, attachments, source links, setup checks, and save feedback.
  • Hide the button when the selection clears or leaves the viewport. Keep it hidden in text editors and input fields.
  • Load the button UI on demand in a shadow root and use the existing Memos UI components and brand mark.
  • Validate the new message payload and sender. Require a trusted user click and block duplicate saves while a request is pending.

Fixes #19

Verification

  • pnpm lint
  • pnpm test: 404 tests passed with Node 22, matching upstream CI.
  • pnpm build
  • pnpm audit --prod
  • node scripts/package.mjs all: packages built. Firefox validation reported zero errors and seven bundled-code warnings.
  • Chromium browser test with the built extension and a local synthetic Memos server. Verified the button, trusted clicks, duplicate protection, Markdown, the source link, selection cleanup, and failure feedback.
  • Verified that synthetic webpage clicks cannot save, editable selections stay hidden, and RTL and offscreen selections update the button.

The existing Space submenu keyboard focus test at src/popup/__tests__/App.dom.test.tsx:421 failed intermittently with Node 26. The same failure also reproduced on unchanged upstream code. The final Node 22 suite passed.

Firefox packages were built. Interactive Firefox behavior still needs verification.


Generated by Codex with GPT-6

@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 59 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: af5fcedf-13e7-45af-96de-e1f38844ab64
Commits

Reviewing files that changed from the base of the PR and between 5f9c8ab and 56dbe1a.

Files selected for processing: 10

  • README.md
  • src/__tests__/background.dom.test.ts
  • src/__tests__/content.dom.test.ts
  • src/background.ts
  • src/content.ts
  • src/content/__tests__/selection-save.dom.test.tsx
  • src/content/selection-save.tsx
  • src/lib/__tests__/background-protocol.test.ts
  • src/lib/background-protocol.ts
  • src/lib/messages.ts
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

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] Show a save icon next to selected text

1 participant