mirror of
https://github.com/librekeys/gpui-component.git
synced 2026-07-28 08:00:57 -07:00
Closes #2518. Each selectable `TextView` is now tagged with the modal layer it paints under, via a new `.selection_scope(scope)` element modifier that pushes/pops a scope during paint (mirroring the existing `text_view_state_stack` idiom). Window selection only considers views in the active layer — the topmost dialog, else the active sheet, else the base window — and is cleared when a modal opens/closes. Covers both `Dialog` and `Sheet`. | Before | After | | - | - | | <img width="960" height="828" alt="Dialog1" src="https://github.com/user-attachments/assets/2e91c56b-558a-4e55-a05c-7a1bda241a77" /> | <img width="962" height="827" alt="Dialog2" src="https://github.com/user-attachments/assets/29b472fa-1ed8-4088-b300-4643bde88afa" /> | | <img width="960" height="828" alt="Sheet1" src="https://github.com/user-attachments/assets/e59b5b6a-ddd8-42b9-a844-f316cb8f1dec" /> | <img width="962" height="827" alt="Sheet2" src="https://github.com/user-attachments/assets/b822fa9e-4042-479e-82a6-7d1fd857dc8f" /> | --------- Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
GPUI Component basic examples
This folder contains basic examples of how to use the GPUI Component library. Each example demonstrates a specific feature or functionality of the library.
Unlike the examples in the story folder, these examples focus on 1 example for 1 feature, making it easier to understand and implement specific functionalities in your own projects.
Contributing
Feel free to contribute more examples to this folder!
If you have a specific use case or feature you'd like to demonstrate, please create a new example file and submit a pull request. We will happy to merge it into the repository.
When creating a new example, please follow these guidelines:
- Keep 1 example just doing 1 thing for more clarity.
- Testing the example to ensure it works as expected.
- Write some comment at some key parts of the code to explain what it does.
- Following the code style and name style used in the existing examples or in entire of GPUI Component.