[Feature Request] Copy selection as rich text (for Outlook and Slack)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- typescript
- Domain
- developer-experience, frontend
Research direction
Start by reading packages/ui/utils/clipboard.ts and packages/ui/utils/selectionActions.ts, then trace how AnnotationToolbar.tsx exposes selection actions and how the #1174 fallback handles copying. Define the rich-text output and cleanup rules from the issue, including plain-text fallback and HTTP behavior. Done means the toolbar action and shortcut copy formatted HTML plus plain text, with cleaned markup; the Slack-specific action is conditional on HTML pasting poorly into Slack.
Written by the indexing model from the issue text.
Description
Problem
I review plans and documents in Plannotator, then share parts of them by email (Outlook) and in chat (Slack). Every copy action in the UI copies plain text only. The selection toolbar's copy button, Vim Y and "Copy as markdown" on tables all go through copyTextToClipboard() in packages/ui/utils/clipboard.ts, which calls navigator.clipboard.writeText(). When I paste, I lose headings, bold, links, lists and code formatting.
Today I paste the text into an external converter first:
Their output is what I want from a "Copy for Outlook" or "Copy for Slack" action, without leaving Plannotator.
Proposal
Add a built-in Copy as rich text action to the selection toolbar, with a keyboard shortcut. It writes one ClipboardItem with two formats:
text/html: the rendered selection. Outlook, Word, Google Docs and other apps that accept rich text keep the formatting.text/plain: the current plain text, as the fallback.
If the HTML copy does not paste well into Slack, add a second action, Copy for Slack. It writes Slack markup as plain text (*bold*, _italic_, <url|text>, • bullets, code blocks), like Slackdown does.
Alternative considered
Expose the existing selectionActions prop (packages/ui/utils/selectionActions.ts, used in AnnotationToolbar.tsx) through config, so that users can add their own copy actions. #1572 made that seam opt-in for host apps only ("Plannotator as the provider of these capabilities, not a product that uses them"), so a built-in action seems a better fit. If configurable actions are acceptable, the seam already provides the button, the dropdown and the selection context.
Notes
- Clean up the copied HTML. Remove annotation highlights,
data-block-idattributes, toolbar elements and theme colors, so that dark-theme colors do not appear in an email. ClipboardItemneeds a secure context. The fallback added in #1174 could also callclipboardData.setData('text/html', ...)in its copy handler, so that the action still works over plain HTTP on remote hosts.
Version: plannotator 0.28.22 (Pi extension). I checked the code paths above against main
- Dominant language
- TypeScript
- Stars
- 8.7k
- Forks
- 649
- Avg merge
- 4h 10m
- Merged PRs (30d)
- 429
Getting set up
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from backnotprop/plannotator
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
backnotprop/plannotator#2159 ·
Maintainers usually reply within 1 day
-
Annotate documentation omits per-file version history and privacy controlsMay be free again A pull request for this issue was closed without being merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
backnotprop/plannotator#1086 · 2 comments ·
Maintainers usually reply within 1 day
-
Plannotator review pull request handle multiple authenticated github usersPossibly taken @backnotprop claimed this today. Openenhancement triage
Difficulty 3/5 1-2 days Newbie friendliness 30/100
backnotprop/plannotator#2157 ·
Maintainers usually reply within 1 day
-
Monospace numbers render as superscriptPossibly taken @backnotprop claimed this 9 days ago. Openbug
Difficulty 3/5 Half a day Newbie friendliness 68/100
backnotprop/plannotator#1961 ·
Maintainers usually reply within 1 day
-
bug triage
Difficulty 4/5 3-5 days Newbie friendliness 35/100
backnotprop/plannotator#1949 ·
Maintainers usually reply within 1 day
All issues in backnotprop/plannotator
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
grafana/profiles-drilldown#1212 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
grafana/traces-drilldown#980 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
openremote/openremote#3487 · 1 comment ·
-
triage:needs-human
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
garrytan/gbrain#7635 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
coollabsio/jean#867 ·
Maintainers usually reply within 1 day