Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions .ai/contexts/ipc-bridge.md
Original file line number Diff line number Diff line change
Expand Up @@ -618,8 +618,23 @@ pages are `general`, `sessions`, `keyboard`, `automation`, `remote`, `integratio

The panel reparents existing rows into named regions before wiring their handlers.
Hidden pages remain in the DOM, preserving every field id and the one Save path.
The Archived projects manager is documented above; project footer actions retain
their existing behavior until their later #863 slice. The new shell adds no trigger controls or archive APIs.
The Archived projects manager is documented above. This project shows the identity
from the same path-and-folder-key project lookup used by deletion, performed after
shell-profile loading finishes: name, full path, host label, folder key and cached
top-level non-terminal session counts (including archived sessions). Both counts
filter flat cache rows with `!s.parentSessionId && s.type !== 'terminal'`.
There is no shared predicate: the parent exclusion matches `renderDefaultStatus`
in `public/app.js` and the sidebar count in `public/sidebar.js`; the terminal
exclusion matches the background projection in `public/app.js`. The sidebar
additionally excludes archived rows for its active count. Host labels fall back
to the alias when `remoteHostLabel` is unavailable.
Without a cached project, supplied path/folder identity remains visible and counts
read Unavailable. Values use textContent. Archive Project and Delete Project move
into its Danger zone before wiring, retaining their ids, deletion busy keys and
handlers. Archive failures use the OK-only `appAlert` adapter from
`public/app-dialogs.js`. The footer contains only Cancel and Save Settings. Identity wraps in
the existing ResizeObserver-driven narrow layout; no layout mode is added.
The new shell adds no trigger controls or archive APIs.
The host-list and refresh defaults now live in `SETTING_DEFAULTS`.

Each page scrolls independently; navigation and the footer stay outside that
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ What changes for you in each release of Switchboard. How to write an entry: [doc
- Settings → Sessions → CLI Agents offers **Show Codex usage**, off by default. Turn it on to show your Codex limits in the status bar and Stats; usage hides quietly when unavailable. (#1139)

### Changed
- Project Settings → This project shows the project's path, host and number of sessions, including archived ones, with Archive Project and Delete Project in a separate Danger zone. (#863)
- After a restart, Switchboard re-reads only Claude Code transcripts changed since the previous run. Codex history is still re-read in full. (#1144)
- Settings → Archived groups project and folder archives by host, shows their paths and archive dates, and filters by name, path or host. Folder archives show their disabled schedule count and can be restored after Undo expires, keeping schedules off until you choose Turn back on. Restore one or several projects with Undo, or delete an archived project through the existing preview without restoring it first. Worktree entries whose repository is gone can be deleted; entries still grouped under a repository explain that you can delete their repository instead. (#863, #1167)
- Codex sessions run non-interactively by a program (`codex exec`: scripted reviews and fixes) are now left out of the sidebar and grid like Claude Agent SDK sessions, under the same **Hide SDK-launched Sessions** setting. They still count in the heatmap and are found by search; the ones you have open stay listed. Codex sessions already indexed are re-checked once at the next start. (#1145)
Expand Down
4 changes: 2 additions & 2 deletions docs/product/UI-PATTERNS.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ The Changes badge is the one place that already meets "never colour alone".
| Agents Delete | `agents-view.js` `runAgentVerb` | `Delete` | `claude rm` (conversation + worktree when safe) | Fresh refusal check, then danger `appConfirm`; refusal stays in the detail without a dialog |
| Worktree Delete | `sidebar.js:1337-1352`, dialog `1949-2017` | `Delete anyway` | `git worktree remove` | custom modal with dirty-file list |
| Worktree Archive project | `sidebar.js` (`worktree-hide-btn`) | `Archive Project` | removes the row, keeps settings and cache, suspends schedules; reversible from Settings | no confirmation; 10-second Undo notice |
| Project Archive | `settings-panel.js` (`sv-archive-btn`) | `Archive Project` | same | no confirmation; 10-second Undo notice |
| Project Delete | `settings-panel.js` (`sv-delete-btn`) | `Delete Project` | drops settings, cache, search index and schedule registration; no file on disk is deleted | `showChoiceDialog`, danger style, focus on Cancel |
| Project Archive | Project Settings → This project → Danger zone, `settings-panel.js` (`sv-archive-btn`) | `Archive Project` | same | no confirmation; 10-second Undo notice |
| Project Delete | Project Settings → This project → Danger zone, `settings-panel.js` (`sv-delete-btn`) | `Delete Project` | drops settings, cache, search index and schedule registration; no file on disk is deleted | `showChoiceDialog`, danger style, focus on Cancel |
| Optional viewer file delete | `viewer-panel.js:284` | — | delete file | danger `appConfirm`, `Delete "<name>"?` / `This cannot be undone.`, button `Delete` |
| Trace file delete | `activity-trace-panel.js:120` | — | delete file | same wording |

Expand Down
8 changes: 6 additions & 2 deletions docs/settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -194,8 +194,12 @@ Project Settings override, for one project, the fields on the **Launch** page: P
**Use global default** box; while it is checked the field shows the global value
and nothing is stored for the project.

The **This project** page reserves space for project identity. For now,
**Archive Project** and **Delete Project** remain in the footer.
The **This project** page shows the project's name, full path, host, folder key
and the number of sessions, including archived ones. Counts are unavailable when
the project is absent from the current project list. Its **Danger zone** holds
**Archive Project** and **Delete Project**; the footer holds only **Cancel** and
**Save Settings**. The first visit opens **Launch**; later visits remember the
last project page.

**Archive Project** removes the project and its nested worktrees from the
sidebar immediately, without asking. A notice offers **Undo** for about 10
Expand Down
36 changes: 29 additions & 7 deletions public/settings-panel.js
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@
// Discover available shell profiles
let shellProfiles = [];
try { shellProfiles = await window.api.getShellProfiles(); } catch {};
const project = isProject ? cachedAllProjects.find(p => p.projectPath === projectPath && (!folderKey || p.folder === folderKey)) : null;

settingsViewerBody.innerHTML = `
<div class="settings-form">
Expand Down Expand Up @@ -567,10 +568,33 @@
moveGroup(launchPage, 'Launch', ['sv-pre-launch', 'sv-add-dirs', 'sv-worktree', 'sv-worktree-name', 'sv-browser-mode', 'sv-sandbox']);
moveGroup(launchPage, 'Claude', ['sv-perm-mode']);
if (isProject) {
const placeholder = document.createElement('p');
placeholder.className = 'settings-description';
placeholder.textContent = 'Project actions are available below.';
pages.get('project').append(placeholder);
const identity = document.createElement('dl');
identity.className = 'settings-project-identity';
const alias = project?.remoteAlias || parseFolderKey(folderKey).alias;
const sessions = Array.isArray(project?.sessions)
? project.sessions.filter(s => !s.parentSessionId && s.type !== 'terminal') : null;
const counts = Array.isArray(sessions)
? `${sessions.length} session${sessions.length === 1 ? '' : 's'} · ${sessions.filter(session => session.archived).length} archived`
: 'Unavailable';
for (const [id, label, value] of [
['name', 'Name', shortName],
['path', 'Full path', projectPath],
['host', 'Host', alias ? (typeof remoteHostLabel === 'function' ? remoteHostLabel(alias, globalSettings.remoteHosts) : alias) : 'Local'],
['folder', 'Folder key', project?.folder || folderKey || 'Unavailable'],
['sessions', 'Sessions', counts],
]) {
const term = document.createElement('dt');
term.textContent = label;
const detail = document.createElement('dd');
detail.id = 'sv-project-' + id;
detail.textContent = value;
identity.append(term, detail);
}
const danger = document.createElement('div');
danger.className = 'settings-section settings-danger-zone';
danger.innerHTML = '<h3 class="settings-section-title">Danger zone</h3><div class="settings-project-actions"></div>';
danger.querySelector('.settings-project-actions').append(form.querySelector('#sv-archive-btn'), form.querySelector('#sv-delete-btn'));
pages.get('project').append(identity, danger);
} else {
moveGroup('general', 'Startup', ['sv-restore-startup']);
moveGroup('general', 'Shell', ['sv-shell-profile']);
Expand Down Expand Up @@ -839,8 +863,6 @@
});
});

