Skip to content

Conversation

falkoschindler
Copy link
Contributor

Motivation

The Discord user MasterOfNone asked about documentation for the event arguments of ui.upload. So far we only described them in the release notes for version 3.0.

Implementation

This PR doesn't try to demonstrate all properties and methods, but simply lists them with a short description. In combination with other demos this should be sufficient.

Progress

  • I chose a meaningful title that completes the sentence: "If applied, this PR will..."
  • The implementation is complete.
  • Pytests are not necessary.
  • Documentation has been added.

@falkoschindler falkoschindler added this to the 3.1 milestone Oct 14, 2025
@falkoschindler falkoschindler requested a review from evnchn October 14, 2025 07:59
@falkoschindler falkoschindler added documentation Type/scope: Documentation, examples and website review Status: PR is open and needs review labels Oct 14, 2025
Copy link
Collaborator

@evnchn evnchn left a comment

Choose a reason for hiding this comment

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

image

Minimally viable, but I think maybe we can slip in some demo code as well (may be another PR)

I am thinking:

ui.upload(on_upload=lambda e: ui.notify(f'Uploaded {e.file.name} of size {e.file.size()}')).classes('max-w-full')

@evnchn
Copy link
Collaborator

evnchn commented Oct 14, 2025

I am also considering a simplier solution where we are less likely to run into stale documentation, if we did:

doc.reference(ui.upload.FileUpload, title="Reference for FileUpload")

@falkoschindler
Copy link
Contributor Author

I am thinking:

ui.upload(on_upload=lambda e: ui.notify(f'Uploaded {e.file.name} of size {e.file.size()}')).classes('max-w-full')

There's another demo using e.file.text(). So we basically cover calling methods on e.file. And I'd rather not make the lambda expression any longer (way beyond the normal window size).

I am also considering a simplier solution where we are less likely to run into stale documentation, if we did:

doc.reference(ui.upload.FileUpload, title="Reference for FileUpload")

Good idea. I added this reference section in 67b2e54.
I'd still keep the section about "Upload event arguments" because most properties and methods are not covered by any demos and the reference section is a bit hard to find.

@falkoschindler falkoschindler merged commit c90b2a3 into main Oct 15, 2025
2 of 9 checks passed
@falkoschindler falkoschindler deleted the file-upload-doc branch October 15, 2025 11:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Type/scope: Documentation, examples and website review Status: PR is open and needs review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants