Skip to content

Add FilePicker polyglot widget#14

Merged
clholgat merged 1 commit into
mainfrom
ch/file-picker-widget
Jun 3, 2026
Merged

Add FilePicker polyglot widget#14
clholgat merged 1 commit into
mainfrom
ch/file-picker-widget

Conversation

@clholgat

@clholgat clholgat commented Jun 3, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Adds a cross-platform FilePicker widget with native implementations for all four platforms: Android (ACTION_GET_CONTENT), iOS (UIDocumentPickerViewController), macOS (NSOpenPanel), and web (<input type="file">)
  • Supports onSelect callback, allowMultiple, and MIME type filtering via accept prop
  • Includes unit tests (FilePickerTest.ts) and a playground catalog entry in WidgetsCatalog

Files

File Description
widgets/src/components/pickers/FilePicker.tsx TSX component — thin <custom-view> wrapper
widgets/android/ValdiFilePicker.kt Android view — launches system file chooser
widgets/android/ValdiFilePickerAttributesBinder.kt Android attribute binder (@RegisterAttributesBinder)
widgets/ios/SCWidgetsFilePicker.h/.m iOS view — presents UIDocumentPickerViewController
widgets/macos/SCWidgetsMacOSFilePicker.h/.m macOS view — presents NSOpenPanel
widgets/web/src/WidgetsWeb.ts Web factory added to existing registry
widgets/BUILD.bazel Added UniformTypeIdentifiers to iOS/macOS sdk_frameworks
widgets/test/components/pickers/FilePickerTest.ts Unit tests
playground/src/WidgetsCatalog.tsx Playground demo entry

Test plan

  • Web: built and tested via bazel_web_serve.sh → Widgets Catalog → FilePicker section
  • Android: build playground app, verify file chooser launches
  • iOS: build playground app, verify document picker presents
  • macOS: build playground app, verify NSOpenPanel opens
  • Run bazel test //valdi_modules/widgets:widgets_test

🤖 Generated with Claude Code

Cross-platform file picker using <custom-view> with native implementations
for Android (ACTION_GET_CONTENT), iOS (UIDocumentPickerViewController),
macOS (NSOpenPanel), and web (<input type="file">). Supports onSelect
callback, allowMultiple, and MIME type filtering via accept prop.

Includes unit tests and playground catalog entry.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@clholgat clholgat requested a review from gioneill June 3, 2026 17:15
@semgrep-code-snapchat

Copy link
Copy Markdown

Semgrep found 7 internal-sensitive-strings findings:

This literal might contain a Snapchat internal reference that should not be committed to open-source repositories.

Fix: Please replace / remove the string to avoid committing it to open-source repositories.

@clholgat clholgat merged commit adb20da into main Jun 3, 2026
2 checks passed
@gioneill

gioneill commented Jun 4, 2026

Copy link
Copy Markdown
Collaborator

🐸🫡

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.

3 participants