From eca89e51d26dbb3678586967bbdb9935645fe588 Mon Sep 17 00:00:00 2001 From: Chili Palmer Date: Mon, 4 May 2026 12:02:13 +0200 Subject: [PATCH] feat: phase 5 of tailwind migration --- assets/css/assistant.css | 51 +++-- assets/css/editor.css | 175 ------------------ assets/css/media_editor.css | 149 --------------- assets/css/menu_editor.css | 30 --- assets/css/utilities.css | 123 ++++++++++++ .../chat_editor_html/chat_editor.html.heex | 20 +- .../media_editor_html/media_editor.html.heex | 46 ++--- .../menu_editor_html/menu_editor.html.heex | 8 +- .../post_editor_html/post_editor.html.heex | 42 ++--- .../script_editor.html.heex | 24 +-- .../settings_editor.html.heex | 34 ++-- .../template_editor.html.heex | 22 +-- test/bds/desktop/shell_live_test.exs | 76 +++++--- test/bds/ui/shell_test.exs | 132 +++++++++++++ 14 files changed, 439 insertions(+), 493 deletions(-) diff --git a/assets/css/assistant.css b/assets/css/assistant.css index b35c0e8..84d820b 100644 --- a/assets/css/assistant.css +++ b/assets/css/assistant.css @@ -9,18 +9,10 @@ } .chat-panel { - display: flex; - min-height: 0; - flex-direction: column; color: var(--vscode-editor-foreground); } .chat-panel-header { - display: flex; - align-items: center; - justify-content: space-between; - gap: 16px; - padding: 12px 16px; border-bottom: 1px solid var(--vscode-panel-border); background: var(--vscode-sideBar-background); } @@ -28,8 +20,6 @@ .chat-panel-title { flex: 1; min-width: 0; - display: flex; - align-items: center; gap: 10px; overflow: visible; font-size: 14px; @@ -91,10 +81,6 @@ } .chat-messages { - display: flex; - flex-direction: column; - gap: 16px; - padding: 16px; } .chat-message { @@ -152,9 +138,6 @@ } .chat-panel .chat-input-wrapper { - display: flex; - align-items: flex-end; - gap: 8px; min-height: 30px; border: 1px solid var(--vscode-input-border); border-radius: 6px; @@ -204,3 +187,37 @@ .chat-panel .chat-send-button:disabled { opacity: 0.5; } + +@media (max-width: 720px) { + .chat-panel-header { + align-items: stretch; + flex-direction: column; + padding: 10px 12px; + } + + .chat-panel-title { + width: 100%; + flex-wrap: wrap; + } + + .chat-model-selector-wrap { + width: 100%; + } + + .chat-panel .chat-model-selector-button.chat-model-selector-inline { + justify-content: space-between; + width: 100%; + } + + .chat-messages { + padding: 12px; + } + + .chat-message-content { + max-width: 100%; + } + + .chat-panel .chat-input-container { + padding: 8px 12px; + } +} diff --git a/assets/css/editor.css b/assets/css/editor.css index 0dfe357..2a79049 100644 --- a/assets/css/editor.css +++ b/assets/css/editor.css @@ -321,58 +321,6 @@ overflow: hidden; } -.post-editor .editor-header, -.scripts-view-shell.editor .editor-header, -.templates-view-shell.editor .editor-header { - display: flex; - align-items: center; - justify-content: space-between; - gap: 12px; - padding: 0 12px; - min-height: 35px; - background-color: var(--vscode-tab-activeBackground); - border-bottom: 1px solid var(--vscode-panel-border); -} - -.post-editor .editor-tabs, -.scripts-view-shell.editor .editor-tabs, -.templates-view-shell.editor .editor-tabs { - display: flex; - align-items: center; - gap: 2px; - min-width: 0; -} - -.post-editor .editor-tab, -.scripts-view-shell.editor .editor-tab, -.templates-view-shell.editor .editor-tab { - display: flex; - align-items: center; - gap: 6px; - min-width: 0; - padding: 6px 12px; - background-color: var(--vscode-tab-inactiveBackground); - color: var(--vscode-tab-inactiveForeground); - font-size: 13px; - border-radius: 4px 4px 0 0; -} - -.post-editor .editor-tab.active, -.scripts-view-shell.editor .editor-tab.active, -.templates-view-shell.editor .editor-tab.active { - background-color: var(--vscode-tab-activeBackground); - color: var(--vscode-tab-activeForeground); -} - -.post-editor .editor-tab-title, -.scripts-view-shell.editor .editor-tab-title, -.templates-view-shell.editor .editor-tab-title { - min-width: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - .post-editor .editor-tab-dirty { color: var(--vscode-notificationsWarningIcon-foreground, var(--vscode-editorWarning-foreground)); font-size: 10px; @@ -384,14 +332,6 @@ white-space: nowrap; } -.post-editor .editor-actions, -.scripts-view-shell.editor .editor-actions, -.templates-view-shell.editor .editor-actions { - display: flex; - align-items: center; - gap: 8px; -} - .post-editor .quick-actions-wrapper { position: relative; display: inline-block; @@ -409,60 +349,17 @@ line-height: 1; } -.post-editor .quick-actions-menu { - position: absolute; - top: 100%; - right: 0; - margin-top: 4px; - min-width: 280px; - background: var(--vscode-dropdown-background, #3c3c3c); - border: 1px solid var(--vscode-dropdown-border, #454545); - border-radius: 6px; - box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); - z-index: 1000; - overflow: hidden; -} - .post-editor .quick-actions-divider { height: 1px; background: var(--vscode-dropdown-border, #454545); } -.post-editor .quick-action-item { - display: flex; - align-items: flex-start; - gap: 10px; - width: 100%; - padding: 10px 12px; - background: none; - border: none; - color: var(--vscode-dropdown-foreground, #ccc); - cursor: pointer; - text-align: left; - transition: background 0.1s; -} - -.post-editor .quick-action-item:hover:not(:disabled) { - background: var(--vscode-list-hoverBackground, #2a2d2e); -} - -.post-editor .quick-action-item:disabled { - opacity: 0.5; - cursor: not-allowed; -} - .post-editor .quick-action-icon { font-size: 16px; flex-shrink: 0; margin-top: 2px; } -.post-editor .quick-action-text { - display: flex; - flex-direction: column; - gap: 2px; -} - .post-editor .quick-action-text strong { font-size: 13px; font-weight: 500; @@ -510,19 +407,7 @@ font-style: italic; } -.post-editor .editor-content { - flex: 1; - display: flex; - flex-direction: column; - gap: 16px; - padding: 16px; - overflow-y: auto; -} - .post-editor .metadata-toggle-header { - display: flex; - align-items: center; - gap: 8px; } .post-editor .metadata-toggle { @@ -550,37 +435,15 @@ font-size: 10px; } -.post-editor .editor-header-row { - display: flex; - gap: 16px; - align-items: flex-start; -} - .post-editor .editor-header-row.is-collapsed { display: none; } -.post-editor .editor-meta { - display: flex; - flex-direction: column; - gap: 8px; - flex: 1; - min-width: 0; -} - .post-editor .editor-media-panel { width: 200px; flex-shrink: 0; } -.post-editor .editor-field { - display: flex; - flex-direction: column; - gap: 4px; - flex: 1; - min-width: 200px; -} - .post-editor .editor-field label, .post-editor .editor-body label, .post-editor .post-editor-links-label { @@ -600,27 +463,11 @@ color: var(--vscode-foreground); } -.post-editor .post-editor-input, -.post-editor .post-editor-textarea { - width: 100%; - padding: 8px 10px; - border: 1px solid var(--vscode-input-border, var(--vscode-panel-border)); - border-radius: 4px; - background: var(--vscode-input-background, rgba(255, 255, 255, 0.06)); - color: var(--vscode-input-foreground, var(--vscode-foreground)); - font: inherit; -} - .post-editor .post-editor-input.is-readonly { opacity: 0.7; cursor: not-allowed; } -.post-editor .post-editor-textarea { - line-height: 1.5; - resize: vertical; -} - .post-editor .post-editor-excerpt { min-height: 96px; } @@ -796,33 +643,11 @@ font-weight: 600; } -.post-editor .editor-field-row { - display: flex; - gap: 12px; - width: 100%; -} - -.post-editor .editor-language-row { - display: flex; - gap: 6px; - align-items: center; - flex-wrap: nowrap; -} - .post-editor .editor-language-row select { flex: 1; min-width: 0; } -.post-editor .editor-translations-flags { - display: flex; - gap: 4px; - align-items: center; - flex: 1; - min-width: 0; - overflow-x: auto; -} - .post-editor .editor-translation-flag { display: inline-flex; align-items: center; diff --git a/assets/css/media_editor.css b/assets/css/media_editor.css index 34fb7a5..8af0c20 100644 --- a/assets/css/media_editor.css +++ b/assets/css/media_editor.css @@ -1,64 +1,8 @@ -[data-testid="media-editor"] { - flex: 1; - display: flex; - flex-direction: column; - background-color: var(--vscode-editor-background); - overflow: hidden; -} - -[data-testid="media-editor"] .editor-header { - display: flex; - align-items: center; - justify-content: space-between; - gap: 12px; - padding: 0 12px; - min-height: 35px; - background-color: var(--vscode-tab-activeBackground); - border-bottom: 1px solid var(--vscode-panel-border); -} - -[data-testid="media-editor"] .editor-tabs { - display: flex; - align-items: center; - gap: 2px; - min-width: 0; -} - -[data-testid="media-editor"] .editor-tab { - display: flex; - align-items: center; - gap: 6px; - min-width: 0; - padding: 6px 12px; - background-color: var(--vscode-tab-inactiveBackground); - color: var(--vscode-tab-inactiveForeground); - font-size: 13px; - border-radius: 4px 4px 0 0; -} - -[data-testid="media-editor"] .editor-tab.active { - background-color: var(--vscode-tab-activeBackground); - color: var(--vscode-tab-activeForeground); -} - -[data-testid="media-editor"] .editor-tab-title { - min-width: 0; - overflow: hidden; - text-overflow: ellipsis; - white-space: nowrap; -} - [data-testid="media-editor"] .editor-tab-dirty { color: var(--vscode-notificationsWarningIcon-foreground, var(--vscode-editorWarning-foreground)); font-size: 10px; } -[data-testid="media-editor"] .editor-actions { - display: flex; - align-items: center; - gap: 8px; -} - [data-testid="media-editor"] .editor-actions button { padding: 4px 10px; font-size: 12px; @@ -89,62 +33,17 @@ line-height: 1; } -[data-testid="media-editor"] .quick-actions-menu { - position: absolute; - top: calc(100% + 4px); - right: 0; - width: 280px; - background: var(--vscode-dropdown-background, #252526); - border: 1px solid var(--vscode-dropdown-border, #454545); - border-radius: 6px; - box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); - overflow: hidden; - z-index: 30; -} - [data-testid="media-editor"] .quick-actions-divider { height: 1px; background: var(--vscode-dropdown-border, #454545); } -[data-testid="media-editor"] .quick-action-item { - display: flex; - align-items: flex-start; - justify-content: space-between; - gap: 10px; - width: 100%; - padding: 10px 12px; - background: none; - border: none; - color: var(--vscode-dropdown-foreground, #ccc); - cursor: pointer; - text-align: left; - transition: background 0.1s; -} - -[data-testid="media-editor"] .quick-action-item:hover:not(:disabled) { - background: var(--vscode-list-hoverBackground, #2a2d2e); -} - -[data-testid="media-editor"] .quick-action-item:disabled { - opacity: 0.5; - cursor: not-allowed; -} - [data-testid="media-editor"] .quick-action-icon { font-size: 16px; flex-shrink: 0; margin-top: 2px; } -[data-testid="media-editor"] .quick-action-text { - display: flex; - flex: 1; - flex-direction: column; - gap: 2px; - min-width: 0; -} - [data-testid="media-editor"] .quick-action-text strong { font-size: 13px; font-weight: 500; @@ -155,29 +54,12 @@ opacity: 0.7; } -[data-testid="media-editor"] .editor-content { - flex: 1; - display: flex; - flex-direction: column; - padding: 16px; - overflow-y: auto; - gap: 16px; -} - [data-testid="media-editor"] > .editor-content.media-editor { flex-direction: row; align-items: stretch; gap: 24px; } -[data-testid="media-editor"] .editor-field { - display: flex; - flex-direction: column; - gap: 4px; - flex: 1; - min-width: 0; -} - [data-testid="media-editor"] .editor-field label { font-size: 11px; font-weight: 500; @@ -186,35 +68,12 @@ letter-spacing: 0.5px; } -[data-testid="media-editor"] .editor-field-row { - display: flex; - gap: 12px; - width: 100%; - margin-bottom: 0; -} - -[data-testid="media-editor"] .post-editor-input, -[data-testid="media-editor"] .post-editor-textarea { - width: 100%; - padding: 8px 10px; - border: 1px solid var(--vscode-input-border, var(--vscode-panel-border)); - border-radius: 4px; - background: var(--vscode-input-background, rgba(255, 255, 255, 0.06)); - color: var(--vscode-input-foreground, var(--vscode-foreground)); - font: inherit; -} - [data-testid="media-editor"] .post-editor-input.disabled, [data-testid="media-editor"] .post-editor-input:disabled { opacity: 0.6; cursor: not-allowed; } -[data-testid="media-editor"] .post-editor-textarea { - line-height: 1.5; - resize: vertical; -} - [data-testid="media-editor"] .media-preview { flex: 1; display: flex; @@ -255,18 +114,10 @@ [data-testid="media-editor"] .media-details { width: 320px; - display: flex; - flex-direction: column; gap: 12px; flex-shrink: 0; } -[data-testid="media-editor"] .media-editor-details-form { - display: flex; - flex-direction: column; - gap: 12px; -} - [data-testid="media-editor"] .media-details textarea { resize: vertical; } diff --git a/assets/css/menu_editor.css b/assets/css/menu_editor.css index 9c1c67d..ae58430 100644 --- a/assets/css/menu_editor.css +++ b/assets/css/menu_editor.css @@ -1,20 +1,4 @@ -.menu-editor-view { - padding: 1rem; - height: 100%; - flex: 1; - min-height: 0; - display: flex; - flex-direction: column; - gap: 0.75rem; - overflow: hidden; - background: var(--vscode-editor-background); -} - .menu-editor-header { - display: flex; - align-items: flex-start; - justify-content: space-between; - gap: 1rem; } .menu-editor-header h2 { @@ -26,18 +10,7 @@ color: var(--vscode-descriptionForeground); } -.menu-editor-main { - display: flex; - flex-direction: column; - min-height: 0; - flex: 1; - overflow: hidden; -} - .menu-editor-tree-wrap { - display: flex; - flex-direction: column; - flex: 1; border: 1px solid var(--vscode-panel-border); border-radius: 6px; background: var(--vscode-editor-background); @@ -46,9 +19,6 @@ } .menu-editor-toolbar { - display: flex; - align-items: center; - gap: 0.2rem; margin-bottom: 0.5rem; padding-bottom: 0.4rem; border-bottom: 1px solid var(--vscode-panel-border); diff --git a/assets/css/utilities.css b/assets/css/utilities.css index bfc27f9..0e47593 100644 --- a/assets/css/utilities.css +++ b/assets/css/utilities.css @@ -130,6 +130,119 @@ color: var(--vscode-descriptionForeground); } + .ui-editor-shell { + height: 100%; + min-height: 0; + display: flex; + flex-direction: column; + overflow: hidden; + background: var(--vscode-editor-background); + } + + .ui-editor-header { + display: flex; + align-items: flex-start; + justify-content: space-between; + gap: 12px; + min-height: 35px; + padding: 0 12px; + border-bottom: 1px solid var(--vscode-panel-border); + background: var(--vscode-tab-activeBackground); + } + + .ui-editor-tab-current { + display: inline-flex; + max-width: 100%; + align-items: center; + gap: 6px; + overflow: hidden; + padding: 6px 12px; + border-radius: 4px 4px 0 0; + background: var(--vscode-tab-activeBackground); + color: var(--vscode-tab-activeForeground); + } + + .ui-editor-actions { + display: flex; + align-items: center; + justify-content: flex-end; + gap: 8px; + flex-wrap: wrap; + } + + .ui-toolbar { + display: flex; + align-items: center; + gap: 12px; + min-height: 32px; + } + + .ui-toolbar-group { + display: flex; + align-items: center; + gap: 8px; + min-width: 0; + } + + .ui-field-stack { + display: flex; + flex-direction: column; + gap: 6px; + min-width: 0; + } + + .ui-field-stack > label, + .ui-field-label { + font-size: 11px; + font-weight: 500; + color: var(--vscode-descriptionForeground); + text-transform: uppercase; + letter-spacing: 0.5px; + } + + .ui-field-grid-2, + .ui-field-grid-3 { + display: grid; + gap: 16px; + } + + .ui-dropdown-menu { + background: var(--vscode-dropdown-background, var(--vscode-sideBar-background)); + border: 1px solid var(--vscode-dropdown-border, var(--vscode-panel-border)); + border-radius: 6px; + box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35); + overflow: hidden; + } + + .ui-dropdown-item { + display: flex; + align-items: flex-start; + gap: 10px; + width: 100%; + padding: 10px 12px; + border: none; + background: transparent; + color: var(--vscode-dropdown-foreground, var(--vscode-foreground)); + cursor: pointer; + text-align: left; + transition: background 0.1s; + } + + .ui-dropdown-item:hover:not(:disabled) { + background: var(--vscode-list-hoverBackground, #2a2d2e); + } + + .ui-dropdown-item:disabled { + opacity: 0.5; + cursor: not-allowed; + } + + .ui-section-card { + border: 1px solid var(--vscode-panel-border); + border-radius: 8px; + background: color-mix(in srgb, var(--vscode-editor-background) 84%, var(--vscode-input-background)); + } + .btn-base { display: inline-flex; align-items: center; @@ -176,3 +289,13 @@ overflow: hidden; } } + +@media (min-width: 768px) { + .ui-field-grid-2 { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + + .ui-field-grid-3 { + grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; + } +} diff --git a/lib/bds/desktop/shell_live/chat_editor_html/chat_editor.html.heex b/lib/bds/desktop/shell_live/chat_editor_html/chat_editor.html.heex index bca18e6..d66506a 100644 --- a/lib/bds/desktop/shell_live/chat_editor_html/chat_editor.html.heex +++ b/lib/bds/desktop/shell_live/chat_editor_html/chat_editor.html.heex @@ -1,5 +1,5 @@ -
-
+
+
<%= if @chat_editor.needs_api_key? do %> @@ -23,7 +23,7 @@ <%= if @chat_editor.model_selector_open? and @chat_editor.available_models != [] do %> -
+
<%= for group <- @chat_editor.available_model_groups do %>
<%= if length(@chat_editor.available_model_groups) > 1 do %> @@ -33,7 +33,7 @@ <%= for model <- group.models do %> <% end %> diff --git a/lib/bds/desktop/shell_live/media_editor_html/media_editor.html.heex b/lib/bds/desktop/shell_live/media_editor_html/media_editor.html.heex index 5d03e0a..937592b 100644 --- a/lib/bds/desktop/shell_live/media_editor_html/media_editor.html.heex +++ b/lib/bds/desktop/shell_live/media_editor_html/media_editor.html.heex @@ -1,8 +1,8 @@ -
-
+
+
<%= @media_editor.display_title %> @@ -12,7 +12,7 @@
-
+
<%= if @media_editor.save_state in [:dirty, :saved] do %> <%= media_editor_save_state_label(@media_editor.save_state) %> <% end %> @@ -29,10 +29,10 @@ <%= if @media_editor.quick_actions_open? do %> -
+
<%= if @media_editor.is_image do %>
-
+
<%= if @media_editor.is_image and @media_editor.preview_url do %>
@@ -118,56 +118,56 @@
-
+
-
+
-
-
+
+
<%= if @media_editor.dimensions do %> -
+
<% end %>
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
diff --git a/lib/bds/desktop/shell_live/menu_editor_html/menu_editor.html.heex b/lib/bds/desktop/shell_live/menu_editor_html/menu_editor.html.heex index e03b480..60e31b0 100644 --- a/lib/bds/desktop/shell_live/menu_editor_html/menu_editor.html.heex +++ b/lib/bds/desktop/shell_live/menu_editor_html/menu_editor.html.heex @@ -1,14 +1,14 @@ -