mirror of
https://github.com/Ark0N/Codeman.git
synced 2026-10-02 21:49:42 +02:00
feat(ui): toggle to hide the response-viewer (eye) header button
The eye button (View last response) was the only header control with no visibility setting. Add App Settings -> Display -> "Response Viewer" (showResponseViewer, default on, per-device like the other header toggles; added to the displayKeys no-cross-device-sync set along with showLifecycleLog, which was missing from it). Hiding uses a marker class with higher specificity — the base rule is display:inline-flex !important, so an inline style cannot override it. Verified via Playwright on a fresh instance: 8/8 — default visible, hides live on save, persists across reload, server schema accepts the key, re-enable restores, mobile storage isolated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -985,6 +985,13 @@
|
|||||||
<span class="slider"></span>
|
<span class="slider"></span>
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="settings-item" title="Show the response viewer (eye) button in header">
|
||||||
|
<span class="settings-item-label">Response Viewer</span>
|
||||||
|
<label class="switch switch-sm">
|
||||||
|
<input type="checkbox" id="appSettingsShowResponseViewer">
|
||||||
|
<span class="slider"></span>
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
<div class="settings-item" title="Show the multi-monitor button in the header (opens Codeman spanned across all displays)">
|
<div class="settings-item" title="Show the multi-monitor button in the header (opens Codeman spanned across all displays)">
|
||||||
<span class="settings-item-label">Multi-monitor Button</span>
|
<span class="settings-item-label">Multi-monitor Button</span>
|
||||||
<label class="switch switch-sm">
|
<label class="switch switch-sm">
|
||||||
|
|||||||
@@ -308,6 +308,7 @@ Object.assign(CodemanApp.prototype, {
|
|||||||
document.getElementById('appSettingsShowTokenCount').checked = settings.showTokenCount ?? defaults.showTokenCount ?? true;
|
document.getElementById('appSettingsShowTokenCount').checked = settings.showTokenCount ?? defaults.showTokenCount ?? true;
|
||||||
document.getElementById('appSettingsShowCost').checked = settings.showCost ?? defaults.showCost ?? false;
|
document.getElementById('appSettingsShowCost').checked = settings.showCost ?? defaults.showCost ?? false;
|
||||||
document.getElementById('appSettingsShowLifecycleLog').checked = settings.showLifecycleLog ?? defaults.showLifecycleLog ?? true;
|
document.getElementById('appSettingsShowLifecycleLog').checked = settings.showLifecycleLog ?? defaults.showLifecycleLog ?? true;
|
||||||
|
document.getElementById('appSettingsShowResponseViewer').checked = settings.showResponseViewer ?? defaults.showResponseViewer ?? true;
|
||||||
document.getElementById('appSettingsShowMonitor').checked = settings.showMonitor ?? defaults.showMonitor ?? false;
|
document.getElementById('appSettingsShowMonitor').checked = settings.showMonitor ?? defaults.showMonitor ?? false;
|
||||||
document.getElementById('appSettingsShowProjectInsights').checked = settings.showProjectInsights ?? defaults.showProjectInsights ?? false;
|
document.getElementById('appSettingsShowProjectInsights').checked = settings.showProjectInsights ?? defaults.showProjectInsights ?? false;
|
||||||
document.getElementById('appSettingsShowFileBrowser').checked = settings.showFileBrowser ?? defaults.showFileBrowser ?? false;
|
document.getElementById('appSettingsShowFileBrowser').checked = settings.showFileBrowser ?? defaults.showFileBrowser ?? false;
|
||||||
@@ -1323,6 +1324,7 @@ Object.assign(CodemanApp.prototype, {
|
|||||||
showTokenCount: document.getElementById('appSettingsShowTokenCount').checked,
|
showTokenCount: document.getElementById('appSettingsShowTokenCount').checked,
|
||||||
showCost: document.getElementById('appSettingsShowCost').checked,
|
showCost: document.getElementById('appSettingsShowCost').checked,
|
||||||
showLifecycleLog: document.getElementById('appSettingsShowLifecycleLog').checked,
|
showLifecycleLog: document.getElementById('appSettingsShowLifecycleLog').checked,
|
||||||
|
showResponseViewer: document.getElementById('appSettingsShowResponseViewer').checked,
|
||||||
showMonitor: document.getElementById('appSettingsShowMonitor').checked,
|
showMonitor: document.getElementById('appSettingsShowMonitor').checked,
|
||||||
showProjectInsights: document.getElementById('appSettingsShowProjectInsights').checked,
|
showProjectInsights: document.getElementById('appSettingsShowProjectInsights').checked,
|
||||||
showFileBrowser: document.getElementById('appSettingsShowFileBrowser').checked,
|
showFileBrowser: document.getElementById('appSettingsShowFileBrowser').checked,
|
||||||
@@ -1670,6 +1672,14 @@ Object.assign(CodemanApp.prototype, {
|
|||||||
lifecycleBtn.style.display = showLifecycleLog ? '' : 'none';
|
lifecycleBtn.style.display = showLifecycleLog ? '' : 'none';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hide the response viewer (eye) button when setting is disabled.
|
||||||
|
// Marker class, not inline style — the base rule is display:inline-flex !important.
|
||||||
|
const showResponseViewer = settings.showResponseViewer ?? defaults.showResponseViewer ?? true;
|
||||||
|
const responseViewerBtn = document.querySelector('.btn-response-viewer-header');
|
||||||
|
if (responseViewerBtn) {
|
||||||
|
responseViewerBtn.classList.toggle('btn-response-viewer-header--hidden', !showResponseViewer);
|
||||||
|
}
|
||||||
|
|
||||||
// Multi-monitor button — hidden by default (App Settings → Display → "Header
|
// Multi-monitor button — hidden by default (App Settings → Display → "Header
|
||||||
// Displays"). The server renders the correct initial state on every reload;
|
// Displays"). The server renders the correct initial state on every reload;
|
||||||
// this handles a live toggle from a settings save (no reload). Toggle the
|
// this handles a live toggle from a settings save (no reload). Toggle the
|
||||||
@@ -1937,6 +1947,7 @@ Object.assign(CodemanApp.prototype, {
|
|||||||
// are NOT display keys — they control server-side behavior and must sync from server.
|
// are NOT display keys — they control server-side behavior and must sync from server.
|
||||||
const displayKeys = new Set([
|
const displayKeys = new Set([
|
||||||
'showFontControls', 'showSystemStats', 'showTokenCount', 'showCost',
|
'showFontControls', 'showSystemStats', 'showTokenCount', 'showCost',
|
||||||
|
'showLifecycleLog', 'showResponseViewer',
|
||||||
'showMonitor', 'showProjectInsights', 'showFileBrowser', 'showSubagents',
|
'showMonitor', 'showProjectInsights', 'showFileBrowser', 'showSubagents',
|
||||||
'subagentActiveTabOnly', 'tabTwoRows', 'localEchoEnabled', 'cjkInputEnabled', 'extendedKeyboardBar',
|
'subagentActiveTabOnly', 'tabTwoRows', 'localEchoEnabled', 'cjkInputEnabled', 'extendedKeyboardBar',
|
||||||
]);
|
]);
|
||||||
|
|||||||
@@ -8115,6 +8115,12 @@ kbd {
|
|||||||
display: inline-flex !important;
|
display: inline-flex !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* "Response Viewer" header toggle (App Settings → Display) — must out-specify
|
||||||
|
the inline-flex !important above */
|
||||||
|
.btn-response-viewer-header.btn-response-viewer-header--hidden {
|
||||||
|
display: none !important;
|
||||||
|
}
|
||||||
|
|
||||||
.response-viewer {
|
.response-viewer {
|
||||||
display: none;
|
display: none;
|
||||||
position: fixed;
|
position: fixed;
|
||||||
|
|||||||
@@ -290,6 +290,7 @@ export const SettingsUpdateSchema = z
|
|||||||
showTokenCount: z.boolean().optional(),
|
showTokenCount: z.boolean().optional(),
|
||||||
showCost: z.boolean().optional(),
|
showCost: z.boolean().optional(),
|
||||||
showLifecycleLog: z.boolean().optional(),
|
showLifecycleLog: z.boolean().optional(),
|
||||||
|
showResponseViewer: z.boolean().optional(),
|
||||||
showMonitor: z.boolean().optional(),
|
showMonitor: z.boolean().optional(),
|
||||||
showProjectInsights: z.boolean().optional(),
|
showProjectInsights: z.boolean().optional(),
|
||||||
showFileBrowser: z.boolean().optional(),
|
showFileBrowser: z.boolean().optional(),
|
||||||
|
|||||||
Reference in New Issue
Block a user