feat(mcp): style the upload apps' file picker - #452
Merged
Conversation
The Upload to IPFS / Upload to Vault apps dropped the native <input type="file"> into the grid, which renders the browser's unthemed "Choose file/No file chosen" chrome and made it hard to tell the file field from the submit button. Replace the bare native input with a styled composite picker: the native input is pinned invisible under a themed "Choose file" button plus the picked-file label (file-field/file-picker/file-btn/file-name utilities in the shared inline theme). Both upload bootstraps now wire a change listener that reflects the picked file's name in the label, so what was selected is always visible before submitting. Clicking anywhere on the styled field still opens the native picker; the submit (Upload) button is unchanged and now reads clearly against the distinct file chrome. Coverage: extend the sunpeak browser inspector suite with upload/vault file-picker tests that assert the chrome renders and that selecting a file updates the label across the ChatGPT and Claude hosts.
Kody Review CompleteGreat news! 🎉 Keep up the excellent work! 🚀 Kody Guide: Usage and ConfigurationInteracting with Kody
Current Kody ConfigurationReview OptionsThe following review options are enabled or disabled:
|
Code Coverage ReportTotal Coverage: 51.7% Generated from commit: 4e81752 |
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
Fixes a UI quirk in the Upload to IPFS / Upload to Vault MCP apps: the native
<input type="file">was dropped straight into the grid, rendering the browser's unthemed "Choose file / No file chosen" chrome and making it hard to tell the file field from the submit button.What changed
file-field,file-picker,file-btn,file-nameutilities added to the shared inline Tailwind theme ininput.css). Clicking anywhere on the field still opens the native picker.ipfs-upload-bootstrap.ts,vault-upload-bootstrap.ts) now wire achangelistener that reflects the picked file's name in the label, so what was selected is visible before submitting ("No file chosen" until then).Files:
internal/mcpapp/css/input.css(theme utilities)internal/mcpapp/ipfs_upload_app.templ,internal/mcpapp/vault_upload_app.templ(markup)packages/apps/src/entries/{ipfs,vault}-upload.ts(newfileNameid)packages/apps/src/{ipfs,vault}-upload-bootstrap.ts(change listener + element wiring)tests/sunpeak/tests/inspector-apps.test.ts(coverage)Coverage
New sunpeak browser inspector tests for
upload_fileandvault_put_file(across ChatGPT and Claude hosts) assert the styled chrome renders ("Choose file", "No file chosen", "Upload") and that picking a file (report.pdf) updates the label — proving the change listener is wired, not just the static HTML shell.Verification
go build ./...+go test ./internal/mcpapp/...— pass (embeds fresh bundles; self-containment guard still green)@pinner/appsvitest — 9 files / 76 tests passpnpm build:css+pnpm --filter @pinner/apps buildregeneratedtailwind.cssand the embedded bundles (both gitignored; CI rebuilds them)Note:
*_templ.goare gitignored and regenerated bymake/CI — only the.templsources are committed.This pull request styles the file picker in the MCP upload apps (IPFS and Vault) and adds a dynamic label that displays the selected file's name.
What changed:
<input type="file">with a custom composite picker that includes a "Choose file" button and a placeholder text ("No file chosen"). The native input is made invisible but remains clickable, overlaying the styled chrome.fileNameID for the label span.file-field,file-input,file-picker,file-btn,file-name) for consistent styling of the file picker across both apps.Why:
The native browser file input cannot be themed to match the application's design. This change creates a custom-styled file picker that fits the UI, while ensuring users still see which file they've selected via a live-updating label.