Spaces:
Sleeping
Sleeping
Commit History
-
Global code-quality polish: DRY + named constants + leak cleanup
Yuchen Yuan +1: Claude Opus 4.7 (1M context)Targeted refactor pass based on a structured audit. Pure maintainability wins; no behaviour changes. Frontend: collapse 8 popovers into one hook 8 components (AuthButton, ThemeSwitcher, MoreMenu, PapersPopover, SupportPopover, DevelopersPopover, BlockPicker, PresetPicker) each carried an identical 16-line "close on mousedown + Escape" effect block. Extracted to lib/useDismissOn.ts; ~150 lines deleted, one hook to audit instead of eight. useDismissOn(open, rootRef, useCallback(() => setOpen(false), [])) Behaviour is intentionally identical to the inlined block so older git-blame on the call sites stays coherent. Backend: consolidate effective-user-id resolution routes/plugins.py and routes/workflow.py each carried a subtly different implementation of "session cookie wins over query_user_id, anon hf_ prefix is reserved". Pulled into auth_service.resolve_effective_user_id(request, query, *, required). - required=True path raises ValueError → routes/plugins maps to 400 - required=…57f0b3e
-
Plugin protocol Phase 4: full UI integration
Yuchen Yuan* lib/nodeCatalog.ts — `synthesizePluginSpec(manifest)` builds a NodeSpec on the fly from a backend-served PluginManifest. `resolveNodeSpec(kind, plugins)` is the new single source of truth for spec lookups: returns the built-in spec if available, otherwise the synthesized plugin spec, otherwise undefined. Adds PluginNodeSpec (NodeSpec + isPlugin/initials/pluginColor). * UploadPluginModal.tsx — drag-drop or click-to-pick .zip, posts to /api/plugins/upload with the browser's anonymous user_id, surfaces backend validation errors verbatim, refreshes the in- store plugin list on success. Inline docs spell out the manifest + handler.py contract. * NodePalette — new "Upload" button next to "Add blocks"; merges plugin specs with NODE_CATALOG before filtering by search / family chips. Plugin tiles render with the manifest's color + first-letter badge instead of a Lucide icon, and grow an X delete affordance on hover (with confirm dialog). * BlockPicker — same merge…74b7708 -
Fix 3 audit findings: export signatures, cache safety, accessibility
Yuchen Yuan1. CRITICAL — exportPython.ts CompressVQC template had 3 wrong function calls: - quadraticProgram_luttoqp(lut) → (qc, lut) - admmOptimizedCompVQC(qp, lut) → (qp) - resultsCompressVQC(qc, result, lut) → (result, qc) All verified against backend/qlib/compvqc.py actual signatures. Users who exported and ran pipeline.py would have hit TypeError. 2. MEDIUM — Step cache _cache_put now deep-copies QuantumCircuit objects via qc.copy() instead of storing references. Prevents a future handler that mutates circuit in-place from silently corrupting cached snapshots. Current handlers all reassign, so this is defensive, but the cost (one .copy() per step) is cheap. 3. MEDIUM — BlockPicker button now has aria-haspopup, aria-expanded, aria-label. Dropdown div has role="menu" and aria-label. Screen reader users can now navigate the block catalog.51365eb -
Polish pass: brand cleanup, popover consistency, mobile safety
Yuchen YuanAudit-driven fixes: 1. Branding: - Dockerfile comment: QuAIM → QuDA Studio - package.json name: jqub-quantum-flow-ui → quda-studio-ui - All localStorage keys: jqub.* → quda.* (theme, pane widths, collapsed state, IBM toggle, tour flag). Existing users will see fresh defaults on first visit (acceptable — the old Space URL is gone anyway so there's no continuity to preserve). 2. Popover consistency: - All 4 popovers (Papers, Developers, Support, BlockPicker) now share z-40 instead of a mix of z-30 and z-50. - BlockPicker gets the same mobile-safe positioning as the other three: fixed left-3 top-14 on narrow screens, absolute on ≥sm. - BlockPicker width clamped with min() so it can't overflow on narrow viewports. 3. Pre-hydration script in index.html updated to read quda.theme instead of jqub.theme.95967ab
-
BlockPicker: pre-check required blocks + per-family guidance hints
Yuchen Yuan7a9f56e -
Add dropdown BlockPicker for browse-and-select workflow
Yuchen YuanNew "Add blocks" button in the NodePalette header opens a dropdown list showing ALL blocks organised by family (Source / Backend / Algorithm / Metric / Sink). Users can: - Search/filter by name or tagline - Check multiple blocks via checkboxes - See "on canvas" badges for blocks already placed - Hit "Add to canvas" to batch-create all checked blocks (auto- connected via the existing Zustand pendingBlockKinds bridge) The tile strip stays for drag-and-drop (quick access). The dropdown is the structured alternative for building a pipeline from scratch or when there are many blocks to browse. Tile checkboxes from the previous commit are removed — tiles go back to drag-only, keeping them clean. The dropdown handles the multi-select workflow instead.f152600