fix: block NSS-Commander keyboard shortcuts when a modal dialog is open#108
fix: block NSS-Commander keyboard shortcuts when a modal dialog is open#108
Conversation
- Updated `package.json` to streamline the `tauri:dev` script. - Enhanced `README.md` with detailed CLI launch profiles and usage instructions. - Introduced new file transfer functionalities in `tauri-api.ts`, including methods for managing transfer sessions. - Improved `App.tsx` to handle CLI launch profiles and file transfer states. - Added new dialogs and UI components for file transfer progress in `FilePaneDialogs.tsx`. - Updated styles in `styles.css` to support new file transfer UI elements. - Enhanced `FilePaneToolbar.tsx` and `NssCommanderFileOpsBar.tsx` with new actions for viewing files in the system. - Implemented hidden file visibility toggle in `LocalFilePane.tsx` and related components. This commit enhances the user experience by providing clearer CLI options and improving file management capabilities.
- Updated `FilePaneTableHead.tsx` to support dynamic column visibility, sorting, and resizing. - Refactored `LocalFilePane.tsx` and `RemoteFilePane.tsx` to manage column visibility and sorting state. - Introduced new styles in `styles.css` for improved column controls and popover menus. - Added functionality to persist column order and visibility settings. - Enhanced tests for `FilePaneTableHead` to validate new features. These changes improve the user experience by allowing better management of file pane columns and their visibility.
- Updated `LocalFilePane.tsx` and `RemoteFilePane.tsx` to utilize `filePaneRowOpensAsDirectory` for better directory detection. - Enhanced error handling when opening files, ensuring clearer messages for users. - Adjusted file size display logic to account for directory-like entries. - Modified tests in `file-pane-name-kind.test.ts` to include symlink handling for directory representation. These changes enhance the user experience by providing more accurate file and directory management in the file panes.
Bump desktop app and Tauri manifests to 0.3.5; document changes in CHANGELOG and releases.md; sync AUR nosuckshell-bin pkgver. After merge, tag v0.3.5 and push to trigger the release workflow.
There was a problem hiding this comment.
Pull request overview
Prepares the repository for v0.3.5 by aligning versions/docs/packaging and includes the merged feature work (file pane columns/sorting, NSS-Commander transfer UX, CLI launch profiles, and monitored transfer pause/cancel/progress).
Changes:
- Bump versions to
0.3.5across desktop app manifests and AUR packaging; update release docs and changelog. - Add CLI launch profiles (
--local-commander,--local-terminal) and a roottauri:devwrapper to forward app args correctly under Tauri 2. - Expand file pane capabilities (sortable/optional/reorderable columns, hidden-file toggle, modified-time formatting, kind labels) and enhance NSS-Commander transfer flows (progress UI + pause/cancel plumbing).
Reviewed changes
Copilot reviewed 55 out of 56 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| scripts/run-tauri-dev.cjs | Wrapper to run desktop tauri dev and forward app CLI args correctly. |
| README.md | Document CLI launch profiles + dev arg forwarding. |
| package.json | Route tauri:dev through the new wrapper script. |
| docs/releases.md | Update current target tag to v0.3.5. |
| docs/CHANGELOG.md | Add 0.3.5 section and link. |
| aur/nosuckshell-bin/PKGBUILD | Bump AUR pkgver to 0.3.5. |
| apps/desktop/src/types.ts | Add sortWithDirectories to local/remote dir entry types. |
| apps/desktop/src/tauri-api.ts | Add launch-profile IPC + transfer pause/cancel/begin/release + transferId plumbing. |
| apps/desktop/src/styles.css | Styling for new columns UI, modified column, and transfer dialogs/progress UI. |
| apps/desktop/src/hooks/useFilePaneTableResize.ts | Support variable visible resizable columns and fixed optional column widths. |
| apps/desktop/src/hooks/useAppKeyboardShortcutEngine.ts | Add deferral logic for NSS-Commander chord handling. |
| apps/desktop/src/hooks/useAppKeyboardShortcutEngine.test.ts | Unit tests for the new consume/deferral logic. |
| apps/desktop/src/features/useNssCommanderFileOpKeyboardShortcuts.ts | Capture-phase F-key/Ctrl+R shortcuts for NSS-Commander file ops. |
| apps/desktop/src/features/useNssCommanderFileOpKeyboardShortcuts.test.ts | Unit tests for shortcut target blocking logic. |
| apps/desktop/src/features/nss-commander-file-ops-bar.ts | Add “view in system” enablement + improved copy/move direction logic. |
| apps/desktop/src/features/nss-commander-file-ops-bar.test.ts | Tests for new ops-bar helpers. |
| apps/desktop/src/features/file-pane-transfer.ts | Add recursive dir transfer support + cancel/transferId options. |
| apps/desktop/src/features/file-pane-table-columns.ts | New module for columns config, sorting, visibility/order persistence. |
| apps/desktop/src/features/file-pane-table-columns.test.ts | Tests for sort/order/visibility helpers. |
| apps/desktop/src/features/file-pane-paths.ts | Add dot-hidden filename helper. |
| apps/desktop/src/features/file-pane-paths.test.ts | Tests for dot-hidden filename helper. |
| apps/desktop/src/features/file-pane-name-kind.ts | Treat symlink→dir as folder color via sortWithDirectories. |
| apps/desktop/src/features/file-pane-name-kind.test.ts | Tests for symlink→dir “folder” behavior. |
| apps/desktop/src/features/file-pane-modified-time.ts | New en-US compact modified-time formatter for file panes. |
| apps/desktop/src/features/file-pane-modified-time.test.ts | Tests for modified-time formatting. |
| apps/desktop/src/features/file-pane-entry-kind.ts | New “Kind” label mapping from Unix mode prefix. |
| apps/desktop/src/features/file-pane-entry-kind.test.ts | Tests for kind label mapping. |
| apps/desktop/src/features/file-pane-column-sizing.ts | Improve optimal sizing to respect visible columns and budget caps. |
| apps/desktop/src/features/file-pane-column-sizing.test.ts | Tests for budget caps and partial-key sizing. |
| apps/desktop/src/e2e/tauri-core-shim.ts | Add e2e stubs for new IPC (partial). |
| apps/desktop/src/components/SplitWorkspace.tsx | Avoid stealing terminal focus when in file views; add path sync hooks. |
| apps/desktop/src/components/settings/tabs/AppSettingsNssCommanderTab.tsx | Update description to match new F-key range. |
| apps/desktop/src/components/settings/tabs/AppSettingsAppearanceTab.tsx | Clarify terminal font/size also affects file pane list views. |
| apps/desktop/src/components/RemoteFilePane.tsx | Column/sort UI integration, hidden files toggle, kind/modified formatting, “view file” op. |
| apps/desktop/src/components/NssCommanderXferProgressDialog.tsx | New portaled transfer-progress dialog with pause/cancel/details. |
| apps/desktop/src/components/NssCommanderFKeyBar.tsx | Add view/rename key mapping changes + hook in keyboard shortcuts. |
| apps/desktop/src/components/NssCommanderFileOpsBar.tsx | Add view icon/button + hook in keyboard shortcuts. |
| apps/desktop/src/components/LocalFilePane.tsx | Column/sort UI integration, hidden files toggle, modified/kind formatting, “view file” op. |
| apps/desktop/src/components/HelpPanel.tsx | Update help bindings for copy/move dialogs, view/rename, and columns/sorting. |
| apps/desktop/src/components/FilePaneToolbar.tsx | Add home button + hidden-files toggle button (aria-pressed styling). |
| apps/desktop/src/components/FilePaneTableHead.tsx | Dynamic columns rendering + sorting + columns popover + resizer mapping updates. |
| apps/desktop/src/components/FilePaneTableHead.test.tsx | Update head rendering test for new props/buttons. |
| apps/desktop/src/components/FilePanePathBreadcrumbs.tsx | Fix double “/” separator after root crumb. |
| apps/desktop/src/components/FilePanePathBreadcrumbs.test.tsx | New tests for breadcrumb separator behavior. |
| apps/desktop/src/components/FilePaneDialogs.tsx | Improve dialog keyboard handling/focus mgmt; add NSS pre-transfer dialog. |
| apps/desktop/src/components/FilePaneDialogs.test.tsx | New tests for focus navigation and Tab wrapping. |
| apps/desktop/src-tauri/tauri.conf.json | Bump desktop version to 0.3.5. |
| apps/desktop/src-tauri/src/sftp.rs | Add sortWithDirectories; add monitored transfer progress + pause/cancel; add “view remote file” temp download/open. |
| apps/desktop/src-tauri/src/sftp_transfer_ops.rs | New shared pause/cancel handle registry for monitored transfers. |
| apps/desktop/src-tauri/src/session.rs | Set local shell cwd to user home when available. |
| apps/desktop/src-tauri/src/main.rs | Wire new IPC commands + CLI parsing/help before app start. |
| apps/desktop/src-tauri/src/launch_cli.rs | New CLI flag parsing/help + profile IPC backing. |
| apps/desktop/src-tauri/Cargo.toml | Bump crate version to 0.3.5. |
| apps/desktop/package.json | Bump desktop package version to 0.3.5. |
| apps/desktop/package-lock.json | Bump lockfile version fields to 0.3.5. |
Files not reviewed (1)
- apps/desktop/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)
apps/desktop/src/e2e/tauri-core-shim.ts:345
- The e2e IPC shim doesn’t handle new invoke commands added in this PR (
nss_xfer_begin_transfer,nss_xfer_release_transfer,sftp_open_remote_file_in_os). Any e2e/screenshot flow that triggers transfers or “View” on remote panes will now throw an unknown-command error.
Also, the list_local_dir / sftp_list_remote_dir stub entries don’t include sortWithDirectories, which is now part of the frontend entry types. Consider adding that field (e.g. equal to isDir) in the stubbed entries to keep runtime data shape consistent.
case "sftp_list_remote_dir":
return [
{
name: "etc",
isDir: true,
size: 0,
mtime: null,
modeDisplay: "drwxr-xr-x",
modeOctal: "755",
userDisplay: "0",
groupDisplay: "0",
},
{
name: "home",
isDir: true,
size: 0,
mtime: null,
modeDisplay: "drwxr-xr-x",
modeOctal: "755",
userDisplay: "0",
groupDisplay: "0",
},
{
name: "README.txt",
isDir: false,
size: 12,
mtime: Math.floor(Date.now() / 1000),
modeDisplay: "-rw-r--r--",
modeOctal: "644",
userDisplay: "1000",
groupDisplay: "1000",
},
];
case "list_local_dir":
return [
{
name: "Documents",
isDir: true,
size: 0,
mtime: null,
modeDisplay: "drwxr-xr-x",
modeOctal: "755",
userDisplay: "e2e",
groupDisplay: "e2e",
},
{
name: "notes.md",
isDir: false,
size: 8,
mtime: Math.floor(Date.now() / 1000),
modeDisplay: "-rw-r--r--",
modeOctal: "644",
userDisplay: "e2e",
groupDisplay: "e2e",
},
];
case "get_local_home_canonical_path":
return "/home/e2e";
case "sftp_download_file":
return "/home/e2e/Downloads/mock-download.bin";
case "nss_xfer_cancel":
case "nss_xfer_set_paused":
return undefined;
case "sftp_export_paths_archive":
return "/home/e2e/Downloads/mock-export.tar.gz";
case "local_export_paths_archive":
return "/home/e2e/Downloads/mock-local-export.tar.gz";
case "sftp_upload_file":
case "broadcast_file_transfer_clipboard":
case "open_aux_window":
return undefined;
case "copy_local_file":
return "/home/e2e/Documents/copied-file";
case "create_local_dir":
case "delete_local_entry":
case "rename_local_entry":
case "open_local_entry_in_os":
case "write_local_text_file":
case "create_local_text_file":
case "sftp_create_dir":
case "sftp_delete_entry":
case "sftp_rename_entry":
case "sftp_create_text_file":
case "sftp_write_text_file":
return undefined;
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Agent-Logs-Url: https://github.com/d0dg3r/NoSuckShell/sessions/211a4415-fd52-4722-9e4d-a7b90b935447 Co-authored-by: d0dg3r <5613114+d0dg3r@users.noreply.github.com>
Summary
The capture-phase
windowkeydown listener inuseNssCommanderFileOpKeyboardShortcutsran before any modal/dialog handlers, allowing F2–F9 / Ctrl+R file operations to fire while a dialog was open.Two guards added:
onKeyDown— early-returns whendocument.querySelector('.file-pane-dialog-overlay') !== null; covers all overlay-based modals (FilePaneDialogs,NssCommanderXferProgressDialog)nssCommanderKeyboardShortcutTargetBlocksShortcuts— addedtarget.closest('[role="dialog"][aria-modal="true"]'); blocks shortcuts when focus is inside a non-overlay modal (e.g.FilePaneTextEditor)Related issue
N/A
Scope
aria-modaldialog is openTesting
npm test(fromapps/desktop, if applicable)cargo test/cargo check(fromapps/desktop/src-tauri, if applicable)closest('[role="dialog"][aria-modal="true"]')guard; all 286 tests passUI
N/A
Docs
docs/), or not needed