Skip to content

fix(files): honor File Viewer header setting on phones - #809

Merged
Ark0N merged 2 commits into
Ark0N:masterfrom
DodgyBadger:fix/file-viewer-phone-759
Nov 12, 2026
Merged

Ark0N merged 2 commits into
Ark0N:masterfrom
DodgyBadger:fix/file-viewer-phone-759

Conversation

@DodgyBadger

Copy link
Copy Markdown
Contributor

Enabling File Viewer in header settings now shows its button on phones. The phone default remains off, with startup hiding preserved until settings load.

The button retains a 44px touch target while matching neighbouring icon spacing. Browser coverage verifies settings persistence, opening and closing the panel, and essential controls at 390px.

Addresses the mobile-access portion of #759. Lazy loading remains separate.

Validation

  • Mobile browser tests: 3 passed; existing header browser tests: 3 passed.
  • Header policy tests: 6 passed.
  • Typecheck, lint, formatting, frontend checks, and build passed.
  • Full gate: 16,518 passed, 13 skipped, 2 failed. Both unchanged failures reproduce independently:
    • spreadsheet-preview-worker.test.ts: stress test exceeds its 60-second timeout.
    • remote-pane-command-shell.test.ts: login-shell environment causes the fallback fixture to fail.

@Ark0N

Ark0N commented Nov 11, 2026

Copy link
Copy Markdown
Owner

Thank you, @DodgyBadger. With this PR the File Viewer header button follows its setting on phones: it is off by default, and once someone turns it on it shows up with a 44px touch target. That matches what we agreed on #759, and the real-browser test at 390px is what I was hoping for. I ran that test against master's mobile.css and the enable/open/close case fails there, so it does guard the change.

Three small things, none of them blocking:

  1. test/mobile-header-buttons-policy.test.ts:147: before this PR, the CI gate kept the button off phones through the mobile.css rule and its KNOWN_PHONE_HIDDEN entry. Now the only thing keeping it off is showFileViewerButton: false in the handheld branch of getDefaultSettings() (settings-ui.js:4452), and applyHeaderVisibilitySettings() falls back to ?? true. Your browser test would catch a regression there, but npm test does not run it. A gated assertion would put the lock back. Build it like the one in test/tile-grid-per-device-setting.test.ts, which loads the real getDefaultSettings() with isHandheldDevice stubbed, and have it check two things: a phone gets showFileViewerButton === false, and the html.mobile-init list in mobile.css still includes .btn-file-viewer.
  2. docs/architecture-invariants.md:1016 still says "phones still hide it via mobile.css". It should now say that handhelds default it off, that html.mobile-init hides it until settings load, and that an explicit opt-in shows it on phones (File browser: honor mobile access settings and load directories on demand #759).
  3. Optional: docs/wiki/Working-With-Files.md:10 says the button is on by default, which is not true on a phone. docs/wiki/Mobile-Guide.md:198 could name File Viewer as the opt-in exception to "extra header buttons are kept off phones".

These are small enough that I will apply them on top when I merge, once the unit test job in CI finishes. If you would rather push them yourself first, that works too. Thanks again, and good luck with the lazy-loading half.

@Ark0N
Ark0N merged commit b587ac7 into Ark0N:master Nov 12, 2026
2 checks passed
Ark0N pushed a commit that referenced this pull request Nov 12, 2026
…again (#809)

Until #809 a display:none rule in mobile.css and its KNOWN_PHONE_HIDDEN
entry kept the File Viewer button off phones, and the gate checked both.
With that rule gone, the handheld default in getDefaultSettings() and the
html.mobile-init startup rule are the whole lock, and only the browser
test saw them, which npm test does not run.

The policy test now loads the real getDefaultSettings() on a handheld and
on a desktop, checks that every reader of the setting goes through the
device default, and that mobile.css keeps the startup hide.

Docs: architecture-invariants, src/web/CLAUDE.md and the wiki say the
button is off on a phone until it is switched on there, and that a window
narrower than 600px on a device that is not a handheld now shows it.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Ark0N pushed a commit that referenced this pull request Nov 12, 2026
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@Ark0N

Ark0N commented Nov 12, 2026

Copy link
Copy Markdown
Owner

Merged, and it shipped today in Codeman 1.51.0, with you in the release's Thanks. Thank you, @DodgyBadger.

The three items from the review went in at merge time. The main one: with the phone rule gone from mobile.css, the handheld default and the startup hide are the whole lock, and only the browser test saw them. The policy test in the gate now loads the real getDefaultSettings() on a handheld and on a desktop and checks both.

One thing I found on the way, and kept: a device that is not a handheld takes the desktop default at any width, so a desktop window or an iPad split view narrower than 600px now shows the button, where the old rule hid it. It fits and nothing overflows. The release notes list it as a behaviour change.

#759 stays open for the second half, loading directories on demand.

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