Skip to content

feat(assets): add dual-origin AssetInput field - #211

Merged
IAnMove merged 2 commits into
developmentfrom
feat/asset-picker-input
Sep 7, 2026
Merged

feat(assets): add dual-origin AssetInput field#211
IAnMove merged 2 commits into
developmentfrom
feat/asset-picker-input

Conversation

@IAnMove

@IAnMove IAnMove commented Sep 7, 2026

Copy link
Copy Markdown
Owner

Summary

  • New AssetInput: From my computer (native file dialog) and From HocusPocus (shared explorer).
  • Native cancel does not mutate the field. Optional Remove is distinct from Cancel.
  • Upload adapter reuses /api/v1/upload and /api/v1/upload-audio; abort on unmount so a late response cannot apply.
  • Does not edit explorer chrome/preview (PR 3). Do not merge until asked.
  • Note: CURRENT_WORK.md / i18n picker.* may need a trivial rebase if PR 3 lands first.

Test plan

  • assetInput.test.tsx — kind inference, native cancel, explorer open, Remove, failed upload
  • i18n, eslint, local code-health ratchet
  • Cursor review: not run (quota)

Coste de la tarea

  • Tests simulados: 0 tokens externos
  • Tests reales: N/A
  • Llamadas LLM externas: 0
  • Tokens de prompt: N/A
  • Tokens de respuesta: N/A
  • Tokens totales: N/A
  • Generaciones de imágenes/audio/vídeo: 0
  • Tiempo transcurrido: N/A
  • Proveedores/modelos: N/A

Note

Low Risk
Additive picker primitive with tests and upload abort guards; no broad migration of existing form fields in this diff.

Overview
Adds AssetInput, the asset-picker PR 4 control that exposes two explicit sources—from device (hidden file input + drag-and-drop) and from HocusPocus (existing AssetExplorerDialog)—on top of AssetPickTrigger, with optional Remove separate from explorer cancel.

Introduces upload.ts (inferUploadKind, uploadLocalAsset, createUploadSession) to post locals through existing uploadAudio / uploadImage (/api/v1/upload-audio and /api/v1/upload), map results into ApiOutput, and abort in-flight uploads on unmount so late responses cannot call onChoose. New picker.* strings in EN/ES cover device/library/remove/upload states.

Exports AssetInput and upload helpers from features/asset-picker; assetInput.test.tsx covers kind inference, empty native pick, library open/cancel, remove, and failed upload after unmount. Docs shift active work from modal PR 2 to PR 4 (CURRENT_WORK.md, ASSET_PICKER_MIGRATION.md hotspots); explorer preview/chrome remain out of scope.

Reviewed by Cursor Bugbot for commit 50065f4. Configure here.

@cursor

cursor Bot commented Sep 7, 2026

Copy link
Copy Markdown

Bugbot couldn't run - usage limit reached

Bugbot is counted against Cursor usage for this user or team, and this run hit a usage or spend limit.

A user or team admin can review and increase usage limits in the Cursor dashboard.

(requestId: serverGenReqId_89dfdd15-b533-4cfb-91c3-eabb0db17f11)

@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

PR Review — Loreframe Studio

Risk: low
Scope: 8 file(s); +279/-8; React UI, docs

Automated review from scripts/analyze_pr.py. This is a heuristic pass (no LLM) so humans still own the merge decision.

Findings

  • low — UI changed — rebuild before merge
    Run cd ui && npm run build (CI already does this). Pinokio Update rebuilds for end users; keep ui/dist untracked.

Changed files

  • added: ui/src/features/asset-picker/AssetInput.tsx, ui/src/features/asset-picker/upload.ts, ui/tests/assetInput.test.tsx
  • modified: docs/development/ASSET_PICKER_MIGRATION.md, docs/development/CURRENT_WORK.md, ui/src/features/asset-picker/index.ts, ui/src/i18n/locales/en/common.json, ui/src/i18n/locales/es/common.json

CONTRIBUTING checklist

  • python scripts/verify_clean_repo.py
  • python -m compileall -q app/services app/launch.py scripts
  • cd ui && npm run build if the UI changed
  • No weights, CivitAI sidecars, or generated guides
  • Stays local-first (no required accounts / telemetry)

Posted by the repo PR review workflow. Re-runs on each push to the PR.

IAnMove added a commit that referenced this pull request Sep 7, 2026
@github-actions

github-actions Bot commented Sep 7, 2026

Copy link
Copy Markdown

Code health

Quality score: 54.0/100

Higher is better. The score is a trend dashboard; the independent ratchet below remains the CI gate.

Component Weight Current Change
Cyclomatic health 45% 54.3 +0.1
File concentration 25% 60.6 +0.0
Oversized-file debt 20% 36.1 +0.1
Modularity 10% 72.3 +0.1

Change vs PR base: +0.0 points.

Metric Value
Production LOC 261,203
Production files 663
Test LOC 89,918
Functions measured 16,741
Functions complexity ≥ 15 822
Maximum complexity 670
Policy code-health-policy-v1
HEAD 177d0f67497126daf5160a84fab5fc77b1ec7582
Base 631c0d4768e9e325ca428c797af25c31435bf121
UI measurement complete

Markdown, JSON catalogs and tests are out of this table. Only app/ runtime + ui/src TS/JS count.

Most complex functions

Complexity Where
670 app/wgp.py:7164 generate_video
376 ui/src/stores/useStore.ts:4029 Async method 'startGeneration'
355 app/_launch_runtime.py:23505 _run_generation
308 app/wgp.py:12298 generate_video_tab
271 ui/src/stores/useStore.ts:8572 Async method 'loadSettingsFromOutput'
258 app/services/director/planners/short_film.py:3433 ShortFilmPlanner._plan_story_driven
257 ui/src/components/Sidebar/SceneAnimatorPanel.tsx:478 Function 'SceneAnimatorPanel'
248 app/services/director_pipeline.py:13607 _run_video_generation
245 app/services/director_pipeline.py:7712 _run_pipeline
244 ui/src/features/agent/agentActions.ts:1145 Function 'parseAction'
226 app/services/director_pipeline.py:6541 update_comic_preview
225 ui/src/features/agent/agentActions.ts:2892 Async function 'executeAgentActions'

Trend vs baseline

Metric Δ
Production LOC +155
Test LOC +105
Functions ≥ 15 +0
Maximum complexity +0

Warnings

  • production LOC increased by +155

Ratchet passed.

Expose From my computer and From HocusPocus on the same control.
Native file cancel does not mutate the field; uploads abort on unmount.
@IAnMove
IAnMove force-pushed the feat/asset-picker-input branch from 22db8bf to 9c6d43e Compare September 7, 2026 09:23
@IAnMove
IAnMove merged commit 1e6cb63 into development Sep 7, 2026
10 checks passed
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