Repository navigation
Conversation
Apps request a file through the UI loop and read bytes from SelectedFilesUserInputEvent, so native, WebRTC, and MP4 share one contract instead of a host-path picker. Signed-off-by: Set Paing <spaing@nvidia.com>
… session A reused request id (for example a second Open click while a picker is still open) should keep the original pick so the chosen file can still arrive. Signed-off-by: Set Paing <spaing@nvidia.com>
|
/ok to test fba1dc2 |
CI's ruff --select I hook reordered numpy after the imgui_ui_demo imports. Fold that in with the stale StepResult stub and the file-selector README line. Signed-off-by: Set Paing <spaing@nvidia.com>
|
/ok to test 07a23a2 |
[Medium impact] The PR appears safe to merge, with a non-blocking filename issue on Linux. Findings
SummaryAdds client file selection with shared request rules and results delivered through the input stream.
Previous acknowledgments: DiagramsequenceDiagram
participant App as UI loop
participant Window as IClientWindow
participant Picker as Native or browser picker
App->>Window: Request file selection
alt Picker already active
Window-->>App: BUSY on a later tick
else Slot available
Window->>Picker: Show picker
Picker-->>Window: Status and selected bytes
Window->>Window: Check active ID and file limits
Window-->>App: SelectedFilesUserInputEvent
end
Reviews (30) · Last reviewed commit: "Answer busy file selections and check re..." · Reviewed by Greptile |
Comments Outside DiffThese findings could not be posted inline.
|
…ploads Drop SelectedFile.path so apps only see name and bytes. WebRTC admits uploads for pending ids, completes cancel and failure, and opens the picker from a viewer click. Native picks off the UI thread with the same size cap. Signed-off-by: Set Paing <spaing@nvidia.com>
|
/ok to test 9ee2447 |
CI's ruff-format hook wrapped the pending-upload HTTPConflict and collapsed a one-line next() in the host-path omission test. Signed-off-by: Set Paing <spaing@nvidia.com>
|
/ok to test f99b69a |
@spaingnv, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
Tensor/context parallel runtime (NVIDIA#619) landed on main and conflicts with this branch in the v2 loop, session runner, and docs. Signed-off-by: Set Paing <spaing@nvidia.com> # Conflicts: # flashdreams/flashdreams/api_v2/loop.py # flashdreams/flashdreams/runtime_v2/session_runner.py # flashdreams/test_v2/test_session_runner.py
Native and WebRTC both clamp max_bytes to 32 MiB and honor accept suffixes so a viewer cannot raise the cap. The UI loop only queues policy. Signed-off-by: Set Paing <spaing@nvidia.com>
Cancel, oversize, disallowed type, and unavailable are separate statuses. Windows share selected_file_policy_status so a too-large disallowed file is always disallowed_type. WebRTC confirms the request without freezing video; the demo overlay prints failures in red. Signed-off-by: Set Paing <spaing@nvidia.com>
|
/ok to test 7eaa532 |
@spaingnv, there was an error processing your request: See the following link for more information: https://docs.gha-runners.nvidia.com/cpr/e/2/ |
A crashing OS chooser now reports unavailable instead of leaving the request unanswered. WebRTC stamps an internal session epoch so a POST started in the old session cannot become input for the next one.
|
Re: Greptile outside-diff (step() failure signaling on peer ranks): out of scope for this PR — that path is from main, not client file selection. |
|
/ok to test 4d9bc78 |
The fake window recorded accept/max_bytes but was still typed as a 2-tuple, which ty rejected. Also apply the isort/format nits CI auto-fixed.
|
/ok to test a158c5c |
Keep the file-picker branch current with packaging and encoder-import changes on main. Signed-off-by: Set Paing <spaing@nvidia.com>
…ntrol. Same id while a pick is active or queued is ignored so mash does not stack dialogs. Distinct ids wait in order. Apps reuse the control's id after the matching event; a new id on every click queues another dialog. Signed-off-by: Set Paing <spaing@nvidia.com>
Strip only the chooser's final newline so trailing spaces stay in a Linux filename. Do not forward key presses to the app while the browser prompt is open, including the Escape that cancels it. Note the deferred overlapping-dialog case on native session replacement. Signed-off-by: Set Paing <spaing@nvidia.com>
|
/ok to test 5352490 |
Move the file-selection rules into the session runner: one picker in flight, a 30 s deadline that stops once the window reports the picker opened, and dropping results for any other id. A request made while another picker is open completes as UNAVAILABLE; a repeat for the open id is ignored. Windows now only show a picker and report back. The native window uses Tk on every platform. The WebRTC server keeps only armed upload policy and its upload validation. Remove the file-selection gate, the presentation timer, generation tracking, and the browser queue. The file-picker demo shows one status line per button. Signed-off-by: Set Paing <spaing@nvidia.com>
|
/ok to test aed4a5f |
…e-pick-649 Signed-off-by: Set Paing <spaing@nvidia.com> # Conflicts: # flashdreams/flashdreams/runtime_v2/native_window_client_window.py # flashdreams/test_v2/test_native_window_client_window.py
|
/ok to test cf7ca1e |
…e-pick-649 Signed-off-by: Set Paing <spaing@nvidia.com> # Conflicts: # flashdreams/flashdreams/api_v2/loop.py # flashdreams/flashdreams/runtime_v2/session_runner.py
|
/ok to test cc5a619 |
…d check Signed-off-by: Set Paing <spaing@nvidia.com>
|
/ok to test 6a4171e |
Signed-off-by: Set Paing <spaing@nvidia.com>
|
/ok to test 6d098da |
Signed-off-by: Set Paing <spaing@nvidia.com>
|
/ok to test 7ee3599 |
ArielG-NV
left a comment
There was a problem hiding this comment.
Discussed Offline. New Design Was Planned That Properly Assign Ownership and ensure all event creation routes through IClientWindow.
Notes on CompositeClientWindow design for other reviewers
class CompositeClientWindow{
IClientWindow primaryWindow;
InputSource[] secondaryInputSources;
OutputSink[] secondaryOutputSinks;
}
This is so requests route to a primaryWindow accordingly
IClientWindow allows one picker at a time, times out a picker not shown within 30 seconds, and creates every result event. Windows only show the picker and report back. The session runner forwards requests and forgets the open picker when a session ends. IUILoop.request_file_selector queues a request; the result arrives as a SelectedFilesUserInputEvent. Signed-off-by: Set Paing <spaing@nvidia.com>
|
/ok to test 938cb4d |
Signed-off-by: Set Paing <spaing@nvidia.com>
Signed-off-by: Set Paing <spaing@nvidia.com>
Signed-off-by: Set Paing <spaing@nvidia.com>
Signed-off-by: Set Paing <spaing@nvidia.com>
|
|
||
| def _base_name(name: str) -> str: | ||
| """Return ``name`` without any POSIX or Windows directory part.""" | ||
| base = name.replace("\\", "/").rsplit("/", 1)[-1] |
There was a problem hiding this comment.
Selected filenames lose characters
_base_name treats every backslash as a directory separator, but backslashes are legal filename characters on Linux. The native picker already returns Path(path).name, so choosing part\one.bin now reports one.bin. Apps that display or save the chosen name lose part of it.
Preserve native base names and strip paths only where the source supplies them.
|
Superseded by #725, the same change as one commit rebased on current |
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.