Skip to content

feat(editor): chooseFiles opens the file picker for a "/" Image item, and the upload placeholder ships its styles - #359

Merged
vite-hub[bot] merged 2 commits into
mainfrom
feat/editor-choose-files
Nov 5, 2026
Merged

vite-hub[bot] merged 2 commits into
mainfrom
feat/editor-choose-files

Conversation

@onmax

@onmax onmax commented Nov 5, 2026 •

Copy link
Copy Markdown
Owner

A host that adds Upload gets an unstyled placeholder: the preview renders at full size, so it looks like the finished image, and "Uploading shot.png, 40%" sits under it as plain text. Only the editor playground styled .cue-upload. And a "/" menu's Image item had no way in: paste and drop upload, but nothing opens the file picker.

This adds a chooseFiles command (and chooseFiles(view, options) for ProseMirror hosts). It opens the file picker and uploads the picked files at the cursor, through the same upload(file, progress) callback and placeholders as a paste. A "/" item runs editor.chain().focus().deleteRange(range).chooseFiles().run(). pick sets the picker's accept, media by default. Under can() it reports whether it would run and opens nothing. The placeholder now adds its own styles to the page with the first one (addStyles, exported as uploadCss), on the --comark-* tokens: a dimmed preview capped at 15rem, the label on it, and a 2px progress bar in --comark-primary. The playground drops its copy of those styles and gets an Insert image button.

I checked both paths in headless Chromium on the playground: a paste and the Insert image picker each showed the placeholder with its percentage, then wrote ![name](url) at the cursor. Before/after on Drop. vp test run packages/ui (281 passed), pnpm typecheck, vp lint packages/ui, the comark-ui doctor and lint:docs pass. I haven't checked dark mode or a video file.

This is level 2 of upload feedback for Drop. @vite-hub/ui gets a MarkdownEditor next that puts this behind its "/" menu and sends the files to Blob.

… and the upload placeholder ships its styles
@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-11-05T16:27:19.614996Z
We couldn’t complete this review. Comment @codex review to try again.
2b5e869 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@vite-hub

vite-hub Bot commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor
Session Status Started Duration
Pending Completed Not started —
View session Starting Not started —

Latest result

Pull request merged.

Final answers

Session

Pull request merged.

Session

Pushed f31c298 fixing Pullfrog’s P1 WebKit picker retention and P1 CSS cascade contract findings; resolved both threads. Package-local upload tests passed all 10 cases; focused vp lint and tsrs passed. CSS parsing confirmed all nine rules are layered. Lifecycle tests failed before the fix and passed afterward; native Safari was unavailable. Awaiting new checks and reviews.

Session

Pushed f31c298 fixing Pullfrog’s P1 WebKit picker retention and P1 CSS cascade contract findings; resolved both threads. Package-local upload tests passed all 10 cases; focused vp lint and tsrs passed. CSS parsing confirmed all nine rules are layered. Lifecycle tests failed before the fix and passed afterward; native Safari was unavailable. Awaiting new checks and reviews.

Session

Pushed f31c298 fixing Pullfrog’s P1 WebKit picker retention and P1 CSS cascade contract findings; resolved both threads. Package-local upload tests passed all 10 cases; focused vp lint and tsrs passed. CSS parsing confirmed all nine rules are layered. Lifecycle tests failed before the fix and passed afterward; native Safari was unavailable. Awaiting new checks and reviews.

Session

Pushed f31c298 fixing Pullfrog’s P1 WebKit picker retention and P1 CSS cascade contract findings; resolved both threads. Package-local upload tests passed all 10 cases; focused vp lint and tsrs passed. CSS parsing confirmed all nine rules are layered. Lifecycle tests failed before the fix and passed afterward; native Safari was unavailable. Awaiting new checks and reviews.

Session

Pushed f31c298 fixing Pullfrog’s P1 WebKit picker retention and P1 CSS cascade contract findings; resolved both threads. Package-local upload tests passed all 10 cases; focused vp lint and tsrs passed. CSS parsing confirmed all nine rules are layered. Lifecycle tests failed before the fix and passed afterward; native Safari was unavailable. Awaiting new checks and reviews.

Session

Pushed f31c298 fixing Pullfrog’s P1 WebKit picker retention and P1 CSS cascade contract findings; resolved both threads. Package-local upload tests passed all 10 cases; focused vp lint and tsrs passed. CSS parsing confirmed all nine rules are layered. Lifecycle tests failed before the fix and passed afterward; native Safari was unavailable. Awaiting new checks and reviews.

