diff --git a/CLAUDE.md b/CLAUDE.md index b674c9c..751f46d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -89,6 +89,29 @@ This is a monorepo containing: For detailed server-specific instructions (restart policy, testing, etc.), see: - `server/CLAUDE.md` +## UI Conventions for Dialogs + +### Hints + +Every form field in a modal should have a hint. Use the `.label-row` wrapper with a `?` toggle button: + +```html +
+
+ + +
+ + +
+``` + +Add hint text to both `en.json` and `ru.json` locale files using a `.hint` suffix on the label key. + +### Select dropdowns + +Do **not** add placeholder options like `-- Select something --`. Populate the ` +
+
+ + +
+ + +
+
@@ -376,15 +385,6 @@
-
-
- - -
- - -
-
@@ -407,18 +407,30 @@
- +
+ + +
+
- +
+ + +
+
- +
+ + +
+
@@ -426,15 +438,10 @@
-
- - -
-
Name X diff --git a/server/src/wled_controller/static/locales/en.json b/server/src/wled_controller/static/locales/en.json index c6ddbda..b6246ab 100644 --- a/server/src/wled_controller/static/locales/en.json +++ b/server/src/wled_controller/static/locales/en.json @@ -396,5 +396,9 @@ "pattern.capture_bg": "Capture Background", "pattern.source_for_bg": "Source for Background:", "pattern.source_for_bg.none": "-- Select source --", - "pattern.delete_selected": "Delete Selected" + "pattern.delete_selected": "Delete Selected", + "pattern.name.hint": "A descriptive name for this rectangle layout", + "pattern.description.hint": "Optional notes about where or how this pattern is used", + "pattern.visual_editor.hint": "Click + buttons to add rectangles. Drag edges to resize, drag inside to move.", + "pattern.rectangles.hint": "Fine-tune rectangle positions and sizes with exact coordinates (0.0 to 1.0)" } diff --git a/server/src/wled_controller/static/locales/ru.json b/server/src/wled_controller/static/locales/ru.json index 795ace8..bae3e26 100644 --- a/server/src/wled_controller/static/locales/ru.json +++ b/server/src/wled_controller/static/locales/ru.json @@ -396,5 +396,9 @@ "pattern.capture_bg": "Захватить Фон", "pattern.source_for_bg": "Источник для Фона:", "pattern.source_for_bg.none": "-- Выберите источник --", - "pattern.delete_selected": "Удалить Выбранный" + "pattern.delete_selected": "Удалить Выбранный", + "pattern.name.hint": "Описательное имя для этой раскладки прямоугольников", + "pattern.description.hint": "Необязательные заметки о назначении этого паттерна", + "pattern.visual_editor.hint": "Нажмите кнопки + чтобы добавить прямоугольники. Тяните края для изменения размера, тяните внутри для перемещения.", + "pattern.rectangles.hint": "Точная настройка позиций и размеров прямоугольников в координатах (0.0 до 1.0)" } diff --git a/server/src/wled_controller/static/style.css b/server/src/wled_controller/static/style.css index cfb7fb9..bcef9e1 100644 --- a/server/src/wled_controller/static/style.css +++ b/server/src/wled_controller/static/style.css @@ -2708,8 +2708,9 @@ input:-webkit-autofill:focus { /* Pattern Template Visual Editor */ .modal-content-wide { - max-width: 900px !important; - width: 95% !important; + width: fit-content; + min-width: 500px; + max-width: calc(100vw - 40px); max-height: calc(100vh - 40px); display: flex; flex-direction: column; @@ -2717,6 +2718,7 @@ input:-webkit-autofill:focus { .modal-content-wide .modal-body { overflow-y: auto; + scrollbar-gutter: stable; flex: 1 1 auto; min-height: 0; } @@ -2728,7 +2730,10 @@ input:-webkit-autofill:focus { background: var(--bg-color); border: 1px solid var(--border-color); margin-bottom: 12px; - resize: vertical; + resize: both; + width: 820px; + min-width: 400px; + max-width: 100%; min-height: 200px; height: 450px; max-height: calc(100vh - 400px); @@ -2738,21 +2743,30 @@ input:-webkit-autofill:focus { width: 100%; height: 100%; display: block; - cursor: crosshair; + cursor: default; } .pattern-canvas-toolbar { display: flex; - gap: 0.5rem; - padding: 8px 0; + gap: 2px; + padding: 4px; align-items: center; + background: var(--bg-secondary); + border-radius: 6px; + margin-top: 4px; } .pattern-canvas-toolbar .btn { flex: 0 0 auto; - min-width: auto; - padding: 6px 12px; - font-size: 0.85rem; + min-width: 32px; + width: 32px; + height: 32px; + padding: 0; + font-size: 1rem; + display: flex; + align-items: center; + justify-content: center; + border-radius: 4px; } .pattern-bg-row { diff --git a/server/src/wled_controller/storage/pattern_template_store.py b/server/src/wled_controller/storage/pattern_template_store.py index b7b46f1..858872d 100644 --- a/server/src/wled_controller/storage/pattern_template_store.py +++ b/server/src/wled_controller/storage/pattern_template_store.py @@ -41,7 +41,7 @@ class PatternTemplateStore: template = PatternTemplate( id=template_id, - name="Default", + name="Full Screen", rectangles=[ KeyColorRectangle(name="Full Frame", x=0.0, y=0.0, width=1.0, height=1.0), ],