select: Fix perform_search to call SelectItem::matches (longbridg… - #1
Merged
Conversation
Previously, `SearchableVec::perform_search` used hardcoded title matching, which prevented users from implementing custom search logic.
Closes #1860 | Before | After | | --- | --- | | <img width="402" height="337" alt="image" src="https://github.com/user-attachments/assets/2c54af02-5519-48e2-8aab-d3472ab5d1f8" /> | <img width="416" height="330" alt="image" src="https://github.com/user-attachments/assets/eb49275d-2807-46a7-8b70-e18344a54664" /> |
## Description Hide clear button when the input is disabled. ## Screenshot | Before | After | | ---------------------------- | --------------------------- | | <img width="341" height="327" alt="image" src="https://github.com/user-attachments/assets/0d3377ed-32ff-41f9-ae68-fbff5af8b26c" /> | <img width="360" height="338" alt="image" src="https://github.com/user-attachments/assets/48f1b9c1-1210-4861-998c-476389ccd44f" /> | ## Checklist - [x] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document and followed the guidelines. - [x] Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate. - [x] Passed `cargo run` for story tests related to the changes. - [ ] Tested macOS, Windows and Linux platforms performance (if the change is platform-specific)
If the button that opens the dialog is focused, after closing the dialog with Enter, the dialog unexpectedly opens again. ## Before https://github.com/user-attachments/assets/83c4c469-fe86-4ac8-8d9a-c7678359d368 ## After https://github.com/user-attachments/assets/d541a759-1865-4f01-bd47-4c54b6ee2bd2
## Description When using inline completions the ghost lines would push/offset all line numbers, not just at the current row. ## Screenshot | Before | After | | ---------------------------- | --------------------------- | | <img width="329" height="318" alt="Screenshot From 2026-01-30 10-42-58" src="https://github.com/user-attachments/assets/38c29ff0-f562-428a-bef5-5c2e87ef1095" /> | <img width="329" height="318" alt="Screenshot From 2026-01-30 10-59-31" src="https://github.com/user-attachments/assets/5b0cd83d-7fda-4dab-afa3-043e44bb2375" /> | ## How to Test 1. `cargo run --release --example editor` 2. Type `fn (` to get inline completions ## Checklist - [x] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document and followed the guidelines. - [x] Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate. - [x] Passed `cargo run` for story tests related to the changes. - [ ] Tested macOS, Windows and Linux platforms performance (if the change is platform-specific)
## Description When using inline completions (ghost lines), the first line suffix is not aligned with the rest of the line. This changes it to capture the current cursor row y instead of using the cursor bounds for the y offset. ## Screenshot | Before | After | | ---------------------------- | --------------------------- | | <img width="453" height="77" alt="Screenshot From 2026-01-30 14-03-30" src="https://github.com/user-attachments/assets/e3f0ae89-7a30-49d6-b696-e94f90a14368" /> | <img width="453" height="77" alt="Screenshot From 2026-01-30 14-13-52" src="https://github.com/user-attachments/assets/cacd48de-404e-4f46-a837-d4b218c18a42" /> | ### Comparison <img width="800" height="291" alt="Screenshot From 2026-01-30 14-53-12" src="https://github.com/user-attachments/assets/e63dc2a8-fb88-4c4d-bc51-80b32d58b379" /> ## How to Test 1. `cargo run --release --example editor` 2. Type `fn (` to get inline completions ## Checklist - [x] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document and followed the guidelines. - [x] Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate. - [x] Passed `cargo run` for story tests related to the changes. - [x] Tested macOS, Windows and Linux platforms performance (if the change is platform-specific)
…abs (#1979) ## Description This adds `.show_whitespace` and `.set_show_whitespace` to the `InputState` to control whether or not to render spaces and tabs. I've also updated all the themes with the new `editor.invisible` color, this is the `comment` color with added opacity. ## Screenshot <img width="823" height="661" alt="Screenshot From 2026-01-29 14-04-52" src="https://github.com/user-attachments/assets/2f79f081-83bd-47ea-922c-01b9f22262cf" /> <img width="795" height="118" alt="Screenshot From 2026-01-29 14-05-14" src="https://github.com/user-attachments/assets/b8e22080-a88e-44b7-abd8-4c8100b1a972" /> ## How to Test `cargo run --release --example editor` Click on the "Show whitespace" button in the footer. ## Checklist - [x] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document and followed the guidelines. - [x] Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate. - [x] Passed `cargo run` for story tests related to the changes. - [x] Tested macOS, ~~Windows~~ and Linux platforms performance (if the change is platform-specific) --------- Co-authored-by: Jason Lee <huacnlee@gmail.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
Closes #1983
## Description
Set `InputState.disabled` to false during `InputState::insert` and
restore before returning.
## Break Changes
Users who relied on the text to not update when `InputState::insert` is
called if the `Input` is disabled. Not sure why someone would be doing
this though.
- Change 1
```diff
pub fn insert(
&mut self,
text: impl Into<SharedString>,
window: &mut Window,
cx: &mut Context<Self>,
) {
+ let was_disabled = self.disabled;
+ self.disabled = false;
let text: SharedString = text.into();
let range_utf16 = self.range_to_utf16(&(self.cursor()..self.cursor()));
self.replace_text_in_range_silent(Some(range_utf16), &text, window, cx);
self.selected_range = (self.selected_range.end..self.selected_range.end).into();
+ self.disabled = was_disabled;
}
```
## How to Test
Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce.
## Checklist
- [X] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document and
followed the guidelines.
- [X] Reviewed the changes in this PR and confirmed AI generated code
(If any) is accurate.
- [X] Passed `cargo run` for story tests related to the changes.
- [ ] Tested macOS, Windows and Linux platforms performance (if the
change is platform-specific)
# feat: Add Theme Color Viewer story ## Description _Initial PR Text Created from Gemini_ This PR introduces a new **Theme Color Viewer** story, providing a comprehensive interface for exploring, searching, and debugging theme colors within the GPUI Component ecosystem. This feature was developed to ensure accessibility for users with specific color vision requirements. ### Key Features - **Categorized View**: Automatically groups theme colors into logical sections (Global, Primary, Sidebar, etc.) for easier navigation. - **Inheritance Awareness**: Uses visual indicators to distinguish between explicit user overrides and colors inherited from the base theme. - **Search & Filter**: Quickly find colors by name, category, or hex code. - **Interactive Previews**: - **Filter By Value**: View all keys that share a specific color value. - **Copy to Clipboard**: One-click hex copying for developer convenience. - **Checkerboard Background**: A dynamic background that adjusts to the selected theme's mode (light/dark) to verify contrast and transparency. - **On-the-fly Theme Injection**: Testing "Set Theme" functionality directly within the viewer to see real-time UI updates. ### Technical Implementation - **Modular Design**: Broken down into [color_theme_story.rs](cci:7://file:///Users/scg/Developer/GitHub/gpui-component/crates/story/src/stories/theme_story/color_theme_story.rs:0:0-0:0), [mapper.rs](cci:7://file:///Users/scg/Developer/GitHub/gpui-component/crates/story/src/stories/theme_story/mapper.rs:0:0-0:0) (compatibility bridge for legacy keys), and [checkerboard.rs](cci:7://file:///Users/scg/Developer/GitHub/gpui-component/crates/story/src/stories/theme_story/checkerboard.rs:0:0-0:0). - **Dynamic Iteration**: Uses `serde_json` to handle the flattening of the [ThemeColor](cci:2://file:///Users/scg/Developer/GitHub/gpui-component/crates/story/src/stories/theme_story/color_theme_story.rs:79:0-89:1) struct without manual field mapping. - **Isolation**: The code is as isolated as possible, there were several enhancements to core theme code that I left out I would like to address in near future. ## AI Assistance 🤖 Some parts of this change were generated with AI assistance: - The exhaustive mapping table in [mapper.rs](cci:7://file:///Users/scg/Developer/GitHub/gpui-component/crates/story/src/stories/theme_story/mapper.rs:0:0-0:0) for translating legacy snake_case keys was drafted by AI. - The [format_colors](cci:1://file:///Users/scg/Developer/GitHub/gpui-component/crates/story/src/stories/theme_story/color_theme_story.rs:558:0-634:1) logic for dynamic struct iteration via Serde was initially suggested by AI. - **Note**: All AI-generated portions have been manually reviewed, refactored for clarity (e.g., extracted [Checkerboard](cci:2://file:///Users/scg/Developer/GitHub/gpui-component/crates/story/src/stories/theme_story/checkerboard.rs:3:0-6:1) and [ParsedKey](cci:2://file:///Users/scg/Developer/GitHub/gpui-component/crates/story/src/stories/theme_story/mapper.rs:28:0-32:1)), and verified against project styles. ## How to Test 1. Run the storybook: `cargo run -- theme` 2. Search for a specific color (e.g., `primary` or `#ffffff`). 3. Switch between different themes and toggle "Show Inherited Colors". 4. Hover over a color swatch and click the copy icon. ## Checklist - [x] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document and followed the guidelines. - [x] Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate. - [x] Passed `cargo clippy --package gpui-component-story` and `cargo test --workspace`. - [x] Verified on macOS using `MTL_HUD_ENABLED=1 cargo run --package gpui-component-story --release` --------- Co-authored-by: Floyd Wang <gassnake999@gmail.com>
| Before | After | | - | - | | <img width="1155" height="905" alt="image" src="https://github.com/user-attachments/assets/eaa13aac-752f-4c4b-89e5-1ff848506aff" /> | <img width="1190" height="884" alt="SCR-20260203-pylt" src="https://github.com/user-attachments/assets/0d5bbb7e-0f73-496f-b0c7-d0549863b0ff" /> |
## Description Adds PHP syntax highlighting to the code editor component using tree-sitter-php. ## Screenshot Before: <img width="1312" height="862" alt="before" src="https://github.com/user-attachments/assets/6624c8f6-2902-450b-a206-1354d3596361" /> After: <img width="1312" height="862" alt="after" src="https://github.com/user-attachments/assets/5d640fec-0159-4663-9400-c58c52b97096" /> ## How to Test 1. Run `cargo run -p gpui-component-story --example editor` 2. Open a PHP file 3. The syntax of the file is now highlighted ## Checklist - [X ] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document and followed the guidelines. - [ X] Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate. - [ X] Passed `cargo run` for story tests related to the changes. - [ N/A] Tested macOS, Windows and Linux platforms performance (if the change is platform-specific) --------- Co-authored-by: Jason Lee <huacnlee@gmail.com>
<img width="329" height="338" alt="image" src="https://github.com/user-attachments/assets/656d86ca-a014-4111-8cb2-425546377875" />
Closes #1547 ## Description add key map to table component : - tab - shift+tab - PgUp - PgDn - Home - End --------- Co-authored-by: Hizome <harrydeng0123@gmail.com> Co-authored-by: Jason Lee <huacnlee@gmail.com>
Co-authored-by: Floyd Wang <gassnake999@gmail.com>
## Description The word matching only matches alphanumeric chars, so double click to select words doesn't quite work for a lot of languages. This extends the matching to include more unicode ranges. ## Screenshot | Before | After | | ---------------------------- | --------------------------- | | <img width="523" height="127" alt="Screenshot From 2026-02-08 11-23-24" src="https://github.com/user-attachments/assets/1a952c18-cbdb-4f43-88dd-979e6ee09125" /> | <img width="523" height="127" alt="Screenshot From 2026-02-08 11-22-37" src="https://github.com/user-attachments/assets/4381cca2-158b-4485-88f0-1b5e975c31fd" /> | ## How to Test `cargo test` or `cargo run --release --example editor` and write something in the latin1 range, like `rök` and try to double click it. The whole word should be selected and not just `r` like previously. ## Checklist - [x] I have read the [CONTRIBUTING](../CONTRIBUTING.md) document and followed the guidelines. - [x] Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate. - [x] Passed `cargo run` for story tests related to the changes. - [ ] Tested macOS, Windows and Linux platforms performance (if the change is platform-specific)
…r picker HSLA, table keyboard nav Upstream additions (auto-merged): - Focus trap module for dialogs, sheets, context menus - PHP tree-sitter syntax highlighting - Color picker HSLA slider tabs with i18n - Table keyboard navigation (arrow keys, home/end, page up/down, tab) - Whitespace display in code input - Input bug fixes (clear button, ghost lines, word matching) - Select placeholder color and search delegation fixes - Color theme viewer story - macOS core-text dependency Conflict resolution (4 files): - Cargo.toml: kept local tree-sitter versions + added upstream's tree-sitter-php + both platform deps - dialog.rs: kept local theme-driven motion system + integrated upstream focus_trap + defer_close_dialog - sheet.rs: replaced tab_group with upstream focus_trap, kept local animation - table/mod.rs: took upstream's expanded action imports for keyboard nav Clippy fixes applied to upstream code (redundant clones).
- Centralize animation helpers in animation.rs and fix strong_invoke_easing - Add enter/exit fade animations to Tooltip, Popover, ContextMenu, Select, DatePicker, Accordion, Collapsible components - Add badge entry and tab indicator state transition animations - Integrate Fluent shadow, color, and typography tokens into theme system - Update docs and learnings for new animation patterns and fixes
- Add animation::keyed_presence state machine for Entering/Entered/Exiting/Exited - Refactor Accordion, Sidebar, Dialog, Popover to use keyed presence for mount/unmount and animation gating - Remove bounce easing from reveal/size/opacity transitions; use monotonic curves (fast_invoke/point_to_point) - Fix open animation flash and collapse bugs on Accordion/Sidebar/Dialog - Delay dropdown menu unmount until popover exit animation completes - Update docs and learnings to document new animation guardrails and patterns
|
Caution Review failedThe pull request is closed. Summary by CodeRabbit
WalkthroughThis pull request introduces comprehensive animation and motion infrastructure, focus trap functionality for keyboard navigation, PHP language support with whitespace indicators, new theme color tokens and typography system, and a theme color explorer UI story. Version dependencies are bumped to 0.5.1 across all crates. Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes ✨ Finishing touches
🧪 Generate unit tests (beta)
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #[issue number]
Description
Describe in English for the changes made in this pull request and the problem it solves.
Please keep 1 PR to solve 1 problem, and keep Small improvements should be small modifications to make PR easier to review and to merge.
Screenshot
Break Changes
Describe any breaking changes introduced by this pull request. If none, remove this section.
How to Test
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.
Checklist
cargo runfor story tests related to the changes.