File manager: open a chat in a folder
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
c9f553dc60
commit
242b80605c
5 files changed
+24
No files matched your search
@@ -5,6 +5,10 @@ until 1.0, minor versions may contain breaking changes.
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- File manager: *Open chat here* in a folder's menu starts a chat in that folder.
|
||||||
|
|
||||||
### Removed
|
### Removed
|
||||||
|
|
||||||
- *Settings → Config file* no longer offers to move `${NAME}` values into the configuration (a
|
- *Settings → Config file* no longer offers to move `${NAME}` values into the configuration (a
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import { Markdown } from "./Markdown";
|
|||||||
import { GitPanel, type GitStatus } from "./GitPanel";
|
import { GitPanel, type GitStatus } from "./GitPanel";
|
||||||
import { FilePreview, previewKind, type PreviewKind } from "./FilePreview";
|
import { FilePreview, previewKind, type PreviewKind } from "./FilePreview";
|
||||||
import { confirmDialog, promptDialog, toast } from "../dialogs";
|
import { confirmDialog, promptDialog, toast } from "../dialogs";
|
||||||
|
import { navigate } from "../router";
|
||||||
|
|
||||||
const CodeEditor = lazy(() => import("./CodeEditor").then((m) => ({ default: m.CodeEditor })));
|
const CodeEditor = lazy(() => import("./CodeEditor").then((m) => ({ default: m.CodeEditor })));
|
||||||
|
|
||||||
@@ -186,6 +187,16 @@ export function Files({ onMenu }: { onMenu: () => void }) {
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/** New chat with the folder as working directory (default model and mode). */
|
||||||
|
const chatHere = async (e: Entry) => {
|
||||||
|
try {
|
||||||
|
const s = await post<{ id: string }>("/sessions", { cwd: e.path });
|
||||||
|
navigate(`/s/${s.id}`);
|
||||||
|
} catch (err) {
|
||||||
|
toast(err);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
const rename = async (e: Entry) => {
|
const rename = async (e: Entry) => {
|
||||||
const name = await promptDialog({ message: t("files.renameTo"), defaultValue: e.name });
|
const name = await promptDialog({ message: t("files.renameTo"), defaultValue: e.name });
|
||||||
if (name && name !== e.name) void act(() => post("/files/move", { from: e.path, to: `${dirName(e.path)}/${name}` }));
|
if (name && name !== e.name) void act(() => post("/files/move", { from: e.path, to: `${dirName(e.path)}/${name}` }));
|
||||||
@@ -324,6 +335,9 @@ export function Files({ onMenu }: { onMenu: () => void }) {
|
|||||||
<details className="entry-menu">
|
<details className="entry-menu">
|
||||||
<summary aria-label={t("files.actions")}><Icon name="more" /></summary>
|
<summary aria-label={t("files.actions")}><Icon name="more" /></summary>
|
||||||
<div className="menu">
|
<div className="menu">
|
||||||
|
{e.is_dir && (
|
||||||
|
<button onClick={() => void chatHere(e)}>{t("files.chatHere")}</button>
|
||||||
|
)}
|
||||||
<button onClick={() => rename(e)}>{t("files.rename")}</button>
|
<button onClick={() => rename(e)}>{t("files.rename")}</button>
|
||||||
<button onClick={() => duplicate(e)}>{t("files.duplicate")}</button>
|
<button onClick={() => duplicate(e)}>{t("files.duplicate")}</button>
|
||||||
{!e.is_dir && (
|
{!e.is_dir && (
|
||||||
|
|||||||
@@ -85,6 +85,7 @@ export const de: Messages = {
|
|||||||
"files.newFolderName": "Ordnername:",
|
"files.newFolderName": "Ordnername:",
|
||||||
"files.renameTo": "Neuer Name:",
|
"files.renameTo": "Neuer Name:",
|
||||||
"files.copyTo": "Name der Kopie:",
|
"files.copyTo": "Name der Kopie:",
|
||||||
|
"files.chatHere": "Chat hier öffnen",
|
||||||
"files.rename": "Umbenennen",
|
"files.rename": "Umbenennen",
|
||||||
"files.duplicate": "Duplizieren",
|
"files.duplicate": "Duplizieren",
|
||||||
"files.download": "Herunterladen",
|
"files.download": "Herunterladen",
|
||||||
|
|||||||
@@ -84,6 +84,7 @@ export const en = {
|
|||||||
"files.newFolderName": "Folder name:",
|
"files.newFolderName": "Folder name:",
|
||||||
"files.renameTo": "New name:",
|
"files.renameTo": "New name:",
|
||||||
"files.copyTo": "Name of the copy:",
|
"files.copyTo": "Name of the copy:",
|
||||||
|
"files.chatHere": "Open chat here",
|
||||||
"files.rename": "Rename",
|
"files.rename": "Rename",
|
||||||
"files.duplicate": "Duplicate",
|
"files.duplicate": "Duplicate",
|
||||||
"files.download": "Download",
|
"files.download": "Download",
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
* under "unreleased"; scripts/release.sh renames the key to the release version.
|
* under "unreleased"; scripts/release.sh renames the key to the release version.
|
||||||
*/
|
*/
|
||||||
export const WHATS_NEW: Record<string, { en: string[]; de: string[] }> = {
|
export const WHATS_NEW: Record<string, { en: string[]; de: string[] }> = {
|
||||||
|
unreleased: {
|
||||||
|
en: ["File manager: “Open chat here” in a folder's menu"],
|
||||||
|
de: ["Dateimanager: „Chat hier öffnen“ im Ordner-Menü"],
|
||||||
|
},
|
||||||
"202611-00002": {
|
"202611-00002": {
|
||||||
en: [
|
en: [
|
||||||
"opencode: “Fetch prices” fills in prices including long-context and peak-hour pricing",
|
"opencode: “Fetch prices” fills in prices including long-context and peak-hour pricing",
|
||||||
|
|||||||
Reference in new issue
Block a user