skills: Fix component paths and the Dialog example (#2807)
Follow-up to #2805. Now that the Design and Coding Guides ship inside
the `gpui-component` skill, the rest of that skill was audited against
`crates/` — every import path in the component table and every
`window.*` / `cx.*` call in the examples.
Twelve of 53 table rows named a module or type that does not exist. An
agent following them writes code that will not compile.
## Component table
| Row | Was | Now |
| --- | --- | --- |
| `NumberInput` | `number_input::{NumberInput, NumberInputState}` |
`input::{NumberInput, NumberInputEvent}` |
| `OtpInput` | `otp_input::{OtpInput, OtpInputState}` |
`input::OtpInput` |
| `Toggle` | `toggle::Toggle` | `button::Toggle` |
| `DatePicker` | `time::date_picker::{…}` | `date_picker::{…}` |
| `Progress` | `progress::{ProgressBar, …}` | `progress::{Progress,
ProgressCircle}` |
| `TitleBar` | `title_bar::TitleBar` | `TitleBar` |
| `Resizable` | `resizable::Resizable` | `resizable::{h_resizable,
v_resizable, resizable_panel, ResizableState}` |
| `FocusTrap` | `focus_trap::FocusTrap` |
`gpui_base::focus_trap::FocusTrapElement` |
| `Tree` | `tree::{…, TreeDelegate}` | `tree::{Tree, TreeState,
TreeItem, TreeEntry}` |
| `Settings` | `settings::Settings` | `setting::Settings` |
| `Chart` | `chart::Chart` | `chart::{AreaChart, BarChart, LineChart,
PieChart, RadarChart}` |
| `Image` | `image::Image` | removed |
Notes on the less obvious ones:
- `number_input` and `otp_input` are not modules. Both types are
re-exported from `input` (`crates/ui/src/input/mod.rs:40-41`), and
`NumberInputState` / `OtpInputState` do not exist anywhere.
- `mod title_bar` and `mod time` are private
(`crates/ui/src/lib.rs:15-16`). `TitleBar` reaches the outside only
through `pub use title_bar::*`, and `date_picker` through `pub use
time::{calendar, date_picker}`.
- There is no `FocusTrap` type. `crates/base/src/focus_trap.rs` defines
the `FocusTrapElement` trait and a `FocusTrapContainer`, and
`gpui-component` does not re-export either.
- No `Image` component exists in `crates/ui` — the only match anywhere
is `text::node::ImageNode`, which is a markdown/HTML internal.
## Dialog example
`references/usage.md` called `window.open_modal` and
`window.close_modal`. Neither exists in `crates/` any more; the API is
`open_dialog` / `close_dialog` (`crates/ui/src/window_ext.rs:30,59`). It
also passed a closure to `.footer(…)`, which takes `impl IntoElement`
(`crates/ui/src/dialog/dialog.rs:317`) — the real shape is
`DialogFooter` / `DialogClose` / `DialogAction`.
Its copy was `title("Confirm")` / `"Are you sure?"` / `OK`, which is
precisely the pattern the Design Guides now bundled in the same skill
forbid. An agent read "never write this" in one file and a worked
example of it in the next. The example is now an ordinary dialog, and a
new `AlertDialog` section carries the confirmation case with
guide-conformant copy.
`SKILL.md` also pointed `Dialog` at `window.open_modal(...)`; corrected.
## Verification
Re-ran the audit after the change: no module, type, or method named in
`SKILL.md`, `usage.md`, or `style-guide.md` is now missing from
`crates/` or from gpui. The vendored guide copies are still
byte-identical to `website/docs/` (#2805's CI check stays green),
`typos` passes, and the website skills loader resolves all three skills.
## Not fixed here
`crates/story/src/stories/alert_dialog_story.rs:110` uses "Are you sure
you want to delete this file? This action cannot be undone." — the same
copy pattern the guides forbid, in shipped story code rather than in a
skill. Left alone as out of scope; worth a separate pass over the
stories.
<sub>Audit and changes were AI-assisted (Claude Code).</sub>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com> J
Jason Lee committed
fe6ef87e5804eb98c613db322052b25fa9b5b56e
Parent: bc1b8e2
Committed by GitHub <noreply@github.com>
on 8/23/2026, 3:50:25 PM