Repository navigation
🎯 Highlights
- Fixed layout flicker - Eliminated the 1-frame flicker that occurred when UI structure changed
- Stable hash-based IDs - Layout node IDs are now based on tree hierarchy, not sequential order
- New layout API - Added
PushId/PopIdfor advanced manual ID control
🔧 Changes
Layout System Improvements
- Replaced sequential ID generation with FNV-1a hash-based stable IDs
- Node IDs remain stable when siblings are added/removed or panels are toggled
- IDs are now derived from the node's position in the tree hierarchy
- Changed internal map keys from
inttouint32_tfor hash storage
New API
// Push/pop explicit IDs for stable layout identity
static void PushId(const char* str_id);
static void PushId(int int_id);
static void PopId();Bug Fixes
- Fixed layout flicker during dynamic UI updates
- Fixed ID shifts when switching tabs or toggling panels
- Prevented layout position jumps when structure changes
🔄 Backward Compatibility
All existing code continues to work without modifications:
SetIdOffsetmaintains backward compatibility- No breaking changes to public API
- Optional
PushId/PopIdavailable for advanced use cases
📝 Technical Details
- Implemented ID stack infrastructure with child scope management
- Added FNV-1a hash functions for deterministic ID generation
- Each container pushes a scope so children hash relative to parent
SetIdOffsetnow integrates with the hash-based system for tab isolation
✅ Testing
- FoveaEditor builds successfully
- Layout system functions correctly with no flicker
- All existing functionality preserved
- Memory-safe operations verified