Panel: Entwürfe archivieren, Titel aus Überschrift, Titel-Edit
- Archiv pro Projekt: Panel-Button „Archivieren" und MCP-Tool archive_panel legen den Entwurf als <YYYY-MM-DD_HHMM>-<slug>.md mit Frontmatter im Archiv-Ordner ab. Ordner in ai-control.json (archiveDir) + als additionalDirectories/Edit in .claude/settings.json (scanbar). Kein Ordner: Panel öffnet Ordner-Dialog, Zuruf nutzt Argument dir. - Panel-Titel zeigt die erste Überschrift des Entwurfs (Inline-Markdown gestrippt), Fallback „Entwurf"; Bleistift-Button macht ihn editierbar, schreibt die Überschrift via panel_set zurück. - Panel-Kopf zweizeilig: Titel + Edit oben, Aktionen rechtsbündig darunter. - AI_CONTROL_PROJECT als PTY-Env für den MCP-Server.
This commit is contained in:
@@ -551,6 +551,9 @@ const view = initPanelView({
|
||||
content: panelContent,
|
||||
copyBtn: document.getElementById("panel-copy")!,
|
||||
modeBtn: document.getElementById("panel-mode")!,
|
||||
titleEl: panel.querySelector(".panel-title") as HTMLElement,
|
||||
editBtn: document.getElementById("panel-title-edit")!,
|
||||
onCommit: (text) => invoke("panel_set", { project, text }),
|
||||
});
|
||||
|
||||
let detached = false;
|
||||
@@ -586,6 +589,34 @@ document
|
||||
.addEventListener("click", () => invoke("open_panel_window", { project }));
|
||||
document.getElementById("panel-hide")!.addEventListener("click", hidePanel);
|
||||
|
||||
// Archivieren: konfigurierten Ordner nehmen, sonst per Dialog wählen (setzt ihn).
|
||||
const archiveBtn = document.getElementById("panel-archive")!;
|
||||
archiveBtn.addEventListener("click", async () => {
|
||||
const orig = archiveBtn.textContent;
|
||||
try {
|
||||
const configured = await invoke<string | null>("panel_archive_dir_cmd", {
|
||||
project,
|
||||
});
|
||||
let dir: string | undefined;
|
||||
if (!configured) {
|
||||
const { open } = await import("@tauri-apps/plugin-dialog");
|
||||
const chosen = await open({ directory: true, title: "Archiv-Ordner wählen" });
|
||||
if (!chosen) return;
|
||||
dir = chosen as string;
|
||||
}
|
||||
await invoke<string>("panel_archive_cmd", { project, dir });
|
||||
archiveBtn.textContent = "Archiviert";
|
||||
archiveBtn.classList.add("copied");
|
||||
} catch (e) {
|
||||
archiveBtn.textContent = "Fehler";
|
||||
invoke("term_log", { msg: `archive: ${e}` });
|
||||
}
|
||||
setTimeout(() => {
|
||||
archiveBtn.textContent = orig;
|
||||
archiveBtn.classList.remove("copied");
|
||||
}, 1400);
|
||||
});
|
||||
|
||||
// Splitter: Panelbreite ziehen.
|
||||
splitter.addEventListener("mousedown", (e) => {
|
||||
e.preventDefault();
|
||||
|
||||
Reference in New Issue
Block a user