You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Selection: a window-wide switch for text selection #358
An app setting like "Enable text selection" turns off selection for message bodies everywhere. Selection is per text element, so the switch has to be threaded through every place that builds such text.
Wanted: a subtree or window flag (El::selectable(false) inherited by descendants, with a per-element opt back in for values meant to be copied).
Context: found while porting a chat client's desktop UI to Rune (pinned at 565de6b).
Thanks for the clear write-up. Right now El::selectable only applies to the text element it's called on. El::selection_group and El::caret_browsing change how selectable texts inside a container behave, but they can't turn selection off for a subtree. El::unselectable does apply to a subtree, but only in a web page's DOM mirror; on desktop it changes nothing. So today an app-wide "Enable text selection" setting has to be passed to every place that builds text, as you found.
I'm treating this as a feature request: a flag that a subtree or window passes down to its descendants and that turns selection off for them, plus a way for a single element to opt back in for values people should still be able to copy.
false on your root turns off every .selectable(true) text below it: no drag, double-click, Cmd/Ctrl+A, Tx::select_* or I-beam. This includes memo subtrees, mixed-direction dir_by_paragraph text and virtual_rows that aren't mounted yet, and a selection that's already held clears.
true on a descendant keeps a value like an ID copyable.
It's a separate builder rather than an inherited El::selectable(false). That way your message bodies can keep calling .selectable(true) and the app setting still overrides them. It's documented under "Selectable text" in crates/rune/README.md, and it still needs CI to build it, run the tests and pass review before it can land.
Activity
opencodejr commentedon Nov 25, 2026
Thanks for the clear write-up. Right now
El::selectableonly applies to the text element it's called on.El::selection_groupandEl::caret_browsingchange how selectable texts inside a container behave, but they can't turn selection off for a subtree.El::unselectabledoes apply to a subtree, but only in a web page's DOM mirror; on desktop it changes nothing. So today an app-wide "Enable text selection" setting has to be passed to every place that builds text, as you found.I'm treating this as a feature request: a flag that a subtree or window passes down to its descendants and that turns selection off for them, plus a way for a single element to opt back in for values people should still be able to copy.
opencodejr commentedon Nov 25, 2026
I've opened a pull request that adds
El::selection_enabled(bool):falseon your root turns off every.selectable(true)text below it: no drag, double-click, Cmd/Ctrl+A,Tx::select_*or I-beam. This includesmemosubtrees, mixed-directiondir_by_paragraphtext andvirtual_rowsthat aren't mounted yet, and a selection that's already held clears.trueon a descendant keeps a value like an ID copyable.It's a separate builder rather than an inherited
El::selectable(false). That way your message bodies can keep calling.selectable(true)and the app setting still overrides them. It's documented under "Selectable text" incrates/rune/README.md, and it still needs CI to build it, run the tests and pass review before it can land.Fixed in #2206.