linebender / linebender/druid

New TextBox & IME integration tracking issue (report new TextBox issues here!)

Open
#1,652 31 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

text widget
Dominant language
Rust
Stars
9.7k
Forks
565
PR merge metrics
No merged PRs in 30d

Description

When #1636 lands, how druid handles text will change fundamentally, and there are almost certainly some issues that we will encounter as we start using the new implementation.

This issue is intended as a tracking/discussion issue for various problems with the new text work.

## polish
There are a number of outstanding fixups I would like to land:
- [x] unify selection & movement types between druid-shell and druid
- [x] TextBox without focus should use an 'inactive' color for selections.
- [x] restructure `druid::text` module, centralizing all text-related types here
- [x] put TextBox `Insets` in the env
- [ ] handle more keys when 'simulating input' on windows/linux
- [ ] support more movement types (pageup/pagedown, e.g)
- [x] better implementation of 'select word' and 'select line': these don't currently behave well when clicks occur on boundaries.
- [x] preserve double/triple-click state through to drag gestures: drag after double-click should select at "word granularity", after triple click at "line granularity"

## features
Larger related projects it might be nice to do while we're in here
- [x] select-all, copy, paste (and undo/redo, eventually) should work without the menus present (#1030)
- [ ] 'submit on return': there should be a mechanism for hooking the return key in order to perform some custom action.
- [ ] allow toggling selectable & editable flags: you may want a text field that can be selected but not edited, or a text field that cannot be edited *or* selected
- [ ] TextBox should have built-in support for undo/redo
- [ ] A mechanism for letting the user submit edit `Action`s.

## bugs
- [x] move to start of line / end of line behaviour is incorrect
- [x] selections that include lines with emergency breaks (breaks that are not at whitespace) are not drawn correctly: https://github.com/linebender/piet/pull/412
~- [ ] IME composing region is drawn incorrectly sometimes~ can't reproduce
- [x] IME composing window can draw at incorrect position
~- [ ] line height calculations are incorrect for some scripts (japanese)~ out of scope for this work

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with one unchecked item in the polish or features lists and read the TextBox implementation in druid::text alongside the related druid-shell text handling. Reproduce the selected behavior, then use the issue's checklist to define completion; the tracking issue does not name a specific file or test.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
desktop, frontend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.