diff --git a/AGENTS.md b/AGENTS.md index 922e8c25..df8b559d 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -2,7 +2,10 @@ * Prioritize code correctness and clarity. Speed and efficiency are secondary priorities unless otherwise specified. * Do not write organizational or comments that summarize the code. Comments should only be written in order to explain "why" the code is written in some way in the case there is a reason that is tricky / non-obvious. +* Keep doc comments and comments simple, one line, straightforward, and unbloated. * Prefer implementing functionality in existing files unless it is a new logical component. Avoid creating many small files. +* Prefer `impl` blocks over standalone functions: place functionality as methods or associated functions on the relevant type, extending the type's existing `impl` block instead of creating a duplicate one in another file. +* Bind a global store handle to a local before using it (`let state = GlobalState::global(cx);` then `state.update(...)`) instead of chaining on `GlobalState::global(cx)` inline. * Avoid using functions that panic like `unwrap()`, instead use mechanisms like `?` to propagate errors. * Be careful with operations like indexing which may panic if the indexes are out of bounds. * Never silently discard errors with `let _ =` on fallible operations. Always handle errors appropriately: @@ -81,6 +84,8 @@ Both `cx.spawn` and `cx.background_spawn` return a `Task`, which is a future A task which doesn't do anything but provide a value can be created with `Task::ready(value)`. +Prefer keeping a task in a field over `.detach()` when the work belongs to a view or store. A detached task outlives the view that started it (for example, a repository panel the user has closed), while a task stored in a field is cancelled when that struct drops. A finished `Task` held in a container is not reaped by GPUI - it stays alive until its handle is dropped - so if the container can accumulate many runs, either drop the finished handles before pushing a new one, or hold a single `Option>` and replace it. + ## Elements The `Render` trait is used to render some state into an element tree that is laid out using flexbox layout. An `Entity` where `T` implements `Render` is sometimes called a "view". diff --git a/Cargo.lock b/Cargo.lock index dea96ae8..5782086e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8042,7 +8042,7 @@ dependencies = [ "gpui-base", "gpui-pre", "instant", - "serde", + "log", "smallvec", "theme", "uuid", diff --git a/assets/themes/aurora.json b/assets/themes/aurora.json deleted file mode 100644 index 83d78f8c..00000000 --- a/assets/themes/aurora.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "id": "aurora", - "name": "Aurora", - "author": "Coop", - "url": "https://coopchat.xyz", - "light": { - "background": "#fdfcfeff", - "surface_background": "#f8f8ffff", - "elevated_surface_background": "#f0f1feff", - "panel_background": "#fdfcfeff", - "overlay": "#211f4300", - "title_bar": "#f0f1feff", - "title_bar_inactive": "#fdfcfeff", - "window_border": "#dadcffff", - "border": "#dadcffff", - "border_variant": "#cbcdffff", - "border_focused": "#5b5bd6ff", - "border_selected": "#5b5bd6ff", - "border_transparent": "#00000000", - "border_disabled": "#e6e7ffff", - "ring": "#5151cdff", - "text": "#1f2d5cff", - "text_muted": "#5753c6ff", - "text_placeholder": "#9b9ef0ff", - "text_accent": "#5b5bd6ff", - "text_danger": "#e54d2eff", - "text_warning": "#f76b15ff", - "icon": "#5753c6ff", - "icon_muted": "#9b9ef0ff", - "icon_accent": "#5151cdff", - "element_foreground": "#ffffffff", - "element_background": "#5b5bd6ff", - "element_hover": "#5151cdff", - "element_active": "#6e56cfff", - "element_selected": "#654dc4ff", - "element_disabled": "#5b5bd64d", - "secondary_foreground": "#1f2d5cff", - "secondary_background": "#f0f1feff", - "secondary_hover": "#e6e7ffff", - "secondary_active": "#dadcffff", - "secondary_selected": "#dadcffff", - "secondary_disabled": "#5b5bd64d", - "danger_foreground": "#ffffffff", - "danger_background": "#feebe7ff", - "danger_hover": "#ffcdc2ff", - "danger_active": "#fdbdafff", - "danger_selected": "#fdbdafff", - "danger_disabled": "#e54d2e4d", - "warning_foreground": "#ffffffff", - "warning_background": "#fff7edff", - "warning_hover": "#ffd19aff", - "warning_active": "#ffc182ff", - "warning_selected": "#ffc182ff", - "warning_disabled": "#f76b154d", - "ghost_element_background": "#00000000", - "ghost_element_background_alt": "#f0f1feff", - "ghost_element_hover": "#211f430d", - "ghost_element_active": "#211f431a", - "ghost_element_selected": "#211f431a", - "ghost_element_disabled": "#211f4305", - "tab_background": "#f0f1feff", - "tab_foreground": "#5753c6ff", - "tab_hover_background": "#211f430d", - "tab_active_background": "#fdfcfeff", - "tab_active_foreground": "#1f2d5cff", - "scrollbar_thumb_background": "#211f431a", - "scrollbar_thumb_hover_background": "#211f4326", - "scrollbar_thumb_border": "#00000000", - "scrollbar_track_background": "#00000000", - "scrollbar_track_border": "#00000000", - "drop_target_background": "#5b5bd61a", - "cursor": "#5b5bd6ff", - "selection": "#5b5bd640" - }, - "dark": { - "background": "#14121fff", - "surface_background": "#1b1525ff", - "elevated_surface_background": "#291f43ff", - "panel_background": "#14121fff", - "overlay": "#baa7ff1a", - "title_bar": "#291f43ff", - "title_bar_inactive": "#14121fff", - "window_border": "#473876ff", - "border": "#473876ff", - "border_variant": "#3c2e69ff", - "border_focused": "#7d66d9ff", - "border_selected": "#7d66d9ff", - "border_transparent": "#00000000", - "border_disabled": "#33255bff", - "ring": "#6e56cfff", - "text": "#e2ddfeff", - "text_muted": "#baa7ffff", - "text_placeholder": "#6958adff", - "text_accent": "#baa7ffff", - "text_danger": "#ff977dff", - "text_warning": "#ffa057ff", - "icon": "#baa7ffff", - "icon_muted": "#6958adff", - "icon_accent": "#6e56cfff", - "element_foreground": "#14121fff", - "element_background": "#7d66d9ff", - "element_hover": "#baa7ffff", - "element_active": "#6e56cfff", - "element_selected": "#654dc4ff", - "element_disabled": "#7d66d94d", - "secondary_foreground": "#e2ddfeff", - "secondary_background": "#291f43ff", - "secondary_hover": "#33255bff", - "secondary_active": "#3c2e69ff", - "secondary_selected": "#3c2e69ff", - "secondary_disabled": "#7d66d94d", - "danger_foreground": "#181111ff", - "danger_background": "#391714ff", - "danger_hover": "#5e1c16ff", - "danger_active": "#6e2920ff", - "danger_selected": "#6e2920ff", - "danger_disabled": "#ff977d4d", - "warning_foreground": "#17120eff", - "warning_background": "#331e0bff", - "warning_hover": "#562800ff", - "warning_active": "#66350cff", - "warning_selected": "#66350cff", - "warning_disabled": "#ffa0574d", - "ghost_element_background": "#00000000", - "ghost_element_background_alt": "#291f43ff", - "ghost_element_hover": "#baa7ff0d", - "ghost_element_active": "#baa7ff1a", - "ghost_element_selected": "#baa7ff1a", - "ghost_element_disabled": "#baa7ff05", - "tab_background": "#291f43ff", - "tab_foreground": "#baa7ffff", - "tab_hover_background": "#baa7ff0d", - "tab_active_background": "#14121fff", - "tab_active_foreground": "#e2ddfeff", - "scrollbar_thumb_background": "#baa7ff1a", - "scrollbar_thumb_hover_background": "#baa7ff26", - "scrollbar_thumb_border": "#00000000", - "scrollbar_track_background": "#00000000", - "scrollbar_track_border": "#00000000", - "drop_target_background": "#baa7ff1a", - "cursor": "#baa7ffff", - "selection": "#baa7ff40" - } -} diff --git a/assets/themes/catppuccin-frappe.json b/assets/themes/catppuccin-frappe.json deleted file mode 100644 index a1b42732..00000000 --- a/assets/themes/catppuccin-frappe.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "id": "catppuccin-frappe", - "name": "Catppuccin Frappé", - "author": "Catppuccin Org (ported by Coop)", - "url": "https://catppuccin.com", - "light": { - "background": "#303446", - "surface_background": "#292c3c", - "elevated_surface_background": "#232634", - "panel_background": "#303446", - "overlay": "#c6d0f51a", - "title_bar": "#232634", - "title_bar_inactive": "#303446", - "window_border": "#51576d", - "border": "#51576d", - "border_variant": "#414559", - "border_focused": "#8caaee", - "border_selected": "#8caaee", - "border_transparent": "#c6d0f500", - "border_disabled": "#292c3c", - "ring": "#babbf1", - "text": "#c6d0f5", - "text_muted": "#a5adce", - "text_placeholder": "#838ba7", - "text_accent": "#8caaee", - "text_danger": "#e78284", - "text_warning": "#ef9f76", - "icon": "#a5adce", - "icon_muted": "#838ba7", - "icon_accent": "#babbf1", - "element_foreground": "#303446", - "element_background": "#8caaee", - "element_hover": "#babbf1", - "element_active": "#99d1db", - "element_selected": "#85c1dc", - "element_disabled": "#8caaee4d", - "secondary_foreground": "#c6d0f5", - "secondary_background": "#414559", - "secondary_hover": "#51576d", - "secondary_active": "#626880", - "secondary_selected": "#626880", - "secondary_disabled": "#8caaee4d", - "danger_foreground": "#303446", - "danger_background": "#e78284", - "danger_hover": "#ea999c", - "danger_active": "#ef9f76", - "danger_selected": "#e5c890", - "danger_disabled": "#e782844d", - "warning_foreground": "#303446", - "warning_background": "#ef9f76", - "warning_hover": "#e5c890", - "warning_active": "#a6d189", - "warning_selected": "#81c8be", - "warning_disabled": "#ef9f764d", - "ghost_element_background": "#c6d0f500", - "ghost_element_background_alt": "#292c3c", - "ghost_element_hover": "#c6d0f50d", - "ghost_element_active": "#c6d0f51a", - "ghost_element_selected": "#c6d0f51a", - "ghost_element_disabled": "#c6d0f505", - "tab_background": "#232634", - "tab_foreground": "#a5adce", - "tab_hover_background": "#c6d0f50d", - "tab_active_background": "#303446", - "tab_active_foreground": "#c6d0f5", - "scrollbar_thumb_background": "#c6d0f51a", - "scrollbar_thumb_hover_background": "#c6d0f526", - "scrollbar_thumb_border": "#c6d0f500", - "scrollbar_track_background": "#c6d0f500", - "scrollbar_track_border": "#c6d0f500", - "drop_target_background": "#8caaee1a", - "cursor": "#8caaee", - "selection": "#8caaee40" - }, - "dark": { - "background": "#303446", - "surface_background": "#292c3c", - "elevated_surface_background": "#232634", - "panel_background": "#303446", - "overlay": "#c6d0f51a", - "title_bar": "#232634", - "title_bar_inactive": "#303446", - "window_border": "#51576d", - "border": "#51576d", - "border_variant": "#414559", - "border_focused": "#8caaee", - "border_selected": "#8caaee", - "border_transparent": "#c6d0f500", - "border_disabled": "#292c3c", - "ring": "#babbf1", - "text": "#c6d0f5", - "text_muted": "#a5adce", - "text_placeholder": "#838ba7", - "text_accent": "#8caaee", - "text_danger": "#e78284", - "text_warning": "#ef9f76", - "icon": "#a5adce", - "icon_muted": "#838ba7", - "icon_accent": "#babbf1", - "element_foreground": "#303446", - "element_background": "#8caaee", - "element_hover": "#babbf1", - "element_active": "#99d1db", - "element_selected": "#85c1dc", - "element_disabled": "#8caaee4d", - "secondary_foreground": "#c6d0f5", - "secondary_background": "#414559", - "secondary_hover": "#51576d", - "secondary_active": "#626880", - "secondary_selected": "#626880", - "secondary_disabled": "#8caaee4d", - "danger_foreground": "#303446", - "danger_background": "#e78284", - "danger_hover": "#ea999c", - "danger_active": "#ef9f76", - "danger_selected": "#e5c890", - "danger_disabled": "#e782844d", - "warning_foreground": "#303446", - "warning_background": "#ef9f76", - "warning_hover": "#e5c890", - "warning_active": "#a6d189", - "warning_selected": "#81c8be", - "warning_disabled": "#ef9f764d", - "ghost_element_background": "#c6d0f500", - "ghost_element_background_alt": "#292c3c", - "ghost_element_hover": "#c6d0f50d", - "ghost_element_active": "#c6d0f51a", - "ghost_element_selected": "#c6d0f51a", - "ghost_element_disabled": "#c6d0f505", - "tab_background": "#232634", - "tab_foreground": "#a5adce", - "tab_hover_background": "#c6d0f50d", - "tab_active_background": "#303446", - "tab_active_foreground": "#c6d0f5", - "scrollbar_thumb_background": "#c6d0f51a", - "scrollbar_thumb_hover_background": "#c6d0f526", - "scrollbar_thumb_border": "#c6d0f500", - "scrollbar_track_background": "#c6d0f500", - "scrollbar_track_border": "#c6d0f500", - "drop_target_background": "#8caaee1a", - "cursor": "#8caaee", - "selection": "#8caaee40" - } -} diff --git a/assets/themes/catppuccin-latte.json b/assets/themes/catppuccin-latte.json deleted file mode 100644 index c9dedbdb..00000000 --- a/assets/themes/catppuccin-latte.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "id": "catppuccin-latte", - "name": "Catppuccin Latte", - "author": "Catppuccin Org (ported by Coop)", - "url": "https://catppuccin.com", - "light": { - "background": "#eff1f5", - "surface_background": "#e6e9ef", - "elevated_surface_background": "#dce0e8", - "panel_background": "#eff1f5", - "overlay": "#4c4f691a", - "title_bar": "#dce0e8", - "title_bar_inactive": "#eff1f5", - "window_border": "#bcc0cc", - "border": "#bcc0cc", - "border_variant": "#ccd0da", - "border_focused": "#1e66f5", - "border_selected": "#1e66f5", - "border_transparent": "#4c4f6900", - "border_disabled": "#e6e9ef", - "ring": "#7287fd", - "text": "#4c4f69", - "text_muted": "#6c6f85", - "text_placeholder": "#8c8fa1", - "text_accent": "#1e66f5", - "text_danger": "#d20f39", - "text_warning": "#fe640b", - "icon": "#6c6f85", - "icon_muted": "#8c8fa1", - "icon_accent": "#7287fd", - "element_foreground": "#eff1f5", - "element_background": "#1e66f5", - "element_hover": "#7287fd", - "element_active": "#04a5e5", - "element_selected": "#209fb5", - "element_disabled": "#1e66f54d", - "secondary_foreground": "#4c4f69", - "secondary_background": "#ccd0da", - "secondary_hover": "#bcc0cc", - "secondary_active": "#acb0be", - "secondary_selected": "#acb0be", - "secondary_disabled": "#1e66f54d", - "danger_foreground": "#eff1f5", - "danger_background": "#d20f39", - "danger_hover": "#e64553", - "danger_active": "#fe640b", - "danger_selected": "#df8e1d", - "danger_disabled": "#d20f394d", - "warning_foreground": "#eff1f5", - "warning_background": "#fe640b", - "warning_hover": "#df8e1d", - "warning_active": "#40a02b", - "warning_selected": "#179299", - "warning_disabled": "#fe640b4d", - "ghost_element_background": "#4c4f6900", - "ghost_element_background_alt": "#e6e9ef", - "ghost_element_hover": "#4c4f690d", - "ghost_element_active": "#4c4f691a", - "ghost_element_selected": "#4c4f691a", - "ghost_element_disabled": "#4c4f6905", - "tab_background": "#e6e9ef", - "tab_foreground": "#6c6f85", - "tab_hover_background": "#4c4f690d", - "tab_active_background": "#eff1f5", - "tab_active_foreground": "#4c4f69", - "scrollbar_thumb_background": "#4c4f691a", - "scrollbar_thumb_hover_background": "#4c4f6926", - "scrollbar_thumb_border": "#4c4f6900", - "scrollbar_track_background": "#4c4f6900", - "scrollbar_track_border": "#4c4f6900", - "drop_target_background": "#1e66f51a", - "cursor": "#1e66f5", - "selection": "#1e66f540" - }, - "dark": { - "background": "#eff1f5", - "surface_background": "#e6e9ef", - "elevated_surface_background": "#dce0e8", - "panel_background": "#eff1f5", - "overlay": "#4c4f691a", - "title_bar": "#dce0e8", - "title_bar_inactive": "#eff1f5", - "window_border": "#bcc0cc", - "border": "#bcc0cc", - "border_variant": "#ccd0da", - "border_focused": "#1e66f5", - "border_selected": "#1e66f5", - "border_transparent": "#4c4f6900", - "border_disabled": "#e6e9ef", - "ring": "#7287fd", - "text": "#4c4f69", - "text_muted": "#6c6f85", - "text_placeholder": "#8c8fa1", - "text_accent": "#1e66f5", - "text_danger": "#d20f39", - "text_warning": "#fe640b", - "icon": "#6c6f85", - "icon_muted": "#8c8fa1", - "icon_accent": "#7287fd", - "element_foreground": "#eff1f5", - "element_background": "#1e66f5", - "element_hover": "#7287fd", - "element_active": "#04a5e5", - "element_selected": "#209fb5", - "element_disabled": "#1e66f54d", - "secondary_foreground": "#4c4f69", - "secondary_background": "#ccd0da", - "secondary_hover": "#bcc0cc", - "secondary_active": "#acb0be", - "secondary_selected": "#acb0be", - "secondary_disabled": "#1e66f54d", - "danger_foreground": "#eff1f5", - "danger_background": "#d20f39", - "danger_hover": "#e64553", - "danger_active": "#fe640b", - "danger_selected": "#df8e1d", - "danger_disabled": "#d20f394d", - "warning_foreground": "#eff1f5", - "warning_background": "#fe640b", - "warning_hover": "#df8e1d", - "warning_active": "#40a02b", - "warning_selected": "#179299", - "warning_disabled": "#fe640b4d", - "ghost_element_background": "#4c4f6900", - "ghost_element_background_alt": "#e6e9ef", - "ghost_element_hover": "#4c4f690d", - "ghost_element_active": "#4c4f691a", - "ghost_element_selected": "#4c4f691a", - "ghost_element_disabled": "#4c4f6905", - "tab_background": "#e6e9ef", - "tab_foreground": "#6c6f85", - "tab_hover_background": "#4c4f690d", - "tab_active_background": "#eff1f5", - "tab_active_foreground": "#4c4f69", - "scrollbar_thumb_background": "#4c4f691a", - "scrollbar_thumb_hover_background": "#4c4f6926", - "scrollbar_thumb_border": "#4c4f6900", - "scrollbar_track_background": "#4c4f6900", - "scrollbar_track_border": "#4c4f6900", - "drop_target_background": "#1e66f51a", - "cursor": "#1e66f5", - "selection": "#1e66f540" - } -} diff --git a/assets/themes/catppuccin-macchiato.json b/assets/themes/catppuccin-macchiato.json deleted file mode 100644 index d19a93a1..00000000 --- a/assets/themes/catppuccin-macchiato.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "id": "catppuccin-macchiato", - "name": "Catppuccin Macchiato", - "author": "Catppuccin Org (ported by Coop)", - "url": "https://catppuccin.com", - "light": { - "background": "#24273a", - "surface_background": "#1e2030", - "elevated_surface_background": "#181926", - "panel_background": "#24273a", - "overlay": "#cad3f51a", - "title_bar": "#181926", - "title_bar_inactive": "#24273a", - "window_border": "#494d64", - "border": "#494d64", - "border_variant": "#363a4f", - "border_focused": "#8aadf4", - "border_selected": "#8aadf4", - "border_transparent": "#cad3f500", - "border_disabled": "#1e2030", - "ring": "#b7bdf8", - "text": "#cad3f5", - "text_muted": "#a5adcb", - "text_placeholder": "#8087a2", - "text_accent": "#8aadf4", - "text_danger": "#ed8796", - "text_warning": "#f5a97f", - "icon": "#a5adcb", - "icon_muted": "#8087a2", - "icon_accent": "#b7bdf8", - "element_foreground": "#24273a", - "element_background": "#8aadf4", - "element_hover": "#b7bdf8", - "element_active": "#91d7e3", - "element_selected": "#7dc4e4", - "element_disabled": "#8aadf44d", - "secondary_foreground": "#cad3f5", - "secondary_background": "#363a4f", - "secondary_hover": "#494d64", - "secondary_active": "#5b6078", - "secondary_selected": "#5b6078", - "secondary_disabled": "#8aadf44d", - "danger_foreground": "#24273a", - "danger_background": "#ed8796", - "danger_hover": "#ee99a0", - "danger_active": "#f5a97f", - "danger_selected": "#eed49f", - "danger_disabled": "#ed87964d", - "warning_foreground": "#24273a", - "warning_background": "#f5a97f", - "warning_hover": "#eed49f", - "warning_active": "#a6da95", - "warning_selected": "#8bd5ca", - "warning_disabled": "#f5a97f4d", - "ghost_element_background": "#cad3f500", - "ghost_element_background_alt": "#1e2030", - "ghost_element_hover": "#cad3f50d", - "ghost_element_active": "#cad3f51a", - "ghost_element_selected": "#cad3f51a", - "ghost_element_disabled": "#cad3f505", - "tab_background": "#181926", - "tab_foreground": "#a5adcb", - "tab_hover_background": "#cad3f50d", - "tab_active_background": "#24273a", - "tab_active_foreground": "#cad3f5", - "scrollbar_thumb_background": "#cad3f51a", - "scrollbar_thumb_hover_background": "#cad3f526", - "scrollbar_thumb_border": "#cad3f500", - "scrollbar_track_background": "#cad3f500", - "scrollbar_track_border": "#cad3f500", - "drop_target_background": "#8aadf41a", - "cursor": "#8aadf4", - "selection": "#8aadf440" - }, - "dark": { - "background": "#24273a", - "surface_background": "#1e2030", - "elevated_surface_background": "#181926", - "panel_background": "#24273a", - "overlay": "#cad3f51a", - "title_bar": "#181926", - "title_bar_inactive": "#24273a", - "window_border": "#494d64", - "border": "#494d64", - "border_variant": "#363a4f", - "border_focused": "#8aadf4", - "border_selected": "#8aadf4", - "border_transparent": "#cad3f500", - "border_disabled": "#1e2030", - "ring": "#b7bdf8", - "text": "#cad3f5", - "text_muted": "#a5adcb", - "text_placeholder": "#8087a2", - "text_accent": "#8aadf4", - "text_danger": "#ed8796", - "text_warning": "#f5a97f", - "icon": "#a5adcb", - "icon_muted": "#8087a2", - "icon_accent": "#b7bdf8", - "element_foreground": "#24273a", - "element_background": "#8aadf4", - "element_hover": "#b7bdf8", - "element_active": "#91d7e3", - "element_selected": "#7dc4e4", - "element_disabled": "#8aadf44d", - "secondary_foreground": "#cad3f5", - "secondary_background": "#363a4f", - "secondary_hover": "#494d64", - "secondary_active": "#5b6078", - "secondary_selected": "#5b6078", - "secondary_disabled": "#8aadf44d", - "danger_foreground": "#24273a", - "danger_background": "#ed8796", - "danger_hover": "#ee99a0", - "danger_active": "#f5a97f", - "danger_selected": "#eed49f", - "danger_disabled": "#ed87964d", - "warning_foreground": "#24273a", - "warning_background": "#f5a97f", - "warning_hover": "#eed49f", - "warning_active": "#a6da95", - "warning_selected": "#8bd5ca", - "warning_disabled": "#f5a97f4d", - "ghost_element_background": "#cad3f500", - "ghost_element_background_alt": "#1e2030", - "ghost_element_hover": "#cad3f50d", - "ghost_element_active": "#cad3f51a", - "ghost_element_selected": "#cad3f51a", - "ghost_element_disabled": "#cad3f505", - "tab_background": "#181926", - "tab_foreground": "#a5adcb", - "tab_hover_background": "#cad3f50d", - "tab_active_background": "#24273a", - "tab_active_foreground": "#cad3f5", - "scrollbar_thumb_background": "#cad3f51a", - "scrollbar_thumb_hover_background": "#cad3f526", - "scrollbar_thumb_border": "#cad3f500", - "scrollbar_track_background": "#cad3f500", - "scrollbar_track_border": "#cad3f500", - "drop_target_background": "#8aadf41a", - "cursor": "#8aadf4", - "selection": "#8aadf440" - } -} diff --git a/assets/themes/catppuccin-mocha.json b/assets/themes/catppuccin-mocha.json deleted file mode 100644 index fd987c83..00000000 --- a/assets/themes/catppuccin-mocha.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "id": "catppuccin-mocha", - "name": "Catppuccin Mocha", - "author": "Catppuccin Org (ported by Coop)", - "url": "https://catppuccin.com", - "light": { - "background": "#1e1e2e", - "surface_background": "#181825", - "elevated_surface_background": "#11111b", - "panel_background": "#1e1e2e", - "overlay": "#cdd6f41a", - "title_bar": "#11111b", - "title_bar_inactive": "#1e1e2e", - "window_border": "#45475a", - "border": "#45475a", - "border_variant": "#313244", - "border_focused": "#89b4fa", - "border_selected": "#89b4fa", - "border_transparent": "#cdd6f400", - "border_disabled": "#181825", - "ring": "#b4befe", - "text": "#cdd6f4", - "text_muted": "#a6adc8", - "text_placeholder": "#7f849c", - "text_accent": "#89b4fa", - "text_danger": "#f38ba8", - "text_warning": "#fab387", - "icon": "#a6adc8", - "icon_muted": "#7f849c", - "icon_accent": "#b4befe", - "element_foreground": "#1e1e2e", - "element_background": "#89b4fa", - "element_hover": "#b4befe", - "element_active": "#89dceb", - "element_selected": "#74c7ec", - "element_disabled": "#89b4fa4d", - "secondary_foreground": "#cdd6f4", - "secondary_background": "#313244", - "secondary_hover": "#45475a", - "secondary_active": "#585b70", - "secondary_selected": "#585b70", - "secondary_disabled": "#89b4fa4d", - "danger_foreground": "#1e1e2e", - "danger_background": "#f38ba8", - "danger_hover": "#eba0ac", - "danger_active": "#fab387", - "danger_selected": "#f9e2af", - "danger_disabled": "#f38ba84d", - "warning_foreground": "#1e1e2e", - "warning_background": "#fab387", - "warning_hover": "#f9e2af", - "warning_active": "#a6e3a1", - "warning_selected": "#94e2d5", - "warning_disabled": "#fab3874d", - "ghost_element_background": "#cdd6f400", - "ghost_element_background_alt": "#181825", - "ghost_element_hover": "#cdd6f40d", - "ghost_element_active": "#cdd6f41a", - "ghost_element_selected": "#cdd6f41a", - "ghost_element_disabled": "#cdd6f405", - "tab_background": "#11111b", - "tab_foreground": "#a6adc8", - "tab_hover_background": "#cdd6f40d", - "tab_active_background": "#1e1e2e", - "tab_active_foreground": "#cdd6f4", - "scrollbar_thumb_background": "#cdd6f41a", - "scrollbar_thumb_hover_background": "#cdd6f426", - "scrollbar_thumb_border": "#cdd6f400", - "scrollbar_track_background": "#cdd6f400", - "scrollbar_track_border": "#cdd6f400", - "drop_target_background": "#89b4fa1a", - "cursor": "#89b4fa", - "selection": "#89b4fa40" - }, - "dark": { - "background": "#1e1e2e", - "surface_background": "#181825", - "elevated_surface_background": "#11111b", - "panel_background": "#1e1e2e", - "overlay": "#cdd6f41a", - "title_bar": "#11111b", - "title_bar_inactive": "#1e1e2e", - "window_border": "#45475a", - "border": "#45475a", - "border_variant": "#313244", - "border_focused": "#89b4fa", - "border_selected": "#89b4fa", - "border_transparent": "#cdd6f400", - "border_disabled": "#181825", - "ring": "#b4befe", - "text": "#cdd6f4", - "text_muted": "#a6adc8", - "text_placeholder": "#7f849c", - "text_accent": "#89b4fa", - "text_danger": "#f38ba8", - "text_warning": "#fab387", - "icon": "#a6adc8", - "icon_muted": "#7f849c", - "icon_accent": "#b4befe", - "element_foreground": "#1e1e2e", - "element_background": "#89b4fa", - "element_hover": "#b4befe", - "element_active": "#89dceb", - "element_selected": "#74c7ec", - "element_disabled": "#89b4fa4d", - "secondary_foreground": "#cdd6f4", - "secondary_background": "#313244", - "secondary_hover": "#45475a", - "secondary_active": "#585b70", - "secondary_selected": "#585b70", - "secondary_disabled": "#89b4fa4d", - "danger_foreground": "#1e1e2e", - "danger_background": "#f38ba8", - "danger_hover": "#eba0ac", - "danger_active": "#fab387", - "danger_selected": "#f9e2af", - "danger_disabled": "#f38ba84d", - "warning_foreground": "#1e1e2e", - "warning_background": "#fab387", - "warning_hover": "#f9e2af", - "warning_active": "#a6e3a1", - "warning_selected": "#94e2d5", - "warning_disabled": "#fab3874d", - "ghost_element_background": "#cdd6f400", - "ghost_element_background_alt": "#181825", - "ghost_element_hover": "#cdd6f40d", - "ghost_element_active": "#cdd6f41a", - "ghost_element_selected": "#cdd6f41a", - "ghost_element_disabled": "#cdd6f405", - "tab_background": "#11111b", - "tab_foreground": "#a6adc8", - "tab_hover_background": "#cdd6f40d", - "tab_active_background": "#1e1e2e", - "tab_active_foreground": "#cdd6f4", - "scrollbar_thumb_background": "#cdd6f41a", - "scrollbar_thumb_hover_background": "#cdd6f426", - "scrollbar_thumb_border": "#cdd6f400", - "scrollbar_track_background": "#cdd6f400", - "scrollbar_track_border": "#cdd6f400", - "drop_target_background": "#89b4fa1a", - "cursor": "#89b4fa", - "selection": "#89b4fa40" - } -} diff --git a/assets/themes/flexoki.json b/assets/themes/flexoki.json deleted file mode 100644 index b7ee4148..00000000 --- a/assets/themes/flexoki.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "id": "flexoki", - "name": "Flexoki", - "author": "Steph Ango (ported by Coop)", - "url": "https://stephango.com/flexoki", - "light": { - "background": "#FFFCF0", - "surface_background": "#F2F0E5", - "elevated_surface_background": "#E6E4D9", - "panel_background": "#FFFCF0", - "overlay": "#100F0F1A", - "title_bar": "#E6E4D9", - "title_bar_inactive": "#FFFCF0", - "window_border": "#CECDC3", - "border": "#CECDC3", - "border_variant": "#DAD8CE", - "border_focused": "#24837B", - "border_selected": "#24837B", - "border_transparent": "#100F0F00", - "border_disabled": "#E6E4D9", - "ring": "#3AA99F", - "text": "#100F0F", - "text_muted": "#6F6E69", - "text_placeholder": "#B7B5AC", - "text_accent": "#24837B", - "text_danger": "#AF3029", - "text_warning": "#BC5215", - "icon": "#6F6E69", - "icon_muted": "#B7B5AC", - "icon_accent": "#3AA99F", - "element_foreground": "#FFFCF0", - "element_background": "#24837B", - "element_hover": "#3AA99F", - "element_active": "#1C1B1A", - "element_selected": "#100F0F", - "element_disabled": "#24837B4D", - "secondary_foreground": "#100F0F", - "secondary_background": "#E6E4D9", - "secondary_hover": "#DAD8CE", - "secondary_active": "#CECDC3", - "secondary_selected": "#CECDC3", - "secondary_disabled": "#24837B4D", - "danger_foreground": "#FFFCF0", - "danger_background": "#AF3029", - "danger_hover": "#D14D41", - "danger_active": "#1C1B1A", - "danger_selected": "#100F0F", - "danger_disabled": "#AF30294D", - "warning_foreground": "#FFFCF0", - "warning_background": "#BC5215", - "warning_hover": "#DA702C", - "warning_active": "#1C1B1A", - "warning_selected": "#100F0F", - "warning_disabled": "#BC52154D", - "ghost_element_background": "#100F0F00", - "ghost_element_background_alt": "#F2F0E5", - "ghost_element_hover": "#100F0F0D", - "ghost_element_active": "#100F0F1A", - "ghost_element_selected": "#100F0F1A", - "ghost_element_disabled": "#100F0F05", - "tab_background": "#E6E4D9", - "tab_foreground": "#6F6E69", - "tab_hover_background": "#100F0F0D", - "tab_active_background": "#FFFCF0", - "tab_active_foreground": "#100F0F", - "scrollbar_thumb_background": "#100F0F1A", - "scrollbar_thumb_hover_background": "#100F0F26", - "scrollbar_thumb_border": "#100F0F00", - "scrollbar_track_background": "#100F0F00", - "scrollbar_track_border": "#100F0F00", - "drop_target_background": "#24837B1A", - "cursor": "#24837B", - "selection": "#24837B40" - }, - "dark": { - "background": "#100F0F", - "surface_background": "#1C1B1A", - "elevated_surface_background": "#282726", - "panel_background": "#100F0F", - "overlay": "#FFFCF01A", - "title_bar": "#282726", - "title_bar_inactive": "#100F0F", - "window_border": "#403E3C", - "border": "#403E3C", - "border_variant": "#343331", - "border_focused": "#3AA99F", - "border_selected": "#3AA99F", - "border_transparent": "#100F0F00", - "border_disabled": "#282726", - "ring": "#24837B", - "text": "#CECDC3", - "text_muted": "#878580", - "text_placeholder": "#575653", - "text_accent": "#3AA99F", - "text_danger": "#D14D41", - "text_warning": "#DA702C", - "icon": "#878580", - "icon_muted": "#575653", - "icon_accent": "#24837B", - "element_foreground": "#100F0F", - "element_background": "#3AA99F", - "element_hover": "#24837B", - "element_active": "#CECDC3", - "element_selected": "#F2F0E5", - "element_disabled": "#3AA99F4D", - "secondary_foreground": "#CECDC3", - "secondary_background": "#1C1B1A", - "secondary_hover": "#282726", - "secondary_active": "#343331", - "secondary_selected": "#343331", - "secondary_disabled": "#3AA99F4D", - "danger_foreground": "#100F0F", - "danger_background": "#D14D41", - "danger_hover": "#AF3029", - "danger_active": "#CECDC3", - "danger_selected": "#F2F0E5", - "danger_disabled": "#D14D414D", - "warning_foreground": "#100F0F", - "warning_background": "#DA702C", - "warning_hover": "#BC5215", - "warning_active": "#CECDC3", - "warning_selected": "#F2F0E5", - "warning_disabled": "#DA702C4D", - "ghost_element_background": "#100F0F00", - "ghost_element_background_alt": "#1C1B1A", - "ghost_element_hover": "#FFFCF00D", - "ghost_element_active": "#FFFCF01A", - "ghost_element_selected": "#FFFCF01A", - "ghost_element_disabled": "#FFFCF005", - "tab_background": "#282726", - "tab_foreground": "#878580", - "tab_hover_background": "#FFFCF00D", - "tab_active_background": "#100F0F", - "tab_active_foreground": "#CECDC3", - "scrollbar_thumb_background": "#FFFCF01A", - "scrollbar_thumb_hover_background": "#FFFCF026", - "scrollbar_thumb_border": "#100F0F00", - "scrollbar_track_background": "#100F0F00", - "scrollbar_track_border": "#100F0F00", - "drop_target_background": "#3AA99F1A", - "cursor": "#3AA99F", - "selection": "#3AA99F40" - } -} diff --git a/assets/themes/forest.json b/assets/themes/forest.json deleted file mode 100644 index 6c3be0bf..00000000 --- a/assets/themes/forest.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "id": "forest", - "name": "Forest", - "author": "Coop", - "url": "https://coopchat.xyz", - "light": { - "background": "#fbfefcff", - "surface_background": "#f4fbf6ff", - "elevated_surface_background": "#e9f6e9ff", - "panel_background": "#fbfefcff", - "overlay": "#193b2d1a", - "title_bar": "#e9f6e9ff", - "title_bar_inactive": "#fbfefcff", - "window_border": "#c4e8d1ff", - "border": "#c4e8d1ff", - "border_variant": "#b2ddb5ff", - "border_focused": "#30a46cff", - "border_selected": "#30a46cff", - "border_transparent": "#00000000", - "border_disabled": "#e0f3e6ff", - "ring": "#2b9a66ff", - "text": "#193b2dff", - "text_muted": "#2f7c57ff", - "text_placeholder": "#8eceaaff", - "text_accent": "#30a46cff", - "text_danger": "#e54d2eff", - "text_warning": "#f76b15ff", - "icon": "#2f7c57ff", - "icon_muted": "#8eceaaff", - "icon_accent": "#2b9a66ff", - "element_foreground": "#ffffffff", - "element_background": "#30a46cff", - "element_hover": "#2b9a66ff", - "element_active": "#2a7e3bff", - "element_selected": "#218358ff", - "element_disabled": "#30a46c4d", - "secondary_foreground": "#193b2dff", - "secondary_background": "#e9f6e9ff", - "secondary_hover": "#daf1dbff", - "secondary_active": "#c4e8d1ff", - "secondary_selected": "#c4e8d1ff", - "secondary_disabled": "#30a46c4d", - "danger_foreground": "#ffffffff", - "danger_background": "#feebe7ff", - "danger_hover": "#ffcdc2ff", - "danger_active": "#fdbdafff", - "danger_selected": "#fdbdafff", - "danger_disabled": "#e54d2e4d", - "warning_foreground": "#ffffffff", - "warning_background": "#fff7edff", - "warning_hover": "#ffd19aff", - "warning_active": "#ffc182ff", - "warning_selected": "#ffc182ff", - "warning_disabled": "#f76b154d", - "ghost_element_background": "#00000000", - "ghost_element_background_alt": "#e9f6e9ff", - "ghost_element_hover": "#193b2d0d", - "ghost_element_active": "#193b2d1a", - "ghost_element_selected": "#193b2d1a", - "ghost_element_disabled": "#193b2d05", - "tab_background": "#e9f6e9ff", - "tab_foreground": "#2f7c57ff", - "tab_hover_background": "#193b2d0d", - "tab_active_background": "#fbfefcff", - "tab_active_foreground": "#193b2dff", - "scrollbar_thumb_background": "#193b2d1a", - "scrollbar_thumb_hover_background": "#193b2d26", - "scrollbar_thumb_border": "#00000000", - "scrollbar_track_background": "#00000000", - "scrollbar_track_border": "#00000000", - "drop_target_background": "#30a46c1a", - "cursor": "#30a46cff", - "selection": "#30a46c40" - }, - "dark": { - "background": "#0e1512ff", - "surface_background": "#121b17ff", - "elevated_surface_background": "#132d21ff", - "panel_background": "#0e1512ff", - "overlay": "#b1f1cb1a", - "title_bar": "#132d21ff", - "title_bar_inactive": "#0e1512ff", - "window_border": "#20573eff", - "border": "#20573eff", - "border_variant": "#174933ff", - "border_focused": "#33b074ff", - "border_selected": "#33b074ff", - "border_transparent": "#00000000", - "border_disabled": "#113b29ff", - "ring": "#33b074ff", - "text": "#b1f1cbff", - "text_muted": "#71d083ff", - "text_placeholder": "#2f7c57ff", - "text_accent": "#3dd68cff", - "text_danger": "#ff977dff", - "text_warning": "#ffa057ff", - "icon": "#71d083ff", - "icon_muted": "#2f7c57ff", - "icon_accent": "#33b074ff", - "element_foreground": "#0e1512ff", - "element_background": "#3dd68cff", - "element_hover": "#71d083ff", - "element_active": "#33b074ff", - "element_selected": "#30a46cff", - "element_disabled": "#3dd68c4d", - "secondary_foreground": "#b1f1cbff", - "secondary_background": "#132d21ff", - "secondary_hover": "#113b29ff", - "secondary_active": "#174933ff", - "secondary_selected": "#174933ff", - "secondary_disabled": "#3dd68c4d", - "danger_foreground": "#181111ff", - "danger_background": "#391714ff", - "danger_hover": "#5e1c16ff", - "danger_active": "#6e2920ff", - "danger_selected": "#6e2920ff", - "danger_disabled": "#ff977d4d", - "warning_foreground": "#17120eff", - "warning_background": "#331e0bff", - "warning_hover": "#562800ff", - "warning_active": "#66350cff", - "warning_selected": "#66350cff", - "warning_disabled": "#ffa0574d", - "ghost_element_background": "#00000000", - "ghost_element_background_alt": "#132d21ff", - "ghost_element_hover": "#b1f1cb0d", - "ghost_element_active": "#b1f1cb1a", - "ghost_element_selected": "#b1f1cb1a", - "ghost_element_disabled": "#b1f1cb05", - "tab_background": "#132d21ff", - "tab_foreground": "#71d083ff", - "tab_hover_background": "#b1f1cb0d", - "tab_active_background": "#0e1512ff", - "tab_active_foreground": "#b1f1cbff", - "scrollbar_thumb_background": "#b1f1cb1a", - "scrollbar_thumb_hover_background": "#b1f1cb26", - "scrollbar_thumb_border": "#00000000", - "scrollbar_track_background": "#00000000", - "scrollbar_track_border": "#00000000", - "drop_target_background": "#3dd68c1a", - "cursor": "#3dd68cff", - "selection": "#3dd68c40" - } -} diff --git a/assets/themes/ocean.json b/assets/themes/ocean.json deleted file mode 100644 index 6c1ce2cf..00000000 --- a/assets/themes/ocean.json +++ /dev/null @@ -1,144 +0,0 @@ -{ - "id": "ocean", - "name": "Ocean", - "author": "Coop", - "url": "https://coopchat.xyz", - "light": { - "background": "#fafefeff", - "surface_background": "#f2fbfaff", - "elevated_surface_background": "#e6f7f7ff", - "panel_background": "#fafefeff", - "overlay": "#00333f1a", - "title_bar": "#e6f7f7ff", - "title_bar_inactive": "#fafefeff", - "window_border": "#cce5e9ff", - "border": "#cce5e9ff", - "border_variant": "#b8dde3ff", - "border_focused": "#00a2c7ff", - "border_selected": "#00a2c7ff", - "border_transparent": "#00000000", - "border_disabled": "#e0f0f2ff", - "ring": "#0797b9ff", - "text": "#0d3c48ff", - "text_muted": "#107d98ff", - "text_placeholder": "#60b3d7ff", - "text_accent": "#00a2c7ff", - "text_danger": "#e54d2eff", - "text_warning": "#f76b15ff", - "icon": "#107d98ff", - "icon_muted": "#60b3d7ff", - "icon_accent": "#0797b9ff", - "element_foreground": "#ffffffff", - "element_background": "#00a2c7ff", - "element_hover": "#0797b9ff", - "element_active": "#12667eff", - "element_selected": "#0d4a5cff", - "element_disabled": "#00a2c74d", - "secondary_foreground": "#0d4a5cff", - "secondary_background": "#ddf9f2ff", - "secondary_hover": "#c8f4e9ff", - "secondary_active": "#b3ecdeff", - "secondary_selected": "#b3ecdeff", - "secondary_disabled": "#00a2c74d", - "danger_foreground": "#ffffffff", - "danger_background": "#feebe7ff", - "danger_hover": "#ffcdc2ff", - "danger_active": "#fdbdafff", - "danger_selected": "#fdbdafff", - "danger_disabled": "#e54d2e4d", - "warning_foreground": "#ffffffff", - "warning_background": "#fff7edff", - "warning_hover": "#ffd19aff", - "warning_active": "#ffc182ff", - "warning_selected": "#ffc182ff", - "warning_disabled": "#f76b154d", - "ghost_element_background": "#00000000", - "ghost_element_background_alt": "#e6f7f7ff", - "ghost_element_hover": "#00333f0d", - "ghost_element_active": "#00333f1a", - "ghost_element_selected": "#00333f1a", - "ghost_element_disabled": "#00333f05", - "tab_background": "#e6f7f7ff", - "tab_foreground": "#107d98ff", - "tab_hover_background": "#00333f0d", - "tab_active_background": "#fafefeff", - "tab_active_foreground": "#0d3c48ff", - "scrollbar_thumb_background": "#00333f1a", - "scrollbar_thumb_hover_background": "#00333f26", - "scrollbar_thumb_border": "#00000000", - "scrollbar_track_background": "#00000000", - "scrollbar_track_border": "#00000000", - "drop_target_background": "#00a2c71a", - "cursor": "#00a2c7ff", - "selection": "#00a2c740" - }, - "dark": { - "background": "#0b161aff", - "surface_background": "#101b20ff", - "elevated_surface_background": "#082c36ff", - "panel_background": "#0b161aff", - "overlay": "#c2f3ff1a", - "title_bar": "#082c36ff", - "title_bar_inactive": "#0b161aff", - "window_border": "#1b537bff", - "border": "#1b537bff", - "border_variant": "#154467ff", - "border_focused": "#00a2c7ff", - "border_selected": "#00a2c7ff", - "border_transparent": "#00000000", - "border_disabled": "#112840ff", - "ring": "#23afd0ff", - "text": "#b6ecf7ff", - "text_muted": "#4ccce6ff", - "text_placeholder": "#197caeff", - "text_accent": "#7ce2feff", - "text_danger": "#ff977dff", - "text_warning": "#ffa057ff", - "icon": "#4ccce6ff", - "icon_muted": "#197caeff", - "icon_accent": "#23afd0ff", - "element_foreground": "#0b161aff", - "element_background": "#7ce2feff", - "element_hover": "#a8eeffff", - "element_active": "#23afd0ff", - "element_selected": "#00a2c7ff", - "element_disabled": "#7ce2fe4d", - "secondary_foreground": "#adf0ddff", - "secondary_background": "#0d2d2aff", - "secondary_hover": "#023b37ff", - "secondary_active": "#084843ff", - "secondary_selected": "#084843ff", - "secondary_disabled": "#7ce2fe4d", - "danger_foreground": "#181111ff", - "danger_background": "#391714ff", - "danger_hover": "#5e1c16ff", - "danger_active": "#6e2920ff", - "danger_selected": "#6e2920ff", - "danger_disabled": "#ff977d4d", - "warning_foreground": "#17120eff", - "warning_background": "#331e0bff", - "warning_hover": "#562800ff", - "warning_active": "#66350cff", - "warning_selected": "#66350cff", - "warning_disabled": "#ffa0574d", - "ghost_element_background": "#00000000", - "ghost_element_background_alt": "#082c36ff", - "ghost_element_hover": "#c2f3ff0d", - "ghost_element_active": "#c2f3ff1a", - "ghost_element_selected": "#c2f3ff1a", - "ghost_element_disabled": "#c2f3ff05", - "tab_background": "#082c36ff", - "tab_foreground": "#4ccce6ff", - "tab_hover_background": "#c2f3ff0d", - "tab_active_background": "#0b161aff", - "tab_active_foreground": "#b6ecf7ff", - "scrollbar_thumb_background": "#c2f3ff1a", - "scrollbar_thumb_hover_background": "#c2f3ff26", - "scrollbar_thumb_border": "#00000000", - "scrollbar_track_background": "#00000000", - "scrollbar_track_border": "#00000000", - "drop_target_background": "#7ce2fe1a", - "cursor": "#7ce2feff", - "selection": "#7ce2fe40" - } -} diff --git a/crates/assets/src/lib.rs b/crates/assets/src/lib.rs index a1f9b9ee..a226cfa5 100644 --- a/crates/assets/src/lib.rs +++ b/crates/assets/src/lib.rs @@ -7,7 +7,6 @@ use rust_embed::RustEmbed; #[include = "fonts/**/*"] #[include = "brand/**/*"] #[include = "icons/**/*"] -#[include = "themes/**/*"] #[exclude = "*.DS_Store"] pub struct Assets; diff --git a/crates/chat_ui/src/lib.rs b/crates/chat_ui/src/lib.rs index cbde582f..cbb890ef 100644 --- a/crates/chat_ui/src/lib.rs +++ b/crates/chat_ui/src/lib.rs @@ -24,7 +24,7 @@ use smallvec::{SmallVec, smallvec}; use state::{ FileAttachment, NostrRegistry, download_and_decrypt_to_file, upload, upload_encrypted, }; -use theme::ActiveTheme; +use theme::{ActiveTheme, TextStyle, Typeset as _}; use ui::avatar::Avatar; use ui::button::{Button, ButtonVariants}; use ui::dock::{Panel, PanelEvent}; @@ -903,9 +903,9 @@ impl ChatPanel { h_flex() .h_10() .justify_center() - .text_sm() - .bg(cx.theme().elevated_surface_background) - .rounded(cx.theme().radius) + .text_style(TextStyle::Callout) + .bg(cx.theme().surface_raised) + .rounded(px(theme::panel_radius())) .child("Message isn't traced yet"), ) }) @@ -918,10 +918,10 @@ impl ChatPanel { h_flex() .h_7() .px_2() - .gap_2() - .bg(cx.theme().elevated_surface_background) - .rounded(cx.theme().radius) - .text_sm() + .gap(px(theme::SPACE)) + .bg(cx.theme().surface_raised) + .rounded(px(theme::control_radius())) + .text_style(TextStyle::Callout) .child(div().size_1p5().rounded_full().bg(gpui::green())) .child(SharedString::from(url.to_string())), ); @@ -950,10 +950,10 @@ impl ChatPanel { h_flex() .h_7() .px_2() - .gap_2() - .bg(cx.theme().elevated_surface_background) - .rounded(cx.theme().radius) - .text_sm() + .gap(px(theme::SPACE)) + .bg(cx.theme().surface_raised) + .rounded(px(theme::control_radius())) + .text_style(TextStyle::Callout) .child(div().size_1p5().rounded_full().bg(gpui::green())) .child(SharedString::from(url.to_string())), ); @@ -975,7 +975,7 @@ impl ChatPanel { svg() .path("brand/coop.svg") .size_12() - .text_color(cx.theme().ghost_element_background_alt), + .text_color(cx.theme().surface_raised), ) .message(PRIVATE_NOTICE) .into_any_element() @@ -990,14 +990,14 @@ impl ChatPanel { .items_center() .justify_center() .text_center() - .text_xs() - .text_color(cx.theme().text_placeholder) + .text_style(TextStyle::Caption) + .text_color(cx.theme().text_faint) .line_height(relative(1.3)) .child( svg() .path("brand/coop.svg") .size_12() - .text_color(cx.theme().ghost_element_active), + .text_color(cx.theme().element_active), ) .child(PRIVATE_NOTICE) .into_any_element() @@ -1013,15 +1013,15 @@ impl ChatPanel { h_flex() .w_full() .gap_3() - .text_sm() + .text_style(TextStyle::Callout) .child( h_flex() .flex_shrink_0() .size_8() .justify_center() .rounded_full() - .bg(cx.theme().warning_background) - .text_color(cx.theme().warning_foreground) + .bg(cx.theme().warning_muted) + .text_color(cx.theme().warning) .child(Icon::new(IconName::Warning).small()), ) .child( @@ -1161,7 +1161,7 @@ impl ChatPanel { .top_0() .w(px(2.)) .h_full() - .bg(cx.theme().border_transparent), + .bg(gpui::transparent_black()), ) .overlay(self.render_actions(&id, &pk, cx)) .on_mouse_down( @@ -1187,10 +1187,10 @@ impl ChatPanel { return div().child( img(media[0].clone()) .border_1() - .border_color(cx.theme().border_variant) + .border_color(cx.theme().border_faint) .h(px(250.)) .object_fit(ObjectFit::Cover) - .rounded(cx.theme().radius), + .rounded(px(theme::bubble_radius())), ); } @@ -1201,7 +1201,7 @@ impl ChatPanel { .flex() .flex_row() .flex_wrap() - .gap_2() + .gap(px(theme::SPACE)) .children({ let mut items = vec![]; @@ -1215,8 +1215,8 @@ impl ChatPanel { img(item.clone()) .h_32() .border_1() - .border_color(cx.theme().border_variant) - .rounded(cx.theme().radius), + .border_color(cx.theme().border_faint) + .rounded(px(theme::bubble_radius())), ), ); } @@ -1245,7 +1245,7 @@ impl ChatPanel { .px_2() .border_l_2() .border_color(cx.theme().element_active) - .text_sm() + .text_style(TextStyle::Callout) .child(div().font_semibold().child(author.name())) .child( div() @@ -1254,7 +1254,7 @@ impl ChatPanel { .line_clamp(1) .child(message.preview()), ) - .hover(|this| this.bg(cx.theme().elevated_surface_background)) + .hover(|this| this.bg(cx.theme().surface_raised)) .on_click({ let id = *id; cx.listener(move |this, _event, _window, _cx| { @@ -1287,16 +1287,16 @@ impl ChatPanel { .unwrap_or(false); h_flex() - .gap_2() + .gap(px(theme::SPACE)) .py_0p5() .px_1() - .rounded(cx.theme().radius) - .text_xs() + .rounded(px(theme::control_radius())) + .text_style(TextStyle::Caption) .border_1() .when(has_reacted, |this| { - this.text_color(cx.theme().secondary_foreground) - .bg(cx.theme().secondary_background) - .border_color(cx.theme().secondary_active) + this.text_color(cx.theme().text) + .bg(cx.theme().surface_raised) + .border_color(cx.theme().element_active) }) .when(!has_reacted, |this| this.border_color(cx.theme().border)) .child(emoji) @@ -1330,7 +1330,7 @@ impl ChatPanel { div() .id(SharedString::from(id.to_hex())) .child(label) - .when(failed, |this| this.text_color(cx.theme().text_danger)) + .when(failed, |this| this.text_color(cx.theme().danger_muted)) .when_some(reports, |this, reports| { this.when(!pending, |this| { this.on_click(move |_e, window, cx| { @@ -1361,12 +1361,12 @@ impl ChatPanel { let avatar = profile.avatar(); v_flex() - .gap_2() + .gap(px(theme::SPACE)) .w_full() .child( h_flex() - .gap_2() - .text_sm() + .gap(px(theme::SPACE)) + .text_style(TextStyle::Callout) .child(SharedString::from("Sent to:")) .child( h_flex() @@ -1384,17 +1384,17 @@ impl ChatPanel { .p_1() .h_16() .w_full() - .text_sm() - .rounded(cx.theme().radius) - .bg(cx.theme().warning_background) - .text_color(cx.theme().warning_foreground) + .text_style(TextStyle::Callout) + .rounded(px(theme::surface_radius())) + .bg(cx.theme().warning_muted) + .text_color(cx.theme().warning) .child(div().flex_1().w_full().text_center().child(error)), ) }) .when_some(report.output().cloned(), |this, output| { this.child( v_flex() - .gap_2() + .gap(px(theme::SPACE)) .w_full() .children({ let mut items = Vec::with_capacity(output.failed.len()); @@ -1405,19 +1405,19 @@ impl ChatPanel { .gap_0p5() .p_1() .w_full() - .rounded(cx.theme().radius) - .bg(cx.theme().danger_background) + .rounded(px(theme::surface_radius())) + .bg(cx.theme().danger.opacity(0.06)) .child( div() - .text_xs() + .text_style(TextStyle::Caption) .font_semibold() .line_height(relative(1.25)) .child(SharedString::from(url.to_string())), ) .child( div() - .text_xs() - .text_color(cx.theme().danger_foreground) + .text_style(TextStyle::Caption) + .text_color(cx.theme().danger_muted.opacity(0.9)) .line_height(relative(1.25)) .child(SharedString::from(msg.to_string())), ), @@ -1435,18 +1435,18 @@ impl ChatPanel { .gap_0p5() .p_1() .w_full() - .rounded(cx.theme().radius) - .bg(cx.theme().elevated_surface_background) + .rounded(px(theme::surface_radius())) + .bg(cx.theme().surface_card) .child( div() - .text_xs() + .text_style(TextStyle::Caption) .font_semibold() .line_height(relative(1.25)) .child(SharedString::from(url.0.to_string())), ) .child( div() - .text_xs() + .text_style(TextStyle::Caption) .line_height(relative(1.25)) .child(SharedString::from("Successfully")), ), @@ -1473,10 +1473,10 @@ impl ChatPanel { .right_4() .top_neg_2() .when(cx.theme().shadow, |this| this.shadow_sm()) - .rounded(cx.theme().radius) + .rounded(px(theme::surface_radius())) .border_1() .border_color(cx.theme().border) - .bg(cx.theme().background) + .bg(cx.theme().bg) .children({ let mut items = vec![]; @@ -1553,7 +1553,7 @@ impl ChatPanel { img(url.as_str()) .size_16() .when(cx.theme().shadow, |this| this.shadow_lg()) - .rounded(cx.theme().radius) + .rounded(px(theme::control_radius())) .object_fit(ObjectFit::Cover), ) .child( @@ -1611,10 +1611,10 @@ impl ChatPanel { .child( img(path.clone()) .border_1() - .border_color(cx.theme().border_variant) + .border_color(cx.theme().border_faint) .h(px(250.)) .object_fit(ObjectFit::Cover) - .rounded(cx.theme().radius), + .rounded(px(theme::bubble_radius())), ) .into_any_element(); } @@ -1642,22 +1642,22 @@ impl ChatPanel { .self_start() .items_start() .min_w_0() - .gap_2() + .gap(px(theme::SPACE)) .p_2() .border_1() - .border_color(cx.theme().border_variant) - .rounded(cx.theme().radius) - .child(Icon::new(IconName::Lock).text_color(cx.theme().icon_accent)) + .border_color(cx.theme().border_faint) + .rounded(px(theme::control_radius())) + .child(Icon::new(IconName::Lock).text_color(cx.theme().accent)) .child( v_flex() .min_w_0() .overflow_hidden() - .text_sm() + .text_style(TextStyle::Callout) .child(div().line_height(relative(1.2)).child(file.display_name())) .child( div() - .text_xs() - .text_color(cx.theme().text_placeholder) + .text_style(TextStyle::Caption) + .text_color(cx.theme().text_faint) .child(label), ), ) @@ -1688,7 +1688,7 @@ impl ChatPanel { img(pending.path.clone()) .size_16() .when(cx.theme().shadow, |this| this.shadow_sm()) - .rounded(cx.theme().radius) + .rounded(px(theme::control_radius())) .object_fit(ObjectFit::Cover), ) } else { @@ -1698,11 +1698,11 @@ impl ChatPanel { .flex() .items_center() .justify_center() - .rounded(cx.theme().radius) + .rounded(px(theme::control_radius())) .border_1() - .border_color(cx.theme().border_variant) - .bg(cx.theme().surface_background) - .text_xs() + .border_color(cx.theme().border_faint) + .bg(cx.theme().surface) + .text_style(TextStyle::Caption) .text_center() .child("Preview not available"), ) @@ -1718,7 +1718,7 @@ impl ChatPanel { .justify_center() .rounded_full() .border_1() - .border_color(cx.theme().border_variant) + .border_color(cx.theme().border_faint) .bg(gpui::green()) .child(Icon::new(IconName::Lock).size_2().text_color(gpui::white())), ) @@ -1764,14 +1764,10 @@ impl ChatPanel { .flex() .items_baseline() .gap_1() - .text_xs() + .text_style(TextStyle::Caption) .text_color(cx.theme().text_muted) .child("Replying to:") - .child( - div() - .text_color(cx.theme().text_accent) - .child(profile.name()), - ), + .child(div().text_color(cx.theme().accent).child(profile.name())), ) .child( Button::new("remove-reply") @@ -1789,7 +1785,7 @@ impl ChatPanel { .child( div() .w_full() - .text_sm() + .text_style(TextStyle::Callout) .text_ellipsis() .line_clamp(1) .child(text.preview()), @@ -1885,12 +1881,17 @@ impl Panel for ChatPanel { h_flex() .gap_1() - .text_xs() + .text_style(TextStyle::Caption) .child(Avatar::new(picture).seed(seed).xsmall()) .child(label) .into_any_element() }) - .unwrap_or(div().text_xs().child("Unknown").into_any_element()) + .unwrap_or( + div() + .text_style(TextStyle::Caption) + .child("Unknown") + .into_any_element(), + ) } fn toolbar_buttons(&self, _window: &Window, _cx: &App) -> Vec