Merge #809: the File Viewer header button follows its setting on phones

Head 6c2e257d (DodgyBadger). The phone half of #759: the button stays off
by default on a phone and shows once the setting is turned on.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer committed 2026-11-11 23:03:01 +01:00
commit b587ac71f4
4 files changed
+213 -19

No files matched your search

+18 -4
View File
@@ -13,6 +13,7 @@
html.mobile-init .header-font-controls,
html.mobile-init .header-system-stats,
html.mobile-init .header-tokens,
html.mobile-init .btn-file-viewer,
html.mobile-init .monitor-panel,
html.mobile-init .subagents-panel,
html.mobile-init .project-insights-panel,
@@ -574,18 +575,31 @@ html.mobile-init .file-browser-panel {
height: 18px;
}
/* Hide header settings gear, lifecycle log, away digest, session manager, and
file viewer on mobile - settings moved to toolbar; the others are secondary /
/* File Viewer is off by default on phones, but honors an explicit opt-in.
Give its header entry the same minimum touch target as the home button. */
.btn-icon-header.btn-file-viewer {
width: 44px;
height: 44px;
/* Tighten the visible icon spacing without shrinking the touch target. */
padding-inline-end: 12px;
}
.btn-icon-header.btn-file-viewer svg {
width: 18px;
height: 18px;
}
/* Hide header settings gear, lifecycle log, away digest, and session manager
on mobile - settings moved to toolbar; the others are secondary /
desktop-oriented controls that don't belong on the cramped phone header (the
session manager stays reachable via the Ctrl+K palette's "Browse all sessions"
item; the file viewer button is opt-in but its panel is desktop-sized).
item).
(The attachments button is opt-in / default-hidden everywhere via its own
--hidden marker, so it needs no mobile-specific rule here.) */
.btn-icon-header.btn-settings,
.btn-icon-header.btn-lifecycle-log,
.btn-icon-header.btn-away-digest,
.btn-icon-header.btn-session-manager,
.btn-icon-header.btn-file-viewer,
/* Edit history: a desktop panel; phones never show the button (opt-in, default OFF anyway). */
.btn-icon-header.btn-edit-history,
/* Approvals bell: phones answer from the overview's NEEDS YOU rows instead
+3 -4
View File
@@ -4748,10 +4748,9 @@ Object.assign(CodemanApp.prototype, {
attachmentsBtn.classList.toggle('btn-attachments-history--hidden', !showAttachmentsButton);
}
// File Viewer header button — opt-in, default OFF. Marker class (base is
// display:inline-flex !important); clicking it toggles the file browser panel.
// Default ON (desktop): the folder button is part of the standard header now;
// phones still hide it via mobile.css (btn-file-viewer in the phone-hidden set).
// File Viewer header button: default ON on desktop, opt-in on phones.
// Marker class (base is display:inline-flex !important); clicking it toggles
// the file browser panel on either device.
const showFileViewerButton = settings.showFileViewerButton ?? defaults.showFileViewerButton ?? true;
const fileViewerBtn = document.querySelector('.btn-file-viewer');
if (fileViewerBtn) {