Fix duplicate append bug and componentize tabs
**Bug Fixes:** - Fixed duplicate js_append_child calls causing DOM element re-insertion - Elements were being appended twice: once by self-append logic, once by parent loop - This was breaking CSS transitions on vertical tabs (elements moved in DOM) - Removed self-append logic from _emit_with() and _emit_yield_component() **Refactoring:** - Created reusable HTab and VTab components for horizontal/vertical tabs - Reduced repetitive tab code from 9 lines per tab to 1 line - Improved code maintainability and reusability - WASM bundle size reduced from 5987 bytes to 4690 bytes (22% reduction!) **Result:** - CSS transitions now work smoothly on vertical tabs ✓ - All 55 tests passing ✓ - Cleaner, more composable tab components ✓ 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
1 parent
1575571f3e
commit
134ddc4c42
5 files changed
+429
-624
No files matched your search
Binary file not shown.
@@ -916,11 +916,6 @@ class SignalLLVMIRGenerator:
|
||||
else:
|
||||
self.lines.append(f" %{elem_var} = call i32 @render_{component_name}()")
|
||||
|
||||
# Append to parent if we have one
|
||||
if self.parent_element_stack:
|
||||
parent_var = self.parent_element_stack[-1]
|
||||
self.lines.append(f" call void @js_append_child(i32 %{parent_var}, i32 %{elem_var})")
|
||||
|
||||
return elem_var
|
||||
|
||||
def _emit_match(self, stmt: dict[str, Any]) -> str | None:
|
||||
@@ -1165,11 +1160,6 @@ class SignalLLVMIRGenerator:
|
||||
# Pop parent
|
||||
self.parent_element_stack.pop()
|
||||
|
||||
# If we're inside an if/match branch (have a grandparent), append to it
|
||||
if self.parent_element_stack:
|
||||
parent_var = self.parent_element_stack[-1]
|
||||
self.lines.append(f" call void @js_append_child(i32 %{parent_var}, i32 %{elem_var})")
|
||||
|
||||
return elem_var
|
||||
|
||||
def _emit_yield(self, stmt: dict[str, Any]) -> str | None:
|
||||
|
||||
Reference in new issue
Block a user