You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Improve dock UX architecture and fix signal-driven sync regressions
This commit delivers a substantial dock UX refactor and closes follow-up regressions introduced during the polling-to-signal migration.
UI and layout changes:
- Reorganize selection-dependent tools (hollow, move floor/ceiling, tie/untie, clip, duplicate array) into a contextual 'Selection Tools' section in the Brush tab.
- Keep Selection Tools hidden when no selection exists and visible when selection is present.
- Compact toolbar presentation to single-character labels (D, S, +, -, P, ▲, ▼) with richer tooltip descriptions and a separator before extrude controls.
- Move autosave warning label definition into dock.tscn and bind it via @onready instead of runtime construction.
- Improve section ergonomics via collapsible-section separators, indented content, and persisted expanded/collapsed state through user prefs.
- Apply small readability/usability tweaks (UV justify grid layout, standard label widths, wider +/- buttons, list sizing adjustments).
Signal and synchronization changes:
- Remove frame-throttled paint/material/surface polling from _process and wire updates through LevelRoot signals.
- Add and emit LevelRoot material_list_changed on material add/remove; connect dock handlers for immediate palette refresh.
- Ensure initial root attach performs explicit _sync_materials_from_root and _sync_surface_paint_from_root so existing scene state is reflected immediately.
- Add face_selection_changed signal to LevelRoot and connect dock handler to keep UV/surface paint panels synchronized with face selection changes.
- Emit face_selection_changed from select_face_at_screen only when face_selection actually changes (covers hit toggle and miss-clear paths without spurious emits).
Startup and selection-state correctness:
- Initialize dock selection state during plugin _enter_tree after reading current EditorSelection so contextual controls are correct on startup/reload.
- Retain existing selection-changed wiring for ongoing updates.
Documentation updates:
- Update README, changelog, spec, roadmap, development, contributor guide, install/upgrade, MVP guide, and user guide to match new dock structure, toolbar behavior, and signal-driven sync model.
Notes:
- This commit aligns implementation and docs around the 4-tab dock architecture and contextual tooling model.
- User-reported full suite status: 344/344 tests passing after the face-selection emission fix.
- "No LevelRoot" banner and autosave warning defined in dock.tscn.
154
+
-Compact toolbar: single-char labels (D, S, +, -, P, ▲, ▼) with tooltips. VSeparator before extrude buttons.
155
+
- Paint/material sync is signal-driven (instant). Form label widths standardized to 70px. +/- buttons 32px wide.
156
+
-Tab contents built programmatically via `_build_paint_tab()`, `_build_manage_tab()`, `_build_selection_tools_section()`.
136
157
-**Sticky LevelRoot discovery:** Users no longer need to re-select LevelRoot after clicking other nodes.
137
158
-`plugin.gd`: `_handles()` returns true for any node when a LevelRoot exists; `_edit()` keeps `active_root` sticky; deep recursive tree search via `_find_level_root_deep()`.
138
159
-`dock.gd`: sticky `level_root` reference in `_process()`; deep recursive search via `_find_level_root_in()` / `_find_level_root_recursive()`.
@@ -224,10 +245,11 @@ The format is based on Keep a Changelog, and this project follows semantic versi
224
245
- Dock reorganized: Floor Paint and Surface Paint tabs.
225
246
226
247
### Changed
227
-
- Dock consolidated from 8 tabs (Build, FloorPaint, Materials, UV, SurfacePaint, Entities, Manage) to 4 tabs (Brush, Paint, Entities, Manage).
248
+
- Dock consolidated from 8 tabs to 4 (Brush, Paint, Entities, Manage). Selection-dependent tools (hollow, clip, move, tie, duplicator) moved from Manage → Brush tab's contextual Selection Tools section.
228
249
- Build tab renamed to **Brush** tab; bake options and editor toggles moved to Manage tab.
229
250
- FloorPaint, SurfacePaint, Materials, and UV tabs merged into single **Paint** tab with collapsible sections.
230
-
- Manage tab reorganized with collapsible sections for better discoverability.
251
+
- Manage tab trimmed: Actions section now contains only floor/cuts/clear. Toolbar uses single-char labels with tooltips.
252
+
- Paint layer/material/surface paint sync changed from 10-frame polling to signal-driven instant updates.
231
253
- LevelRoot discovery is now "sticky": selecting non-LevelRoot nodes no longer breaks viewport input.
232
254
- Plugin `_handles()` uses deep recursive tree search and accepts any node when a LevelRoot exists.
233
255
- Dock `_process()` uses sticky reference; only nulls `level_root` when node is removed from tree.
@@ -287,9 +309,10 @@ The format is based on Keep a Changelog, and this project follows semantic versi
287
309
- Added CI workflow (`.github/workflows/ci.yml`) for automated `gdformat` and `gdlint` checks on push/PR.
288
310
289
311
### Refactored
290
-
- Dock UX: rewrote `dock.gd` to build Paintand Manage tab contents programmatically using `HFCollapsibleSection`.
312
+
- Dock UX: rewrote `dock.gd` to build Paint, Manage, and Selection Tools contents programmatically using `HFCollapsibleSection`.
291
313
- Dock UX: ~100 `@onready var` declarations changed to plain `var` (controls created in code, not in .tscn).
292
-
- Dock UX: `dock.tscn` reduced to ~280 lines (tab shells only; content populated by `_ready()`).
314
+
- Dock UX: `dock.tscn` reduced to ~320 lines (tab shells + toolbar + autosave warning; content populated by `_ready()`).
315
+
- Dock UX: collapsible sections now have HSeparator + indented content + persisted state. All 18 sections registered in `_all_sections` dict.
293
316
- Replaced duck-typing in `baker.gd` (`has_method("get_faces")/.call()`) with typed `DraftBrush` access.
294
317
- Added `_find_level_root_deep()` to `plugin.gd` for recursive LevelRoot discovery.
295
318
- Added `_find_level_root_in()` and `_find_level_root_recursive()` to `dock.gd` for deep tree search.
@@ -315,14 +338,17 @@ The format is based on Keep a Changelog, and this project follows semantic versi
315
338
- Cordon visual: persistent `ImmediateMesh` reused via `clear_surfaces()`.
316
339
- Extracted inline GLSL to `highlight.gdshader` file.
317
340
- Added `build_heightmap_model()` on `hf_paint_tool.gd` (shared by 3 heightmap reconcile callers).
318
-
- Signal-driven sync in `dock.gd`: replaced 17 per-frame property writes with signal handlers; throttled perf updates (every 30 frames), sync calls (every 10 frames), flag-driven disabled hints; cached `_control_has_property()`.
341
+
- Signal-driven sync in `dock.gd`: replaced 17 per-frame property writes with signal handlers; paint/material/surface paint sync now fully signal-driven via LevelRoot signals; throttled perf updates (every 30 frames), flag-driven disabled hints; cached `_control_has_property()`.
319
342
- Input decomposition in `plugin.gd`: split 260-line `_forward_3d_gui_input()` into ~50-line dispatcher + 7 focused handlers + shared `_get_nudge_direction()`.
320
343
321
344
### UX
322
345
- Dock now has 4 tabs (Brush, Paint, Entities, Manage) instead of 8 for faster navigation.
323
-
- Collapsible sections throughout Paint and Manage tabs for visual hierarchy and reduced scrolling.
346
+
- Selection tools (hollow, clip, move, tie, duplicator) appear contextually in Brush tab when brushes are selected.
347
+
- Collapsible sections with separators, indented content, and persisted collapsed state across sessions.
324
348
- "No LevelRoot" banner at dock top guides users when no LevelRoot is found.
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -20,8 +20,9 @@ Thanks for helping improve HammerForge.
20
20
- New entity types go in `entities.json`, not hardcoded in GDScript.
21
21
- New input tools should subclass `HFGesture` for self-contained state management.
22
22
- Subscribe to LevelRoot signals instead of polling in `_process()`.
23
-
-**Keyboard shortcuts** go through `_keymap.matches("action_name", event)`, never hardcoded `KEY_*` checks. Add new default bindings in `HFKeymap._default_bindings()`.
23
+
-**Keyboard shortcuts** go through `_keymap.matches("action_name", event)`, never hardcoded `KEY_*` checks. Add new default bindings in `HFKeymap._default_bindings()`. Toolbar uses single-char labels with tooltips.
24
24
-**External tools** should implement `can_activate()` for tool availability and `get_settings_schema()` for auto-generated dock UI. See `hf_editor_tool.gd` for the full API.
25
+
-**New dock sections** should use `HFCollapsibleSection.create()` and register with `_register_section()` for persisted collapse state. Use 70px label widths for form rows.
25
26
-**Brush mutations** should call `root.tag_brush_dirty(id)` (guarded with `has_method`) so the reconciler can skip unchanged geometry.
26
27
-**Multi-brush operations** should wrap in `begin_signal_batch()` / `end_signal_batch()` (or use transactions, which batch automatically) to prevent UI thrash.
27
28
-**User preferences** (application-scoped) go in `HFUserPrefs`. **Level settings** go on LevelRoot.
0 commit comments