Skip to content

select: Fix perform_search to call SelectItem::matches (longbridg… - #1

Merged
BumpyClock merged 31 commits into
mainfrom
feat/upstream-sync
Feb 10, 2026
Merged

select: Fix perform_search to call SelectItem::matches (longbridg…#1
BumpyClock merged 31 commits into
mainfrom
feat/upstream-sync

Conversation

@BumpyClock

Copy link
Copy Markdown
Owner

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

Before After
[Put Before Screenshot here] [Put After Screenshot here]

Break Changes

Describe any breaking changes introduced by this pull request. If none, remove this section.

  • Change 1
- Old code snippet
+ New code snippet

How to Test

Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce.

Checklist

  • I have read the CONTRIBUTING document and followed the guidelines.
  • Reviewed the changes in this PR and confirmed AI generated code (If any) is accurate.
  • Passed cargo run for story tests related to the changes.
  • Tested macOS, Windows and Linux platforms performance (if the change is platform-specific)

fhluo and others added 30 commits January 23, 2026 13:33
Previously, `SearchableVec::perform_search` used hardcoded title
matching, which prevented users from implementing custom search logic.
## 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)
## 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>
## 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>
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
@BumpyClock
BumpyClock merged commit b390a31 into main Feb 10, 2026
1 check was pending
@coderabbitai

coderabbitai Bot commented Feb 10, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

Summary by CodeRabbit

  • New Features

    • Added focus trap functionality to contain keyboard navigation within modal dialogs and custom components.
    • Introduced whitespace visualization in text editors with toggle control.
    • Expanded color picker with HSLA sliders alongside existing hex input.
    • Added interactive theme color explorer with filtering and copy-to-clipboard.
    • Integrated PHP syntax highlighting support.
  • Improvements

    • Enhanced animations for accordion, dialog, sidebar, and other components with smooth transitions.
    • Added typography customization system with fluent text styling options.
    • Improved table navigation with page up/down and home/end key support.
    • Better command palette UI with optimized animation sequences.
  • Documentation

    • Added comprehensive guides for focus trapping, sidebar motion, and accordion animations.

Walkthrough

This 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

Cohort / File(s) Summary
Version Bumps
Cargo.toml, crates/*/Cargo.toml, examples/*/Cargo.toml, README.md
Bumped package versions from 0.5.0 to 0.5.1; added PHP tree-sitter support and macOS core-text dependency to UI crate.
Animation & Motion System
crates/ui/src/animation.rs, crates/ui/src/theme/fluent_tokens.rs, crates/ui/src/theme/default-theme.json
Introduced comprehensive animation utilities: PresencePhase, PresenceTransition, keyed_presence state machine, theme-aware easing helpers (fast_invoke, soft_dismiss, point_to_point, fade, strong_invoke animations), and cubic-bezier parsing. Updated strong_invoke easing curve.
Focus Trap System
crates/ui/src/focus_trap.rs, crates/ui/src/root.rs, crates/ui/src/lib.rs
Added new focus trap module with FocusTrapElement trait and FocusTrapManager global state; integrated with Root for keyboard Tab/Shift-Tab navigation cycling within trapped containers; added dialog lifecycle management with ID tracking and closing state.
Dialog & Popover Animation
crates/ui/src/dialog.rs, crates/ui/src/popover.rs, crates/ui/src/command_palette/mod.rs
Added presence-based enter/exit animations with keyed state machine; introduced animate() builder method for Dialog; applied fade and panel animations; deferred dialog closure through central path.
Component Animation Updates
crates/ui/src/accordion.rs, crates/ui/src/collapsible.rs, crates/ui/src/sidebar/menu.rs, crates/ui/src/sidebar/mod.rs, crates/ui/src/tab/tab.rs, crates/ui/src/menu/context_menu.rs, crates/ui/src/menu/dropdown_menu.rs
Integrated animation infrastructure across multiple components: accordion, collapsible, sidebar menu, tab, context menu, and dropdown menu with motion-aware height/opacity transitions, keyed presence handling, and reduced-motion awareness.
Input & Editor Whitespace
crates/ui/src/input/state.rs, crates/ui/src/input/text_wrapper.rs, crates/ui/src/input/element.rs, crates/story/examples/editor.rs
Introduced WhitespaceIndicators layout for rendering space and tab markers; added show_whitespaces flag to InputState with builder method; plumbed through text layout and rendering pipeline.
Badge & Progress Animation
crates/ui/src/badge.rs, crates/ui/src/progress/progress.rs, crates/ui/src/progress/progress_circle.rs
Added element ID-based strong_invoke animation support to Badge; consolidated progress components to use externalized animation_with_theme_easing instead of local implementations.
Checkbox & Notification Easing
crates/ui/src/checkbox.rs, crates/ui/src/notification.rs, crates/ui/src/switch.rs, crates/ui/src/sheet.rs
Refactored to use centralized animation_with_theme_easing function, removing local cubic-bezier parsing implementations; added focus trap support to sheet.
Theme Colors & Typography
crates/ui/src/theme/theme_color.rs, crates/ui/src/theme/schema.rs, crates/ui/src/theme/elevation.rs, crates/ui/src/theme/typography.rs, crates/ui/src/theme/mod.rs, crates/ui/src/highlighter/registry.rs
Added new color fields (disabled_foreground, control_stroke, card, card_foreground, solid_background) to ThemeColor; introduced ThemeTypography with type ramp system (9 predefined typography styles); added elevation computed_shadow method for box-shadow calculation.
PHP Language Support
crates/ui/src/highlighter/languages.rs, crates/ui/src/highlighter/languages/php/injections.scm, crates/ui/src/highlighter/highlighter.rs
Added PHP variant to Language enum with tree-sitter-php support; introduced combined-injections query for parsing multiple ranges as single document; wired PHP with HTML, CSS, JavaScript injections.
Theme Color Explorer Story
crates/story/src/stories/theme_story/*, crates/story/src/stories/mod.rs, crates/story/src/lib.rs, crates/story/src/main.rs
Introduced comprehensive theme color viewer UI (ThemeColorsStory) with category-based color organization, filtering, hex copying, Checkerboard background component, and mapper utility for dot-notation to legacy snake_case theme key compatibility.
Color Picker & Select Enhancements
crates/ui/src/color_picker.rs, crates/ui/src/select.rs, crates/ui/src/setting/settings.rs, crates/ui/src/table/column.rs, crates/ui/src/table/state.rs, crates/ui/src/table/mod.rs
Extended ColorPicker with HSLA sliders and dual-mode (Palette/HSLA tabs); updated Select to use item.matches() for search; added typography fluent helpers; introduced table page navigation actions (SelectFirst, SelectLast, SelectPageUp, SelectPageDown) and column center-alignment support.
Text & Accessibility
crates/ui/src/text/state.rs, crates/ui/src/input/selection.rs, crates/ui/src/input/lsp/mod.rs, crates/ui/src/input/lsp/document_colors.rs, crates/ui/src/input/popovers/completion_menu.rs
Added text view style propagation to rendering context; broadened word-character detection to include Unicode ranges; debounced document color updates; bounded matched_len in completion menu rendering.
Time & Tooltip Animation
crates/ui/src/time/date_picker.rs, crates/ui/src/tooltip.rs
Added fast_invoke animation support to DatePicker calendar popup; introduced fade animation handling in Tooltip with optional Element variant for custom content builders.
Actions & Styled Extensions
crates/ui/src/actions.rs, crates/ui/src/styled.rs
Expanded UI actions set with SelectFirst, SelectLast, SelectPrevColumn, SelectNextColumn, SelectPageUp, SelectPageDown; added eight fluent typography helpers (fluent_caption, fluent_body variants, fluent_subtitle, fluent_title variants, fluent_display).
Story Updates & Examples
crates/story/src/stories/color_picker_story.rs, crates/story/src/stories/command_palette_story.rs, crates/story/src/stories/menu_story.rs, crates/story/src/stories/sidebar_story.rs, crates/story/src/stories/table_story.rs, crates/story/src/stories/input_story.rs, crates/story/examples/fixtures/test.php
Enhanced color picker story rendering, refactored command palette story to use direct state updates in subscriptions, added context menu example, renamed Sidebar API, added center-alignment to table story, enabled whitespace display in input story, added PHP test fixture.
Localization & Documentation
crates/ui/locales/ui.yml, docs/docs/components/accordion.md, docs/docs/components/dialog.md, docs/docs/components/editor.md, docs/docs/components/sidebar.md, docs/docs/components/focus-trap.md, docs/learned/*, AGENTS.md, LEARNINGS.md
Added ColorPicker locale entries; updated component docs with animation motion sections; added comprehensive focus-trap documentation; documented animation learnings for accordion, command palette, and sidebar; updated AGENTS.md with animation guardrails and LEARNINGS.md with February 2026 motion improvements.
Theme Configuration
themes/*/json, .gitignore
Added editor.invisible color token to 25+ theme variants; added .ai_agents/ to .gitignore.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/upstream-sync

Comment @coderabbitai help to get the list of available commands and usage tips.

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.