Session

Pushed f31c298 fixing Pullfrog’s P1 WebKit picker retention and P1 CSS cascade contract findings; resolved both threads. Package-local upload tests passed all 10 cases; focused vp lint and tsrs passed. CSS parsing confirmed all nine rules are layered. Lifecycle tests failed before the fix and passed afterward; native Safari was unavailable. Awaiting new checks and reviews.

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Important

The picker can silently fail on Safari/WebKit, and the injected CSS bypasses the repository's documented cascade layer contract.

Reviewed changes in the initial review of the file-picker command and upload-placeholder styling.

  • Picker command — adds ProseMirror and Tiptap APIs that select multiple media files and reuse the existing upload pipeline at the current cursor.
  • Placeholder styles — moves upload preview, label, progress, theming, and reduced-motion rules from the playground into runtime-injected exported CSS.
  • Host examples — documents the slash-menu chain and adds an Insert image control to the editor playground.
  • Coverage — adds direct tests for picker defaults, insertion, and the disabled-without-upload path.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using gpt-5.6-sol | 𝕏

Comment thread packages/ui/src/editor/upload.ts Resolved
Comment thread packages/ui/src/editor/upload.ts Resolved
@pkg-pr-new

pkg-pr-new Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Open in StackBlitz

comark-annotate

pnpm add https://pkg.pr.new/comark-annotate@359

comark-badge

pnpm add https://pkg.pr.new/comark-badge@359

comark-cards

pnpm add https://pkg.pr.new/comark-cards@359

comark-carousel

pnpm add https://pkg.pr.new/comark-carousel@359

comark-cast

pnpm add https://pkg.pr.new/comark-cast@359

comark-charts

pnpm add https://pkg.pr.new/comark-charts@359

comark-chat

pnpm add https://pkg.pr.new/comark-chat@359

comark-chips

pnpm add https://pkg.pr.new/comark-chips@359

comark-cjk

pnpm add https://pkg.pr.new/comark-cjk@359

comark-code

pnpm add https://pkg.pr.new/comark-code@359

comark-code-notes

pnpm add https://pkg.pr.new/comark-code-notes@359

comark-colors

pnpm add https://pkg.pr.new/comark-colors@359

comark-comments

pnpm add https://pkg.pr.new/comark-comments@359

comark-critic

pnpm add https://pkg.pr.new/comark-critic@359

comark-deflist

pnpm add https://pkg.pr.new/comark-deflist@359

comark-details

pnpm add https://pkg.pr.new/comark-details@359

comark-diagrams

pnpm add https://pkg.pr.new/comark-diagrams@359

comark-diff

pnpm add https://pkg.pr.new/comark-diff@359

comark-embed

pnpm add https://pkg.pr.new/comark-embed@359

comark-fields

pnpm add https://pkg.pr.new/comark-fields@359

comark-figure

pnpm add https://pkg.pr.new/comark-figure@359

comark-file-tree

pnpm add https://pkg.pr.new/comark-file-tree@359

comark-footnotes

pnpm add https://pkg.pr.new/comark-footnotes@359

comark-github

pnpm add https://pkg.pr.new/comark-github@359

comark-icon

pnpm add https://pkg.pr.new/comark-icon@359

comark-include

pnpm add https://pkg.pr.new/comark-include@359

comark-keys

pnpm add https://pkg.pr.new/comark-keys@359

comark-links

pnpm add https://pkg.pr.new/comark-links@359

comark-linter

pnpm add https://pkg.pr.new/comark-linter@359

comark-magic-move

pnpm add https://pkg.pr.new/comark-magic-move@359

comark-mark

pnpm add https://pkg.pr.new/comark-mark@359

markdown-it-to-comark

pnpm add https://pkg.pr.new/markdown-it-to-comark@359

marked-to-comark

pnpm add https://pkg.pr.new/marked-to-comark@359

comark-mathml

pnpm add https://pkg.pr.new/comark-mathml@359

comark-media

pnpm add https://pkg.pr.new/comark-media@359

comark-metrics

pnpm add https://pkg.pr.new/comark-metrics@359

migrate-to-comark

pnpm add https://pkg.pr.new/migrate-to-comark@359

comark-outline

pnpm add https://pkg.pr.new/comark-outline@359

comark-properties

pnpm add https://pkg.pr.new/comark-properties@359

comark-qr

pnpm add https://pkg.pr.new/comark-qr@359

