Skip to content

Fix file manager layout and listing issues - #13

Closed
deanxbox wants to merge 2 commits into
Termix-SSH:mainfrom
deanxbox:fix/file-manager-layout-and-listing
Closed

deanxbox wants to merge 2 commits into
Termix-SSH:mainfrom
deanxbox:fix/file-manager-layout-and-listing

Conversation

@deanxbox

Copy link
Copy Markdown
  • Re-measure the grid after a tab becomes visible and keep list rows at a fixed height

  • Memoize selected and dragged paths, and pass sudo passwords over stdin

  • Extract file filtering and sorting with a shared collator and add tests

Overview

Fixes two grid layout glitches in the file manager and stops sudo passwords from showing up in the process list.

  • Fixed: Grid layout after switching tabs, list spacing after navigating directories, and sudo password exposure in directory listing

Changes Made

  • Tab-switch glitch: the grid now re-measures when its tab becomes visible again.
  • Spacing glitch: list rows have a fixed height. Previously they were measured after render, so the gaps widened 0.1–0.3s after navigating.
  • Performance: selected and dragged paths are now memoized sets instead of per-row scans.
  • Sudo listing (list-routes.ts): the password is now written to sudo's stdin (sudo -S -p '') instead of echo 'pw' | sudo, so it no longer appears in the process list.
  • Filtering and sorting: moved into filterAndSortFiles (src/frontend/file-list.ts), which uses one shared Intl.Collator and a lowercased query computed once. It has two new tests.

Related Issues

  • None.

Screenshots / Demos

None attached.

Checklist

  • Code follows the project style (prettier and commitlint pass in the pre-commit hook)
  • Works on mobile and desktop (if it has UI). Checked on desktop only. Mobile was not tested.
  • Tests pass and new code has tests. npm test passed earlier (49 files, 274 tests), before the final prettier pass. No typecheck was run.
  • Added the change to CHANGELOG.md
  • I have read the repo's CONTRIBUTING.md

- Re-measure the grid after a tab becomes visible and keep list rows at a fixed height

- Memoize selected and dragged paths, and pass sudo passwords over stdin

- Extract file filtering and sorting with a shared collator and add tests
@termix-triage-bot

termix-triage-bot Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

AI review | Looks safe to merge

Fixes virtualizer layout glitches in hidden tabs, optimizes list rendering with memoized sets, and secures sudo password handling by piping it via stdin. No rule violations or security risks found.

Reviewed e0cbccd. AI can be wrong, a maintainer still decides. Comment /termix review to run it again.

@deanxbox

Copy link
Copy Markdown
Author

Finding 1 is fixed: the test helper now returns a typed FileItem, with no cast. Finding 2 doesn't apply. ssh2's exec channel is a duplex stream, so stream.write() feeds the remote stdin and stream.stderr is the separate error stream. session.ts:160 already writes the sudo password the same way.

@LukeGus

LukeGus commented Oct 29, 2026

Copy link
Copy Markdown
Member

Thanks! This is included in #20, which carried these commits and is now merged into dev-1.1.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants