Skip to content

fix: arrays.colors dropdown and startup race condition#863

Merged
PythonFZ merged 1 commit intomainfrom
fix/dropdown-and-race-condition
Jan 18, 2026
Merged

fix: arrays.colors dropdown and startup race condition#863
PythonFZ merged 1 commit intomainfrom
fix/dropdown-and-race-condition

Conversation

@PythonFZ
Copy link
Copy Markdown
Member

@PythonFZ PythonFZ commented Jan 18, 2026

  • Add built-in array references (arrays.colors, arrays.positions, arrays.radii) to dynamic enum dropdowns in geometry forms
  • Fix race condition when running zndraw file.h5 by adding ?template=none to browser URL, ensuring room starts with 0 frames until Celery uploads file data

Summary by CodeRabbit

  • Bug Fixes

    • Fixed race condition when loading files from remote/local servers with browser enabled. Prevents premature empty frame creation and ensures proper file data synchronization.
  • Improvements

    • Enhanced dynamic property enum handling for more reliable operation. Improved automatic detection of color-picker and array-based features.

✏️ Tip: You can customize this high-level summary in your review settings.

- Add built-in array references (arrays.colors, arrays.positions,
  arrays.radii) to dynamic enum dropdowns in geometry forms
- Fix race condition when running `zndraw file.h5` by adding
  ?template=none to browser URL, ensuring room starts with 0 frames
  until Celery uploads file data

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Jan 18, 2026

📝 Walkthrough

Walkthrough

This PR modifies JSON form enum injection to handle dynamic atom properties without requiring metadata presence by computing enum references from built-in arrays, and adjusts CLI room URL construction to append a template parameter when loading files to prevent race conditions.

Changes

Cohort / File(s) Summary
JSON Forms enum injection
app/src/utils/jsonforms.ts
Refactors injectDynamicEnums to compute enum references from built-in arrays based on color-picker presence, then unions with metadata keys and deduplicates. Removes requirement for metadata to exist when injecting dynamic-atom-props.
CLI room initialization
src/zndraw/cli.py
Appends template=none parameter to initial room URL when loading files with browser enabled, preventing race condition where empty template is created before file data uploads.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 Enums now flow without metadata chains,
Dynamic arrays light the way,
Template race conditions fade away,
With template=none leading the dance,
Smooth uploads, no more second glance! 🎨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely summarizes both main changes: fixing arrays.colors dropdown functionality and addressing a startup race condition.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented Jan 18, 2026

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 80.02%. Comparing base (450bc3a) to head (01bbbac).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/zndraw/cli.py 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #863      +/-   ##
==========================================
+ Coverage   80.01%   80.02%   +0.01%     
==========================================
  Files         165      165              
  Lines       20131    20133       +2     
==========================================
+ Hits        16108    16112       +4     
+ Misses       4023     4021       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@PythonFZ PythonFZ merged commit 68ddb45 into main Jan 18, 2026
6 checks passed
@PythonFZ PythonFZ deleted the fix/dropdown-and-race-condition branch January 18, 2026 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants