Text selection menu like Ganjoor's #26

Merged
anas merged 2 commits from feature/selection-menu into main 2026-10-08 20:57:39 +00:00
Owner

Closes #23.

Selecting text in a poem or prose page shows a small menu below the selection, as on Ganjoor (vaabd.js at tag dotnet-final):

Button Does
معنی opens the word sidebar (single words only; a single word still opens it automatically)
تلاش searches Divan (phrases in quotes)
کاپی copies the text with poet, title and link
شیئر link to this page with the selection highlighted (?hl=); native share sheet on phones
گوگل Google search

Ganjoor's قرآن (removed at the owner's request), بحر (metre, a Persian-only service) and abjad are left out.

Closes on Escape or when the selection is cleared; positioned under the selection inside the viewport; menu clicks keep the selection.

Tested (before the قرآن option was removed) (headless Chrome): menu 8 px below the selection; معنی only for single words; copy text = selection + "— مرزا غالب،

Closes #23. Selecting text in a poem or prose page shows a small menu below the selection, as on Ganjoor (`vaabd.js` at tag `dotnet-final`): | Button | Does | |---|---| | معنی | opens the word sidebar (single words only; a single word still opens it automatically) | | تلاش | searches Divan (phrases in quotes) | | کاپی | copies the text with poet, title and link | | شیئر | link to this page with the selection highlighted (`?hl=`); native share sheet on phones | | گوگل | Google search | Ganjoor's قرآن (removed at the owner's request), بحر (metre, a Persian-only service) and abjad are left out. Closes on Escape or when the selection is cleared; positioned under the selection inside the viewport; menu clicks keep the selection. **Tested** (before the قرآن option was removed) (headless Chrome): menu 8 px below the selection; معنی only for single words; copy text = selection + "— مرزا غالب، <title>" + link; share link opens with the phrase highlighted; تلاش goes to `/search?q="وصال یار"`; Escape and deselect close it; no console errors. **Please check** in Safari and Brave, and on a phone (long-press selection). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
anas added 1 commit 2026-10-08 20:36:54 +00:00
Selecting reading text shows a menu by the selection: معنی (word sidebar, single words),
تلاش (search Divan, phrases quoted), کاپی (text with poet, title and link), شیئر (link to the
page with the selection highlighted via ?hl=; native share sheet where available), قرآن
(tanzil.net), گوگل. Escape or clearing the selection closes it; no layout shift.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anas added 1 commit 2026-10-08 20:56:49 +00:00
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
anas merged commit c177b45561 into main 2026-10-08 20:57:39 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: anas/divan#26
No description provided.