comark-quiz

pnpm add https://pkg.pr.new/comark-quiz@359

comark-reading-time

pnpm add https://pkg.pr.new/comark-reading-time@359

remark-to-comark

pnpm add https://pkg.pr.new/remark-to-comark@359

comark-sources

pnpm add https://pkg.pr.new/comark-sources@359

comark-steps

pnpm add https://pkg.pr.new/comark-steps@359

comark-table

pnpm add https://pkg.pr.new/comark-table@359

comark-tabs

pnpm add https://pkg.pr.new/comark-tabs@359

comark-tests

pnpm add https://pkg.pr.new/comark-tests@359

comark-time

pnpm add https://pkg.pr.new/comark-time@359

comark-ui

pnpm add https://pkg.pr.new/comark-ui@359

comark-xref

pnpm add https://pkg.pr.new/comark-xref@359

comark-zoom

pnpm add https://pkg.pr.new/comark-zoom@359

commit: f31c298

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

✅ No new issues found.

Reviewed changes since the prior Pullfrog review, covering the follow-up fixes for the file-picker lifecycle and upload-placeholder cascade behavior.

  • Retained picker input — attached the temporary file input off-screen until change or cancel, then removed it, addressing Safari/WebKit event reliability.
  • Layered placeholder styles — wrapped the upload theme and component rules in @layer comark, restoring the documented host override contract.
  • Lifecycle coverage — updated the picker harness to require an attached input and added cancellation cleanup coverage without starting an upload.

Pullfrog  | View workflow run | Using gpt-5.6-sol | 𝕏

@vite-hub
vite-hub Bot merged commit 949f7ad into main Nov 5, 2026
6 checks passed
@vite-hub
vite-hub Bot deleted the feat/editor-choose-files branch November 5, 2026 16:57
@github-actions github-actions Bot mentioned this pull request Nov 5, 2026
onmax added a commit to vite-hub/vitehub that referenced this pull request Nov 5, 2026
@github-actions github-actions Bot mentioned this pull request Nov 7, 2026
vite-hub Bot added a commit to vite-hub/vitehub that referenced this pull request Nov 7, 2026
…ploads files to Blob (#3404)

* feat(blob): uploadFiles reports upload progress with onProgress

* feat(ui): MarkdownEditor edits Markdown with comark-ui's editor and uploads files to Blob

* chore(ui): pin comark-ui to the latest build of onmax/comark-ui#359

* fix(ui): preserve editor selection and repair documentation contracts

* fix(ui): repair editor package contracts and Blob typechecks

* fix(ui): repair optional peer probe and editor presentation

---------

Co-authored-by: vite-hub[bot] <320448255+vite-hub[bot]@users.noreply.github.com>
vite-hub Bot added a commit to vite-hub/vitehub that referenced this pull request Nov 10, 2026
* chore(deps): update Comark to 0.9 and comark-content to 0.5.1

Move comark, @comark/html and @comark/vue to 0.9.0, comark-content to
0.5.1 and comark-ui to 0.10.0 together, since comark-ui 0.10 needs
comark 0.9 as a peer. comark-ui 0.10 includes onmax/comark-ui#359, so
@vite-hub/ui drops its pkg.pr.new pin and uses the catalog again.

comark-chat stays at 0.7.1. Its 0.10.0 stylesheet has
`@supports (interpolate-size:allow-keywords) and selector(::details-content)`,
which autoprefixer 10.6 cannot parse, so Nuxt builds that import
@vite-hub/ui/styles.css fail. Its Vue renderer is the same in both
versions and only imports `Markdown` from @comark/vue.

Comark 0.9 only registers linkify as a default plugin and turns fuzzy
links off. The Markdown component parses with registerDefaultPlugins
false, so it registers linkify() itself to keep linking URLs. The GitHub
mention parser registers linkify with fuzzyLink and urlAuth, the old
behavior, because GitHub autolinks www.example.com. The removed `html`
parser option goes away from the Markdown component and its test.

* chore(deps): update KaTeX to 0.19.1 for Comark 0.9

comark 0.9 declares `katex ^0.19.1` as a peer. With KaTeX 0.18 in
@vite-hub/agent, a consumer install with --strict-peer-dependencies
fails with ERR_PNPM_PEER_DEP_ISSUES, which
published-chat-adapter-types.test.ts caught in CI.

---------

Co-authored-by: vite-hub[bot] <320448255+vite-hub[bot]@users.noreply.github.com>
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