Files
GridSnap/TODO.md
Keith Smith 5cef19690a Implement zone dimension display and zone repositioning in editor
Feature #15 - Show Zone Dimensions:
- Display real-time dimensions while drawing zones
- Show width x height in both pixels and percentages
- Display position coordinates (x, y)
- Dimension label follows cursor with 15px offset
- Label positioned to stay within monitor bounds
- Automatically cleaned up when zone drawing completes

Feature #16 - Move/Reposition Zones:
- Click on existing zones to select and move them
- Yellow highlight when zone is being moved (vs green for new zones)
- Drag zones to new positions while maintaining size
- Constrain movement to monitor bounds (can't move outside screen)
- Real-time update of zone coordinates in data structure
- Green color restored after move completes

Editor Improvements:
- Added zoneActors array to track zone widgets for moving
- Updated instruction label to mention zone moving
- Enhanced _findZoneAtPosition() helper to detect clicks on zones
- Improved _removeLastZone() to properly clean up zone actors
- Better cleanup in _cancelEditor() to prevent memory leaks
- Track moving state (isMovingZone, movingZoneIndex, moveOffsetX/Y)

UX Enhancements:
- Separate visual feedback for creating (green) vs moving (yellow) zones
- Smooth drag experience with proper offset tracking
- Dimensions update in real-time during zone creation
- Clear visual distinction between zone operations

Fixes TODO items #15 and #16

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2026-01-15 21:22:58 -07:00

148 lines
5.3 KiB
Markdown

# GridSnap TODO List
## Critical Issues
### 1. Custom Layout Persistence ✅ COMPLETED
**Priority: High**
- [x] Custom layouts are only stored in memory
- [x] Layouts are lost when extension reloads or Cinnamon restarts
- [x] Need to implement file-based storage
- [x] Location: `~/.local/share/gridsnap/layouts.json`
- [x] Save layouts when created in graphical editor
- [x] Load layouts on extension initialization
### 2. Remove Last Zone Implementation (extension.js:236-274)
**Priority: Medium**
- [ ] `_removeLastZone()` destroys and recreates entire editor interface
- [ ] Causes visual flicker
- [ ] Inefficient approach
- [ ] Could leave dangling event listeners
- [ ] Refactor to only remove the last zone widget without recreating everything
## Functionality Improvements
### 3. Multi-Monitor Support
**Priority: High**
- [ ] Currently only works on primary monitor (extension.js:61)
- [ ] Need per-monitor zone configurations
- [ ] Detect which monitor window is on when snapping
- [ ] Allow zone editor to work on any monitor
- [ ] Store zone layouts per monitor
### 4. High-DPI Display Support
**Priority: Medium**
- [ ] Coordinates from `get_coords()` may not respect window scaling
- [ ] Test on high-DPI displays
- [ ] Verify zone calculations work correctly with display scaling
- [ ] May need to use `get_resource_scale()` or similar
### 5. Edit Existing Custom Layouts
**Priority: Medium**
- [ ] Currently can only create new layouts in editor
- [ ] Add ability to select and edit existing custom layouts
- [ ] Add UI to choose which layout to edit
- [ ] Pre-populate editor with existing zones when editing
### 15. Show Zone Dimensions in Editor ✅ COMPLETED
**Priority: Medium**
- [x] Display zone dimensions while drawing in graphical editor
- [x] Show width and height in pixels and/or percentage
- [x] Update dimensions in real-time as zone is resized
- [x] Display position coordinates (x, y)
- [x] Show dimensions near cursor or inside zone preview
### 16. Move/Reposition Zones in Editor ✅ COMPLETED
**Priority: Medium**
- [x] Allow clicking and dragging existing zones to move them
- [x] Visual feedback when zone is selected for moving (yellow highlight)
- [x] Prevent moving zones outside monitor bounds
- [x] Update zone coordinates as zone is moved
- [x] Maintain zone size while moving (only change position)
- [ ] Snap to grid or guides (future enhancement)
## Code Quality & Robustness
### 6. Comprehensive Error Handling
**Priority: Medium**
- [ ] Add validation of zone sizes during window snapping
- [ ] Add checks for `window.move_resize_frame()` success
- [ ] Validate monitor dimensions before calculations
- [ ] Handle edge cases (window too small, zone too small, etc.)
- [ ] Add user notifications for errors instead of silent failures
### 7. Event Leak Prevention
**Priority: Low**
- [ ] Zone preview widgets might not be properly destroyed if motion events stop unexpectedly
- [ ] Audit all signal connections and ensure disconnect in cleanup
- [ ] Add defensive cleanup in edge cases
- [ ] Review overlay widget lifecycle
### 8. Zone Overlap Detection
**Priority: Low**
- [ ] Warn user if zones overlap in graphical editor
- [ ] Provide visual feedback for overlapping zones
- [ ] Optionally prevent overlaps or auto-adjust
## Features from README (Planned)
### 9. Zone Layout Import/Export
**Priority: Low**
- [ ] Allow exporting custom layouts to JSON files
- [ ] Import layouts from JSON files
- [ ] Share layouts between systems
- [ ] Backup/restore functionality
### 10. More Pre-configured Layouts
**Priority: Low**
- [ ] Add more default layout options
- [ ] Common patterns: ultrawide monitor layouts, vertical splits
- [ ] 1/3 - 2/3 layouts
- [ ] Picture-in-picture style layouts
### 11. Animation Effects
**Priority: Low**
- [ ] Add smooth transitions when snapping windows
- [ ] Animate zone overlay appearance/disappearance
- [ ] Visual feedback when window snaps to zone
### 12. Settings Panel ✅ COMPLETED
**Priority: Medium**
- [x] Add Cinnamon settings panel for the extension
- [x] Toggle features on/off (shift-drag, keyboard snap)
- [x] Manage saved layouts (view, delete, export)
- [x] Customize zone appearance (colors, border width, opacity)
- [x] Configure zone number visibility
- [x] Enable/disable snap notifications
- [ ] Allow customization of keybindings (future enhancement)
- [ ] Configure animation speeds (when animations added)
## Documentation
### 13. Update Metadata ✅ COMPLETED
**Priority: Low**
- [x] Add "url" property to metadata.json
- [x] Update author name to "Keith Smith"
- [x] Add project URL/repository link
## Testing
### 14. Test Coverage
**Priority: Low**
- [ ] Test on different Cinnamon versions (5.0, 5.2, 5.4, 5.6, 6.0)
- [ ] Test with different window types (maximized, minimized, dialog boxes)
- [ ] Test edge cases (dragging between monitors, rapid key presses)
- [ ] Test with different keyboard layouts
- [ ] Verify memory leaks don't occur with repeated enable/disable
---
## Recently Fixed ✅
- [x] Keybinding closure bug (all zones mapped to zone 9)
- [x] Keybinding conflicts with panel app launcher (changed to Super+Ctrl+1-9)
- [x] Shift-drag detection (implemented modifier polling)
- [x] Window object reference (use global.display.focus_window)
- [x] Window API compatibility (property checks vs get_maximized())
- [x] Signal handler parameters (grab-op-begin/end)
- [x] Laptop keyboard support (removed numpad dependency)