-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
enhancementNew feature or requestNew feature or request
Milestone
Description
Overview
Before proceeding with UI Scaling (#106), improve the architectural foundation of the GPU Layout system based on professional feedback.
Problems Identified
-
Phase mixing:
draw()callslayout()internally (layout.py:624)- Unpredictable behavior
- Performance issues
- Prevents Dirty Flag optimization
-
State scattering: hovered/pressed states exist in multiple places
ButtonItem._hovered,_pressed(items.py)InteractionState.hovered,pressed(interactive.py)GPULayout._close_button_hovered(layout.py)
-
Event propagation incomplete: Only bubble phase, no
stopPropagation()
Sub-tasks
- Phase 0-A: Separate
draw()andlayout()phases ✅ d3feb58 - Phase 0-B: Centralize state management with
UIState✅ d3feb58 - Phase 0-C: Improve event propagation with
UIEvent.consume()(deferred)
Design Document
See _docs/design/gpu_phase0_architecture.md
Success Criteria
-
TEST_OT_gpu_layoutworks correctly -
TEST_OT_gpu_interactiveworks correctly (drag, close button, hover, press) - Clean separation between layout and drawing phases
- Single source of truth for UI state
Implementation Notes
Phase 0-A: Layout/Draw Separation
draw()no longer callslayout()internally- Added
update_and_draw()convenience method - Introduced Dirty Flag pattern for optimization
Phase 0-B: Centralized State
UIStateclass: ID-based state managementItemRenderState: passed todraw()methods- Removed
_hovered/_pressedfrom items - State flows: HitTestManager → UIState → ItemRenderState → draw()
Related
- [Tracking] PME2: GPU Layout System - Interactive UI Framework #104 GPU Layout Tracking Issue
- GPU Layout: UI scaling with over_scale pattern #106 UI Scaling (can now proceed)
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request