Skip to content

feat: restore media capabilities and improve reference uploads - #14

Merged
nextroad-dev merged 3 commits into
mainfrom
feat/video-capabilities-reference-upload
Sep 24, 2026
Merged

nextroad-dev merged 3 commits into
mainfrom
feat/video-capabilities-reference-upload

Conversation

@nextroad-dev

Copy link
Copy Markdown
Owner

Summary

  • Restore plugin-declared media capabilities and descriptor-driven generation controls missing from the current main tree.
  • Improve reference image staging with asynchronous dimension checks and gallery handling.
  • Include related API/worker decision tests and reusable accessible UI components.

Why this includes the media-capability changes

PR #13 is marked merged, but the current main tree (d4599d8) is identical to the earlier pre-PR-#13 baseline (69b2022); the merged PR #13 tree is not present in current main. This branch is based on current main and includes the missing prerequisite changes plus the follow-up upload work, rather than relying on unrelated branch history.

Validation

  • pnpm typecheck — passed
  • pnpm test — passed

nextroad-dev and others added 3 commits September 24, 2026 23:56
… from them

Media parameters were invented by the host instead of by the plugins. The API
synthesized size/quality descriptors from flat model_configs columns, route.ts
validated image requests against a `{type:'text',maxLength:32}` stub, and the
console hardcoded five size options -- two of which no configured model accepts.
`size:"9999x9999"` therefore passed the boundary, queued a job, and failed at the
vendor, so users saw a dead task instead of a form error naming the field.

Provider manifests are now the single source of truth. Each media model declares
its parameter descriptors, geometry limits, dependencies and edit capabilities,
and one validator in @musecanvas/contracts is shared by the browser, the API, the
domain normalizer and the plugin adapters -- so a rendered control and an
acceptable value are the same set by construction rather than three lists that
can disagree.

- image-size descriptors carry presets plus a custom-size band; the picker
  validates live and blocks submit before a 400 comes back
- dependsOn and cross-field rules hide output_compression for lossless formats
  and reject background=transparent with jpeg, in the API and adapter too
- model switches reconcile to the new contract instead of sending stale values
- retries re-validate against the revision the job is pinned to
- a model with no declared contract is refused, never guessed at
- migrate.ts appends manifest-declared revisions; historical jobs keep rendering
  the parameters they were created with

apps/web-next also stopped hand-copying the descriptor types from contracts, and
CI's integration step now takes a glob instead of one filename, so new tests under
tests/integration/ actually run.

This commit bundles in-flight work from concurrent sessions (region-select image
editing, the plugin-upload catalog, and the route.ts -> modules/router split).
Their hunks are interleaved with these changes inside shared files and this tree
does not compile without their untracked modules, so the threads could not be
separated; that work is not verified by me beyond the suite passing as a whole.

Co-Authored-By: Qoder <noreply@qoder.com>
…eout

`importBundle` unrefs its timeout on purpose, so a bundle that never settles
leaves the test file holding no pending handle at all: the never-resolving import
promise owns none and the unref'd timer refuses to own one. The loop drains, Node
exits, and every in-flight test is reported as "Promise resolution is still
pending but the event loop has already resolved".

libuv kept lingering fs handles alive on Windows, which masked it; on Linux CI
four loader tests were cancelled by the parent process exiting. A ref'd interval
cleared in `after` reproduces the invariant the real worker has -- something
always owns the loop -- without weakening the production unref that stops a
wedged plugin from holding the process open.
- Introduced a pending array to manage files awaiting dimension checks before staging.
- Moved dimension checks to after file staging to preserve user selection order.
- Improved error handling for dimension validation and gallery image refresh.
- Added new state management for reference preparation in the generate UI store.

test: add unit tests for job processing decisions

- Implemented tests for job claim decisions, ensuring correct handling of job states.
- Added tests for capacity denial and submit result decisions to validate expected behaviors.

feat: implement reusable UI components

- Created new components: Reveal, Checkbox, Dialog, Skeleton, Switch, ThemeToggle, Toast, Tooltip.
- Each component includes accessibility features and customizable styles for improved user experience.
@nextroad-dev
nextroad-dev merged commit a8c1696 into main Sep 24, 2026
6 checks passed
@nextroad-dev
nextroad-dev deleted the feat/video-capabilities-reference-upload branch September 24, 2026 16:08
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.

1 participant