feat: restore media capabilities and improve reference uploads - #14
Merged
Merged
Conversation
… 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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— passedpnpm test— passed