fix(web): the review item of #850 that goes on top

The Dock button's hidden attribute was set only when a preview opened, so
with a preview open, switching Codex files off left a Dock button that did
nothing and switching it on showed none until the next preview.
applyHeaderVisibilitySettings() now sets it beside the Response files
button, and a test flips the setting with a preview open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Codeman maintainer committed 2026-12-03 10:16:05 +01:00
1 parent d3d1f7cde1
commit a117955490
2 files changed
+16 -1

No files matched your search

+5 -1
View File
@@ -4864,8 +4864,12 @@ Object.assign(CodemanApp.prototype, {
}
// Codex files (Response files button, sidebar file tabs, Dock) — opt-in, hidden by default.
// Switching it off takes a docked preview back to floating.
// Switching it off takes a docked preview back to floating. The Dock button follows the
// setting here too, not only when a preview opens: with a preview open, switching the setting
// off would otherwise leave a Dock button that does nothing, and on would show none.
this._syncResponseFilesButton?.();
const filePreviewDockBtn = document.getElementById('filePreviewDockBtn');
if (filePreviewDockBtn) filePreviewDockBtn.hidden = !this._codexFilePreviewsEnabled?.();
if (!this._codexFilePreviewsEnabled?.()) this._setFilePreviewDocked?.(false);
// Cron button (footer toolbar) — opt-in, hidden by default. Same marker pattern.
+11
View File
@@ -159,6 +159,17 @@ describe('with the Codex files setting off (nothing stored), none of the three b
expect(overlay.classList.contains('is-docked')).toBe(true);
});
it('flips the Dock button of an open preview when the setting changes, not only at the next open', () => {
const { app, document } = loadApp();
const dockBtn = document.getElementById('filePreviewDockBtn')!;
app._codexFilePreviewsEnabled = () => true;
app.applyHeaderVisibilitySettings();
expect(dockBtn.hidden).toBe(false);
app._codexFilePreviewsEnabled = () => false;
app.applyHeaderVisibilitySettings();
expect(dockBtn.hidden).toBe(true);
});
it('keeps Response files off phones even with the setting on', () => {
const mobileCss = read('mobile.css');
const phoneBlock = mobileCss.slice(mobileCss.indexOf('@media (max-width: 599px)'));