Q165: the company's profile and how it runs can be changed after onboarding
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
93c5eb2d71
commit
20c37362f3
15 files changed
+208
-37
No files matched your search
@@ -54,6 +54,12 @@ export const zh: Record<string, string> = {
|
||||
"Cancel run": "取消运行",
|
||||
"Show older runs": "显示更早的运行",
|
||||
"Target date": "目标日期",
|
||||
"Edit company": "编辑公司",
|
||||
"Who runs the work": "由谁推进工作",
|
||||
"AI CEO: runs tasks without asking": "AI CEO:无需询问直接执行任务",
|
||||
"AI Co-Founder: asks before risky tasks": "AI 联合创始人:高风险任务先征求同意",
|
||||
"Review deliverables before they are written": "交付物写入前先审查",
|
||||
"Changes apply to work from now on; requests already waiting keep their state.": "更改从现在起对新工作生效;已在等待的申请保持原状态。",
|
||||
"Applies to every company in this app.": "适用于本应用中的所有公司。",
|
||||
"Applies to {company} only; the folders are on this computer.": "仅适用于 {company};文件夹位于这台电脑上。",
|
||||
"Applies to {company} only.": "仅适用于 {company}。",
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
import { useState, type FormEvent } from "react";
|
||||
import type { OrganizationRecord } from "../../../../shared/domain";
|
||||
import { Field } from "../../shared/ui";
|
||||
import { Dialog } from "../../shared/Dialog";
|
||||
import type { SnapshotActions } from "../../app/useSnapshot";
|
||||
import { t } from "../../i18n/i18n";
|
||||
|
||||
/** Changes the company's profile and how it runs after onboarding; requests already waiting keep their state. */
|
||||
export function CompanyDialog({ organization, open, actions, onClose }: { organization: OrganizationRecord; open: boolean; actions: SnapshotActions; onClose: () => void }) {
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
const submit = (event: FormEvent<HTMLFormElement>) => {
|
||||
event.preventDefault();
|
||||
const form = new FormData(event.currentTarget);
|
||||
const value = (key: string) => String(form.get(key) ?? "");
|
||||
setError(null);
|
||||
actions.run(() => window.agentCompany.updateOrganization({
|
||||
orgId: organization.id,
|
||||
name: value("name"),
|
||||
description: value("description"),
|
||||
mission: value("mission"),
|
||||
goal: value("goal"),
|
||||
executionMode: value("executionMode") === "ai_cofounder" ? "ai_cofounder" : "ai_ceo",
|
||||
autoApproveHires: form.get("autoApproveHires") === "on",
|
||||
reviewDeliverables: form.get("reviewDeliverables") === "on",
|
||||
})).then(onClose, (reason: unknown) => setError(reason instanceof Error ? reason.message : String(reason)));
|
||||
};
|
||||
return (
|
||||
<Dialog title={t("Edit company")} open={open} submitLabel={t("Save")} onClose={onClose} onSubmit={submit}>
|
||||
<Field label={t("Name")}><input className="input" name="name" defaultValue={organization.name} required /></Field>
|
||||
<Field label={t("Description")}><textarea className="input" name="description" defaultValue={organization.description} /></Field>
|
||||
<Field label={t("Mission")}><input className="input" name="mission" defaultValue={organization.mission} /></Field>
|
||||
<Field label={t("Goal")}><input className="input" name="goal" defaultValue={organization.goal} /></Field>
|
||||
<Field label={t("Who runs the work")}>
|
||||
<select className="input" name="executionMode" defaultValue={organization.executionMode}>
|
||||
<option value="ai_ceo">{t("AI CEO: runs tasks without asking")}</option>
|
||||
<option value="ai_cofounder">{t("AI Co-Founder: asks before risky tasks")}</option>
|
||||
</select>
|
||||
</Field>
|
||||
<label className="checkbox-row"><input type="checkbox" name="autoApproveHires" defaultChecked={organization.autoApproveHires} /> {t("Auto-approve hires")}</label>
|
||||
<label className="checkbox-row"><input type="checkbox" name="reviewDeliverables" defaultChecked={organization.reviewDeliverables} /> {t("Review deliverables before they are written")}</label>
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)" }}>{t("Changes apply to work from now on; requests already waiting keep their state.")}</div>
|
||||
{error && <div className="form-error" role="alert">{error}</div>}
|
||||
</Dialog>
|
||||
);
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import { CompanyDialog } from "./CompanyDialog";
|
||||
import { ScopeNote } from "./ScopeNote";
|
||||
import { useState, type FormEvent } from "react";
|
||||
import type {
|
||||
@@ -40,6 +41,7 @@ export function WorkspacePanel({
|
||||
actions: SnapshotActions;
|
||||
}) {
|
||||
const [createOpen, setCreateOpen] = useState(false);
|
||||
const [editOpen, setEditOpen] = useState(false);
|
||||
|
||||
const chooseDirectory = async (form: HTMLFormElement) => {
|
||||
const result = await window.agentCompany.pickDirectory();
|
||||
@@ -62,8 +64,12 @@ export function WorkspacePanel({
|
||||
|
||||
return (
|
||||
<div className="page">
|
||||
<h1 className="page-h1">{t("General")}</h1>
|
||||
<div className="row" style={{ alignItems: "baseline" }}>
|
||||
<h1 className="page-h1">{t("General")}</h1>
|
||||
<span style={{ marginLeft: "auto" }}><Button onClick={() => setEditOpen(true)}><Icon name="edit" size={14} /> {t("Edit company")}</Button></span>
|
||||
</div>
|
||||
<ScopeNote scope="company" company={organization.name} />
|
||||
<CompanyDialog key={editOpen ? "open" : "closed"} organization={organization} open={editOpen} actions={actions} onClose={() => setEditOpen(false)} />
|
||||
|
||||
<div className="row" style={{ gap: 8, margin: "16px 0 24px" }}>
|
||||
<Pill tone="violet" dot>{organization.executionMode === "ai_ceo" ? t("AI CEO") : t("AI Co-Founder")}</Pill>
|
||||
|
||||
Reference in new issue
Block a user