Skip to content

Conversation

@waywardmonkeys
Copy link
Contributor

This introduces a small, flow‑first layer on top of Parley that treats a document as an ordered set of text blocks, with explicit container rectangles defining where each block lives. The flow owns geometry and the “join” between neighboring blocks (e.g., space vs newline), while blocks only supply layout and text. On top of this, the crate provides hit‑testing, selection geometry, and cross‑block text extraction, so you can drag through multiple paragraphs/labels and get predictable results.

Motivation

  • Borrow from proven platform models (e.g., TextKit containers): separate shaping/layout from flow/regions, keep APIs small and durable.
  • Reduce ambiguity and API surface: one explicit flow path for hit‑testing, selection, and copy, instead of guessing based on per‑layout state.
  • Keep integration simple: a convenience builder stacks blocks vertically when you don’t want to hand author rects; otherwise, supply rectangles you already have in your UI.

@waywardmonkeys
Copy link
Contributor Author

Not ready for nit-picking yet ... just thinking about the overall thing.

This introduces a small, flow‑first layer on top of Parley that treats
a document as an ordered set of text blocks, with explicit container
rectangles defining where each block lives. The flow owns geometry
and the “join” between neighboring blocks (e.g., space vs newline),
while blocks only supply layout and text. On top of this, the crate
provides hit‑testing, selection geometry, and cross‑block text
extraction, so you can drag through multiple paragraphs/labels and
get predictable results.

Motivation

- Borrow from proven platform models (e.g., TextKit containers):
  separate shaping/layout from flow/regions, keep APIs small and durable.
- Reduce ambiguity and API surface: one explicit flow path for
  hit‑testing, selection, and copy, instead of guessing based
  on per‑layout state.
- Keep integration simple: a convenience builder stacks blocks
  vertically when you don’t want to hand author rects; otherwise,
  supply rectangles you already have in your UI.
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.

1 participant