Re-vendor the native UI kit at 278430d

- Upstream merged core, data, editor, and utils into a single `components` crate: `ui::button`, `ui::tabs`, `ui::code`, `ui::tree`, `ui::sidebar` are flat, and `h_flex`/`v_flex`/`StyledExt` live in `ui::common` and `ui::layout`.
- Adopts the new wrapper-less component module tree, the merged theme/icon updates, and the relocated editor grammars.
- Titlebar repo tabs use the new `TabsVariant::Titlebar` capsule sizing.
- Doc examples now import from `ui::`, so all 44 doctests compile; the clipboard sample no longer names the kit crate.
- docs/ui-gaps.md records that `ui` has no dock/view-registry API instead of the deleted `DockState`.
This commit is contained in:
2026-11-17 09:49:10 +07:00
parent 71f4ec0b6b
commit 8f96a2cc16
80 changed files with 1524 additions and 2037 deletions
+2 -54
View File
@@ -6,8 +6,8 @@
use gpui::Hsla;
use super::narrow_component;
use crate::theme::ThemeVariant;
use crate::theme::system::AccessibilityPreferences;
use crate::theme::{ThemeVariant, system::AccessibilityPreferences};
/// The raw portal values, already converted off the DBus wire types.
#[derive(Clone, Copy, Debug, Default, PartialEq)]
@@ -176,55 +176,3 @@ pub(crate) mod io {
)
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn the_full_appearance_decodes() {
let appearance = AppearanceValues {
color_scheme: Some(1),
accent_rgb: Some((0.48, 0.62, 0.89)),
contrast: Some(0),
reduced_motion: Some(0),
}
.decode();
assert_eq!(
appearance.variant(crate::theme::ThemeVariant::Light),
crate::theme::ThemeVariant::Dark
);
let accent = appearance.accent.expect("accent decodes");
let rgba = gpui::Rgba::from(accent);
assert!(rgba.b > rgba.r);
}
#[test]
fn no_preference_yields_the_callers_variant() {
let appearance = AppearanceValues {
color_scheme: Some(0),
..AppearanceValues::default()
}
.decode();
assert_eq!(
appearance.variant(crate::theme::ThemeVariant::Light),
crate::theme::ThemeVariant::Light
);
}
#[test]
fn accessibility_flags_forward() {
let accessibility = AppearanceValues {
contrast: Some(1),
reduced_motion: Some(1),
..AppearanceValues::default()
}
.decode()
.accessibility();
assert!(accessibility.high_contrast);
assert!(accessibility.reduce_motion);
assert!(!accessibility.reduce_transparency);
}
}