Repository navigation
Conversation
[Medium impact] The PR appears safe to merge; no new actionable issues remain. SummaryAdds client file selection through
DiagramsequenceDiagram
participant UI as UI loop
participant Window as IClientWindow
participant Picker as Native or browser picker
UI->>Window: Request file selection
Window->>Picker: Show chooser
Picker-->>Window: Status and chosen files
Window->>Window: Check request limits
Window-->>UI: SelectedFilesUserInputEvent on a later tick
Reviews (11) · Last reviewed commit: "Release pointer lock when the browser pr..." · Reviewed by Greptile |
|
/ok to test 77c89cf |
|
/ok to test f66bcd0 |
|
/ok to test 7a7be4a |
62718b8 to
7a7be4a
Compare
ArielG-NV
left a comment
There was a problem hiding this comment.
Design is effectively perfect; minor clean-up suggested.
7a7be4a to
231b722
Compare
|
/ok to test 231b722 |
ArielG-NV
left a comment
There was a problem hiding this comment.
Minor changes suggested.
|
/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/ |
|
/ok to test 8fde126 |
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>
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>
8fde126 to
90be5df
Compare
max_file_count now decides whether a picker may return several files and defaults to 1. The browser uploads each file as its own raw request, so the server holds every byte it reads to max_file_bytes, max_total_bytes and max_file_count, with no separate allowance for multipart framing. Spell out TOO_LARGE and reword _put_user_input_event. Signed-off-by: Set Paing <spaing@nvidia.com>
|
/ok to test a9298e0 |
90be5df to
a9298e0
Compare
|
/ok to test 620a016 |
Signed-off-by: Set Paing <spaing@nvidia.com>
|
/ok to test 0e3358c |
620a016 to
0e3358c
Compare
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.