Repository navigation
Conversation
2 of 4 tasks
Contributor
[Medium impact] The latest changes appear safe to merge; no new actionable issue was established. SummaryAdds client file selection through
DiagramsequenceDiagram
participant UI as UI loop
participant Window as IClientWindow
participant Picker as Native or browser picker
UI->>Window: FileSelectionRequest
alt Picker already active
Window-->>UI: BUSY event on later input read
else Picker available
Window->>Picker: Show selector
Picker-->>Window: Status and selected files
Window->>Window: Check request limits and selector id
Window-->>UI: SelectedFilesUserInputEvent
end
Reviews (7) · Last reviewed commit: "Make file selection limits app-declared ..." · Reviewed by Greptile |
Collaborator
Author
|
/ok to test 77c89cf |
Collaborator
Author
|
/ok to test f66bcd0 |
Collaborator
Author
|
/ok to test 7a7be4a |
spaingnv
force-pushed
the
dev/spaing/client-file-selection
branch
from
October 17, 2026 00:20
62718b8 to
7a7be4a
Compare
ArielG-NV
reviewed
Oct 17, 2026
ArielG-NV
left a comment
Collaborator
There was a problem hiding this comment.
Design is effectively perfect; minor clean-up suggested.
Signed-off-by: Set Paing <spaing@nvidia.com>
Remove the file-selector locks: IClientWindow and the WebRTC server's upload tokens are each touched by one thread. The native file dialog runs in a child process polled by the UI thread, so a dialog left open when its session ends is closed. Trim the file-selection docstrings. Signed-off-by: Set Paing <spaing@nvidia.com>
The native dialog writes its paths to a temporary file, so a long path list cannot fill a pipe and block the child. The WebRTC page trusts the server's one-selector rule and replaces a finished picker with a new one. Signed-off-by: Set Paing <spaing@nvidia.com>
Signed-off-by: Set Paing <spaing@nvidia.com>
- Run the native Tk dialog on a worker thread instead of a child process. A dialog left open at session end stays until the user closes it; its result is dropped by the selector id, and new requests get BUSY meanwhile. - Drop the 30-second presentation deadline and the browser ack it needed. - Rename _checked_result to _check_file_selection_result, mark request_file_selector and flush_file_selectors @Final, and use Path(name).name for basenames. - Add a delayed "Restart session" button to the file-picker demo. Signed-off-by: Set Paing <spaing@nvidia.com>
Restore main's behavior: input read by a run with no step is dropped. Signed-off-by: Set Paing <spaing@nvidia.com>
spaingnv
force-pushed
the
dev/spaing/client-file-selection
branch
from
October 19, 2026 21:07
7a7be4a to
231b722
Compare
Collaborator
Author
|
/ok to test 231b722 |
ArielG-NV
reviewed
Oct 19, 2026
ArielG-NV
left a comment
Collaborator
There was a problem hiding this comment.
Minor changes suggested.
request_file_selector takes max_file_bytes, max_total_bytes and max_file_count, defaulting to 1 GiB, 1 GiB and 256, with no hard ceiling. max_file_bytes must not exceed max_total_bytes. The WebRTC server enforces the app's limits on its side and bounds the request body up front. Signed-off-by: Set Paing <spaing@nvidia.com>
Collaborator
Author
|
/ok to test 8fde1264c |
@spaingnv, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
Collaborator
Author
|
/ok to test 8fde126 |
This branch has not been deployed
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.
Replaces #674 with the same change as one commit on current
main, for a clean history.Summary
request_file_selector(request_id, initial_path=None, *, accept=(), max_file_bytes=None, multiple=False), and the result comes back on a later tick as oneSelectedFilesUserInputEventcarryingrequest_id, on the same input stream as keyboard and mouse.statusandfiles(name+databytes, no host path).statusisok,cancelled,busy,too_large,disallowed_type, orunavailable. Sizes are clamped to 32 MiB per file, 256 MiB and 256 files per set. Apps do not branch on--mode.IClientWindowowns the rules and creates every event: every call gets exactly one event unless its session ends first; one picker at a time (a call while one is open is answeredbusy); results are checked against the request (types, sizes, count, base names); an internal id per picker so late results are dropped;unavailableif a picker is not shown within 30 s, and no deadline once it is shown. Session replacement withdraws an open picker without a result. Windows implement the platform hooks and the abstract_put_user_input_event; theIClientWindowdocstring is the full lifecycle.unavailable.imgui-ui-file-pickerwith Open file (A), Open file (B) and Open files, asking for.bin/.raw. Failed picks show in red with the status name.Test plan
.bin/.raw. While it is open, A or B showsBUSY.under-32mb.bin→name (N bytes); oversize / wrong type / dismiss → redTOO_LARGE/DISALLOWED_TYPE/CANCELLED. Open files accepts several files. The window keeps presenting while the dialog is open.unavailable, covered by the CPU tests above.