Skip to content

Bring over upload from the widgets so it can be reused - #354

Open
SharonStrats wants to merge 3 commits into
stagingfrom
add-upload
Open

SharonStrats wants to merge 3 commits into
stagingfrom
add-upload

Conversation

@SharonStrats

@SharonStrats SharonStrats commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Add the upload to resource logic

Prompt: move the uploadFiles from solid-ui widgets to resource logic, remove
ui, add resilient file failure, return structured messages for results.

Co-authored-by: GPT-5.6 Luna <gpt-5.6-luna@openai.com>
@SharonStrats
SharonStrats requested a balanced review from Copilot November 6, 2026 19:55
@SharonStrats SharonStrats self-assigned this Nov 6, 2026
@SharonStrats SharonStrats added the enhancement New feature or request label Nov 6, 2026
@SharonStrats SharonStrats moved this to In review in SolidOS NLNet UI Nov 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The upload handler reports fulfilled non-2xx PUT responses as successful, and recognized images are routed to the wrong folder when the browser omits their MIME type.

2 open issues
What changed in this PR

Adds reusable file uploads to SolidOS resource logic, making upload behavior available outside widgets.

Changes:

  • Adds batch uploads with MIME detection, image-folder routing, and per-file results.
  • Exports upload result and error types and adds upload tests.
  • Adds mime-types, bumps the package version, and refreshes locked dependencies.
File Description
test/​resourceLogic.test.ts Tests image uploads and independent per-file failures.
src/​types.ts Defines upload results, errors, and the resource upload API.
src/​resource/​resourceLogic.ts Implements file reading, destination selection, and PUT uploads.
src/​index.ts Exports the upload result type and error class.
package.json Adds mime-types and increments the package version.
package-lock.json Records the dependency addition and refreshed dependency versions.

Review effort: Balanced

Comment thread src/resource/resourceLogic.ts Resolved
Comment thread src/resource/resourceLogic.ts Resolved
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@SharonStrats SharonStrats linked an issue Nov 6, 2026 that may be closed by this pull request
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: In review

Development

Successfully merging this pull request may close these issues.

Move uploadFiles to resource logic

2 participants