input: Add text decoration collections (#2602)
## Summary - add `TextDecoration` and `TextDecorationCollection` as a small, presentation-only API for input decorations - expose Rust-style `create_decorations_collection`, returning a collection handle with `set`, `append`, `clear`, and `get_ranges` - keep collection identity internal instead of exposing opaque IDs; the handle uses a weak reference to its owning `InputState` - use GPUI `HighlightStyle` and UTF-8 byte ranges, with Monaco Decorations API links on the corresponding public APIs - keep decoration storage outside `state.rs` and compose it into the existing rendering paths - include an interactive Input Story example with multiple background and underline ranges <img width="982" height="757" alt="image" src="https://github.com/user-attachments/assets/694c95ab-a7a0-4208-8c42-8a2973b9e30b" /> This supersedes #2599. The earlier approach touched more input and UTF-16 conversion logic than the underline/highlight requirement needed. This PR intentionally keeps the implementation localized and preserves the existing input/highlighter behavior. For follow-up changes, please modify only what the concrete requirement needs and keep diffs narrowly scoped; avoid changing unrelated core input behavior. Monaco is used as a reference for the ownership model and API capabilities, while naming, types, and return values follow Rust and GPUI conventions rather than copying the TypeScript API literally. ## Test Plan - `cargo test -p gpui-component --lib` (325 passed) - `cargo test -p gpui-component decoration --lib` (3 passed) - `cargo check -p gpui-component-story` - `git diff --check` --------- Co-authored-by: Codex <codex@openai.com>
J
Jason Lee committed
5c5eb1db04dc1146bdec903a8ac74407bd6c2098
Parent: c2282af
Committed by GitHub <noreply@github.com>
on 7/27/2026, 6:10:34 AM