const project = isProject ? cachedAllProjects.find(p => p.projectPath === projectPath && (!folderKey || p.folder === folderKey)) : null;

// Save button
async function saveSettings() {
let settings = {};
Expand Down Expand Up @@ -1080,7 +1102,7 @@
document.getElementById('placeholder').style.display = 'flex';
if (typeof loadProjects === 'function') await Promise.resolve(loadProjects()).catch(error => { if (!loadProjects.state?.reportedErrors?.has(error)) console.warn('[switchboard] project reload failed', error); });
} catch (err) {
await showChoiceDialog({ title: `Could not ${action} project`, message: err.message, confirmLabel: 'OK', returnFocus: button });
await appAlert({ title: `Could not ${action} project`, message: err.message });
}
});
}
Expand Down
42 changes: 42 additions & 0 deletions public/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -4161,6 +4161,48 @@ body { display: flex; flex-direction: column; }
margin: 0 0 16px;
}

.settings-project-identity {
display: grid;
grid-template-columns: 7rem minmax(0, 1fr);
gap: 12px;
margin-bottom: 24px;
overflow-wrap: anywhere;
}

.settings-project-identity dt {
color: var(--text-muted);
}

.settings-project-identity dd {
margin: 0;
min-width: 0;
}

.settings-danger-zone {
border: 1px solid var(--control-border);
border-radius: 8px;
padding: 16px;
}

.settings-project-actions {
display: flex;
flex-wrap: wrap;
gap: 12px;
}

.settings-project-actions .settings-remove-btn {
margin-left: 0;
}

.settings-narrow .settings-project-identity {
grid-template-columns: minmax(0, 1fr);
gap: 6px;
}

.settings-narrow .settings-project-identity dd {
margin-bottom: 8px;
}

.settings-details {
margin: 12px 0;
padding: 12px;
Expand Down
Loading
Loading