Skip to content

Commit c86c683

Browse files
authored
Feature/countdown (#42)
* Add countdown view integration and command handling in FormView * Add direct countdown handling for menu commands and enhance message logging * Enhance CountdownView with improved UI and functionality, including a 'Run now' button and updated countdown completion logic. * Refactor CountdownView and Core.js to improve UI dimensions and add 'Get Pro' button functionality, enhancing user experience and interaction logging. * Refactor CountdownView styles and update countdown logic to integrate AnalogChronometer, enhancing visual consistency and functionality. * Update Get Pro button functionality in CountdownView to open Gumroad link directly, removing placeholder logging for future implementation. * Add license management features, including UI integration and storage handling. Update manifest to include Gumroad API domain and rename custom run menu option. * Implement license management updates, including caching license status and integrating it into countdown logic. Update manifest for dynamic document access and adjust Core.js and gate.js for improved license handling. * Add license data retrieval for gate cache updates in Core.js and integrate license status loading in FormView. Clean up LicenseView by removing test license comment. * Update license activation notifications and refine LicenseView styles. Adjust margin and padding for improved layout, and enhance license information display with clearer formatting. * Add Gumroad access token to secrets and update LicenseView for improved license management. Implement checks for device limit and refine license usage increment and decrement logic. * Refactor LicenseView to use Netlify function proxy for Gumroad API calls, removing direct token usage in headers. Update webpack configuration to remove Gumroad access token from environment variables. * Enhance LicenseView to default device usage to 1 if not specified, and update license activation response to include usage count. Improve UI text for device usage and unlinking process for clarity. * Remove gumroad access token * Separate license functionality into its own file * License view updates for gate cache after activation * Update countdown feature description * Embed countdown in FormView * Refactor countdown integration by removing Router dependency and embedding countdown functionality directly in FormView. Implemented comprehensive error handling, event listener cleanup, and resolved license storage reliability issues. * Add layout paradigm preference to UI and core functionality - Introduced layout paradigm option in PreferencesView for user selection. - Updated core functions to utilize layout paradigm in node grouping and manipulation. - Enhanced cmdRename, cmdReorder, cmdTidy, and cmdPager functions to accept layout paradigm as a parameter. - Defaulted layout paradigm to 'rows' for backward compatibility. * Remove console log statements across multiple files to clean up code and improve performance. This includes App.js, Core.js, CountdownView.js, FormView.js, and LicenseView.js. The changes enhance readability and maintainability without altering functionality. * Add tracking for countdown events in CountdownView and FormView - Implemented tracking for countdown completion, "Run Now" button clicks, and "Get Super Tidy Pro" clicks in CountdownView. - Added tracking for countdown display and command execution after countdown in FormView. - Introduced license validation tracking in LicenseView to monitor validation process. * Auto save preferences
1 parent ab43a07 commit c86c683

18 files changed

Lines changed: 11439 additions & 209 deletions

features/columns-layout.md

Lines changed: 217 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,217 @@
1+
# Columns Layout Paradigm Feature
2+
3+
### Overview
4+
Implemented a new layout paradigm option that allows users to organize frames in a **columns-based layout** instead of the traditional rows-based approach. This feature is particularly beneficial for presentation designs and wide-format layouts where vertical organization is more space-efficient and visually appealing.
5+
6+
---
7+
8+
### User Request
9+
> "Love Super Tidy, but wondering if you could have a toggle to do the same thing, but with a Columns paradigm, instead of just Rows. I and a lot of my colleagues use Figma to build presentations, which have a wide format. Dividing sections up in columns saves space, and feels nicer to me sometimes. Thanks for your time!"
10+
11+
---
12+
13+
### Feature Implementation
14+
15+
#### **User Experience**
16+
- **New Preference**: "Layout paradigm" selector in Preferences tab
17+
- **Two Options**:
18+
- **Rows** (default): Traditional horizontal flow, good for mobile designs
19+
- **Columns**: Vertical flow, ideal for presentations and wide formats
20+
- **Universal Support**: All Super Tidy actions respect the selected paradigm:
21+
- Tidy (repositioning)
22+
- Rename (numbering)
23+
- Reorder (layer organization)
24+
- Pager (text variable replacement)
25+
26+
#### **Layout Behavior Comparison**
27+
28+
**Rows Layout (Original):**
29+
```
30+
Frame1 Frame2 Frame3
31+
Frame4 Frame5 Frame6
32+
```
33+
- Organizes left-to-right, then top-to-bottom
34+
- Numbers: 1, 2, 3, 4, 5, 6
35+
- Best for: Mobile designs, narrow layouts
36+
37+
**Columns Layout (New):**
38+
```
39+
Frame1 Frame4
40+
Frame2 Frame5
41+
Frame3 Frame6
42+
```
43+
- Organizes top-to-bottom, then left-to-right
44+
- Numbers: 1, 2, 3, 4, 5, 6 (same sequence, different spatial arrangement)
45+
- Best for: Presentations, wide layouts, dashboard designs
46+
47+
---
48+
49+
### Technical Architecture
50+
51+
#### **Code Refactoring**
52+
- **Extracted layout algorithms** from `Core.js` into `src/utils/LayoutUtils.js`
53+
- **Modularized functions** for better maintainability and testing
54+
- **Reduced Core.js complexity** as requested by user
55+
56+
#### **New Utility Functions (`src/utils/LayoutUtils.js`)**
57+
58+
**Core Functions:**
59+
- `getNodesGroupedbyPosition(nodes, layout)` - Groups nodes by rows or columns
60+
- `repositionNodes(groupedNodes, ...)` - Handles both layout paradigms
61+
- `reorderNodes(groupedNodes, layout, ...)` - Reorders based on paradigm
62+
- `applyPagerNumbers(groupedNodes, layout, ...)` - Numbers frames correctly
63+
- `applyRenameStrategy(groupedNodes, layout, ...)` - Renames with proper sequencing
64+
65+
**Algorithm Differences:**
66+
- **Rows**: Sort by X → group by Y → process left-to-right, top-to-bottom
67+
- **Columns**: Sort by Y → group by X → process top-to-bottom, left-to-right
68+
69+
#### **Preference Integration**
70+
- **Storage**: Added `layout_paradigm` to preferences object
71+
- **Default**: 'rows' for backward compatibility
72+
- **UI**: Select dropdown with clear descriptions
73+
- **Persistence**: Saved with other user preferences
74+
75+
#### **Core.js Updates**
76+
- **Import**: Layout utility functions
77+
- **Parameters**: All command functions accept `layoutParadigm` parameter
78+
- **Defaults**: Fallback to 'rows' if preference not set
79+
- **Integration**: Both menu commands and UI actions use paradigm setting
80+
81+
#### **UI Integration**
82+
- **PreferencesView.js**: Added layout paradigm selector
83+
- **App.js**: Pass layout paradigm attribute to preferences view
84+
- **Data Flow**: Core.js → App.js → PreferencesView.js → back to Core.js
85+
86+
---
87+
88+
### Implementation Details
89+
90+
#### **Files Modified**
91+
1. **`src/utils/LayoutUtils.js`** (NEW)
92+
- Pure layout algorithm functions
93+
- Support for both rows and columns paradigms
94+
- Modular, testable code structure
95+
96+
2. **`src/Core.js`**
97+
- Import layout utilities
98+
- Remove old algorithm code (cleaner codebase)
99+
- Add layout paradigm parameters to all commands
100+
- Update default preferences
101+
102+
3. **`src/ui/views/preferences/PreferencesView.js`**
103+
- Add layout paradigm selector UI
104+
- Update savePreferences() to capture new setting
105+
- Clear user-facing descriptions
106+
107+
4. **`src/App.js`**
108+
- Pass layoutparadigm attribute to preferences view
109+
- Ensure proper data binding
110+
111+
#### **Backward Compatibility**
112+
- **Default behavior**: Unchanged for existing users
113+
- **Preference migration**: Automatic fallback to 'rows'
114+
- **No breaking changes**: All existing functionality preserved
115+
116+
#### **Performance Considerations**
117+
- **Pure functions**: All layout algorithms are stateless
118+
- **Efficient sorting**: Optimized for typical Figma selection sizes
119+
- **Memory usage**: No additional overhead for rows layout
120+
121+
---
122+
123+
### Benefits & Use Cases
124+
125+
#### **For Presentation Designers**
126+
- **Wide layouts**: Better organization for 16:9 and wider formats
127+
- **Space efficiency**: Vertical stacking saves horizontal real estate
128+
- **Visual flow**: More natural reading pattern for presentation content
129+
130+
#### **For Dashboard Designers**
131+
- **Card layouts**: Column organization for dashboard components
132+
- **Responsive thinking**: Easier to visualize mobile-first approaches
133+
- **Content grouping**: Logical vertical groupings
134+
135+
#### **For All Users**
136+
- **Choice**: Flexibility to pick the best paradigm per project
137+
- **Consistency**: Same numbering logic, different spatial arrangement
138+
- **Familiarity**: Easy toggle, no learning curve
139+
140+
---
141+
142+
### Quality Assurance
143+
144+
#### **Testing Scenarios**
145+
- ✅ Rows layout maintains original behavior
146+
- ✅ Columns layout works with all commands (Tidy, Rename, Reorder, Pager)
147+
- ✅ Preference saving and loading
148+
- ✅ Default fallback for new/migrated users
149+
- ✅ Build process successful
150+
- ✅ No linting errors
151+
152+
#### **Edge Cases Handled**
153+
- ✅ Missing layout_paradigm preference (defaults to 'rows')
154+
- ✅ Invalid preference values (fallback behavior)
155+
- ✅ Single frame selections
156+
- ✅ Complex nested groupings
157+
158+
#### **Code Quality**
159+
- ✅ Pure functions for testability
160+
- ✅ Clear separation of concerns
161+
- ✅ Consistent naming conventions
162+
- ✅ Proper error handling
163+
164+
---
165+
166+
### Future Enhancements (Optional)
167+
168+
#### **Potential Improvements**
169+
- [ ] **Grid layout**: Fixed grid with user-defined columns/rows
170+
- [ ] **Custom spacing**: Different X/Y spacing for columns vs rows
171+
- [ ] **Visual preview**: Show layout paradigm preview in preferences
172+
- [ ] **Smart detection**: Auto-suggest paradigm based on selection aspect ratio
173+
- [ ] **Mixed layouts**: Hybrid approaches for complex designs
174+
175+
#### **Advanced Features**
176+
- [ ] **Layout templates**: Saved layout configurations
177+
- [ ] **Responsive breakpoints**: Different paradigms for different screen sizes
178+
- [ ] **Animation**: Smooth transitions between paradigms
179+
- [ ] **Batch operations**: Apply different paradigms to different selections
180+
181+
---
182+
183+
### Technical Notes
184+
185+
#### **Architecture Decisions**
186+
- **Pure functions**: Easier to test and reason about
187+
- **Parameter passing**: Explicit layout paradigm parameter vs global state
188+
- **Fallback strategy**: Conservative defaults for reliability
189+
- **Code organization**: Separate utility file for better maintainability
190+
191+
#### **Memory Considerations**
192+
- Follows project architecture principles:
193+
- Core.js handles pure Figma Canvas and Storage APIs
194+
- UI logic remains in appropriate components
195+
- No cross-contamination of concerns
196+
197+
#### **Performance Impact**
198+
- **Minimal overhead**: Sorting algorithms are O(n log n)
199+
- **Memory efficient**: No additional data structures for rows mode
200+
- **Cache friendly**: Preference stored once, used multiple times
201+
202+
---
203+
204+
### Status: ✅ **Production Ready**
205+
206+
The columns layout paradigm feature is fully implemented and ready for production use. It addresses the user's specific request while maintaining backward compatibility and improving overall code organization. The feature provides significant value for presentation designers and wide-format layouts while preserving the familiar experience for existing users.
207+
208+
#### **Deployment Checklist**
209+
- [x] Feature implementation complete
210+
- [x] Code refactoring successful
211+
- [x] Build process verified
212+
- [x] No linting errors
213+
- [x] Backward compatibility maintained
214+
- [x] User interface updated
215+
- [x] Preference integration working
216+
217+
The feature enhances Super Tidy's versatility and directly addresses the presentation design workflow pain point identified by the user community.

0 commit comments

Comments
 (0)