Compare commits
10
Commits
d422b2ce69
...
05ad409624
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
05ad409624 | ||
|
|
e5a4e87300 | ||
|
|
ccd698602e | ||
|
|
202418f81c | ||
|
|
23c7d55b1d | ||
|
|
5dfc2a6dc6 | ||
|
|
c97adc14cb | ||
|
|
08ff96eec8 | ||
|
|
a6036308b7 | ||
|
|
86dbb4efa1 |
No files matched your search
@@ -31,11 +31,9 @@
|
||||
"postinstall": "node scripts/ensure-electron.cjs"
|
||||
},
|
||||
"dependencies": {
|
||||
"lucide-react": "0.468.0",
|
||||
"react": "19.2.4",
|
||||
"react-dom": "19.2.4",
|
||||
"react-markdown": "10.1.0",
|
||||
"reicon-react": "^1.1.2",
|
||||
"remark-gfm": "4.0.1",
|
||||
"zod": "4.3.6"
|
||||
},
|
||||
|
||||
Generated
-24
@@ -14,9 +14,6 @@ importers:
|
||||
|
||||
.:
|
||||
dependencies:
|
||||
lucide-react:
|
||||
specifier: 0.468.0
|
||||
version: 0.468.0(react@19.2.4)
|
||||
react:
|
||||
specifier: 19.2.4
|
||||
version: 19.2.4
|
||||
@@ -26,9 +23,6 @@ importers:
|
||||
react-markdown:
|
||||
specifier: 10.1.0
|
||||
version: 10.1.0(@types/react@19.2.2)(react@19.2.4)
|
||||
reicon-react:
|
||||
specifier: ^1.1.2
|
||||
version: 1.1.2(react@19.2.4)
|
||||
remark-gfm:
|
||||
specifier: 4.0.1
|
||||
version: 4.0.1
|
||||
@@ -1950,11 +1944,6 @@ packages:
|
||||
resolution: {integrity: sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==}
|
||||
engines: {node: '>=10'}
|
||||
|
||||
lucide-react@0.468.0:
|
||||
resolution: {integrity: sha512-6koYRhnM2N0GGZIdXzSeiNwguv1gt/FAjZOiPl76roBi3xKEXa4WmfpxgQwTTL4KipXjefrnf3oV4IsYhi4JFA==}
|
||||
peerDependencies:
|
||||
react: ^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc
|
||||
|
||||
magic-string@0.30.21:
|
||||
resolution: {integrity: sha512-vd2F4YUyEXKGcLHoq+TEyCjxueSeHnFxyyjNp80yg0XV4vUhnDer/lvvlqM/arB5bXQN5K2/3oinyCRyx8T2CQ==}
|
||||
|
||||
@@ -2426,11 +2415,6 @@ packages:
|
||||
resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==}
|
||||
engines: {node: '>= 6'}
|
||||
|
||||
reicon-react@1.1.2:
|
||||
resolution: {integrity: sha512-dbp1CPEPKFjWfG41lGRMWi74YKfKJlb2JcB/TRBAUQF6jalZYW1dRZisRPCpze5TfQwRBD30p40qnoY+oYi7MQ==}
|
||||
peerDependencies:
|
||||
react: '>=16.8.0'
|
||||
|
||||
remark-gfm@4.0.1:
|
||||
resolution: {integrity: sha512-1quofZ2RQ9EWdeN34S79+KExV1764+wCUGop5CPL1WGdD0ocPpu91lzPGbwWMECpEpd42kJGQwzRfyov9j4yNg==}
|
||||
|
||||
@@ -4908,10 +4892,6 @@ snapshots:
|
||||
dependencies:
|
||||
yallist: 4.0.0
|
||||
|
||||
lucide-react@0.468.0(react@19.2.4):
|
||||
dependencies:
|
||||
react: 19.2.4
|
||||
|
||||
magic-string@0.30.21:
|
||||
dependencies:
|
||||
'@jridgewell/sourcemap-codec': 1.5.5
|
||||
@@ -5623,10 +5603,6 @@ snapshots:
|
||||
string_decoder: 1.1.1
|
||||
util-deprecate: 1.0.2
|
||||
|
||||
reicon-react@1.1.2(react@19.2.4):
|
||||
dependencies:
|
||||
react: 19.2.4
|
||||
|
||||
remark-gfm@4.0.1:
|
||||
dependencies:
|
||||
'@types/mdast': 4.0.4
|
||||
|
||||
@@ -21,7 +21,7 @@ export const organizationContracts = {
|
||||
goalTitle: z.string(), goalDescription: z.string(), providerKey: z.string(), providerSecret: z.string(), providerModel: z.string(),
|
||||
}) satisfies z.ZodType<C.BootstrapOnboardingInput>,
|
||||
setActiveOrganization: z.strictObject({ orgId: id }) satisfies z.ZodType<C.SetActiveOrganizationInput>,
|
||||
setUiPreferences: z.strictObject({ theme: z.enum(["system", "light", "dark"]).optional(), language: z.enum(["en", "zh"]).optional() }) satisfies z.ZodType<C.SetUiPreferencesInput>,
|
||||
setUiPreferences: z.strictObject({ theme: z.enum(["system", "light", "dark", "clock"]).optional(), language: z.enum(["en", "zh"]).optional() }) satisfies z.ZodType<C.SetUiPreferencesInput>,
|
||||
deleteOrganization: z.strictObject({ orgId: id }) satisfies z.ZodType<C.DeleteOrganizationInput>,
|
||||
createOrganization: z.strictObject({
|
||||
organizationName: z.string(), description: z.string().optional(), mission: z.string(), goal: z.string(), employeeName: z.string(),
|
||||
|
||||
@@ -10,7 +10,7 @@ export function setAutonomousPaused(db: DatabaseSync, paused: boolean): void {
|
||||
}
|
||||
|
||||
/** The app-wide theme and language, kept for every company. */
|
||||
export function updateUiPreferences(db: DatabaseSync, input: { theme?: "system" | "light" | "dark"; language?: "en" | "zh" }): void {
|
||||
export function updateUiPreferences(db: DatabaseSync, input: { theme?: "system" | "light" | "dark" | "clock"; language?: "en" | "zh" }): void {
|
||||
const current = db.prepare("select theme, language from app_state where id = 1")
|
||||
.get() as { theme: string; language: string } | undefined;
|
||||
const theme = input.theme ?? current?.theme ?? "system";
|
||||
|
||||
@@ -67,7 +67,7 @@ export class OrganizationService {
|
||||
setAutonomousPaused(this.db, paused);
|
||||
}
|
||||
|
||||
updateUiPreferences(input: { theme?: "system" | "light" | "dark"; language?: "en" | "zh" }): void {
|
||||
updateUiPreferences(input: { theme?: "system" | "light" | "dark" | "clock"; language?: "en" | "zh" }): void {
|
||||
updateUiPreferences(this.db, input);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
import { usePaletteClock } from "../shared/palette-clock";
|
||||
import { usePixelScale } from "../shared/pixel-scale";
|
||||
import { Modal } from "../shared/Modal";
|
||||
import { StaleBanner } from "./StaleBanner";
|
||||
import { oneOf, readViewState, seedViewState, writeViewState } from "../shared/view-state";
|
||||
@@ -8,7 +10,7 @@ import { hasPageUnsaved } from "../shared/unsaved";
|
||||
import { ErrorBoundary } from "../shared/ErrorBoundary";
|
||||
import { StartupScreen } from "./StartupScreen";
|
||||
import type { Focus } from "../pages/types";
|
||||
import { useEffect, useMemo, useState } from "react";
|
||||
import { useMemo, useState } from "react";
|
||||
import { Shell } from "../shared/Shell";
|
||||
import { ROUTE_IDS, type RouteId } from "../shared/routes";
|
||||
import { AvatarDirectoryContext, type AvatarLook } from "../shared/ui";
|
||||
@@ -67,18 +69,8 @@ export function App() {
|
||||
}, [snapshot?.agents, snapshot?.employees, snapshot?.activeOrgId]);
|
||||
const [creatingOrg, setCreatingOrg] = useState(false);
|
||||
|
||||
const theme = snapshot?.uiPreferences.theme ?? "system";
|
||||
useEffect(() => {
|
||||
const media = window.matchMedia("(prefers-color-scheme: dark)");
|
||||
const apply = () => {
|
||||
const resolved = theme === "system" ? (media.matches ? "dark" : "light") : theme;
|
||||
document.documentElement.dataset.theme = resolved;
|
||||
};
|
||||
apply();
|
||||
if (theme !== "system") return;
|
||||
media.addEventListener("change", apply);
|
||||
return () => media.removeEventListener("change", apply);
|
||||
}, [theme]);
|
||||
usePaletteClock(snapshot?.uiPreferences.theme ?? "system");
|
||||
usePixelScale();
|
||||
|
||||
if (!snapshot) {
|
||||
// A failed manual retry is already recorded in syncFailure, which the screen shows.
|
||||
|
||||
@@ -8,7 +8,7 @@ const RISK_NAMES = { low: () => t("Low"), medium: () => t("Medium"), high: () =>
|
||||
export function AutonomySummary({ mode }: { mode: "ai_ceo" | "ai_cofounder" }) {
|
||||
const gated = { level: RISK_NAMES[COMPANY_PRESETS.taskRiskCeiling](), amount: dollars(COMPANY_PRESETS.hireReviewAboveCents) };
|
||||
return (
|
||||
<section aria-label={t("What this mode allows")} style={{ fontSize: 13, color: "var(--text-2)", lineHeight: 1.6 }}>
|
||||
<section aria-label={t("What this mode allows")} style={{ fontSize: "var(--fs-body)", color: "var(--text-2)", lineHeight: 1.6 }}>
|
||||
<ul style={{ margin: 0, paddingLeft: 18 }}>
|
||||
<li>{mode === "ai_ceo"
|
||||
? t("Approved without you: tasks above {level} risk, tasks that run commands in a workspace, and hires over {amount} a month.", gated)
|
||||
|
||||
@@ -168,15 +168,15 @@ export function Onboarding({
|
||||
<div>
|
||||
<div className="row" style={{ gap: 8 }}>
|
||||
<div className="brand-mark">A</div>
|
||||
<div style={{ fontWeight: 540 }}>AgentCompany</div>
|
||||
<div>AgentCompany</div>
|
||||
{cancel && step !== "connectors" && (
|
||||
<button type="button" className="button ghost" style={{ marginLeft: "auto" }} onClick={cancel}>
|
||||
{t("Cancel")}
|
||||
</button>
|
||||
)}
|
||||
</div>
|
||||
<h1 className="page-h1" style={{ fontSize: 24, marginTop: 32, letterSpacing: "-0.02em" }}>{t("Start your AI company.")}</h1>
|
||||
<p className="page-sub" style={{ maxWidth: 460, fontSize: 14, lineHeight: 1.55 }}>
|
||||
<h1 className="page-h1" style={{ fontSize: "var(--fs-display)", marginTop: 32 }}>{t("Start your AI company.")}</h1>
|
||||
<p className="page-sub" style={{ maxWidth: 460, fontSize: "var(--fs-body)", lineHeight: 1.55 }}>
|
||||
{t("Stand up the workspace, bind the provider, and queue the first operating loop.")}
|
||||
</p>
|
||||
<div className="onboarding-steps">
|
||||
@@ -188,11 +188,11 @@ export function Onboarding({
|
||||
<div className="card" style={{ maxWidth: 460 }}>
|
||||
<div className="card-label" style={{ marginBottom: 10 }}>{t("Runtime selected")}</div>
|
||||
<div className="row" style={{ gap: 10 }}>
|
||||
<Icon name="bot" size={18} />
|
||||
<strong style={{ fontSize: 14 }}>{selectedProvider.label}</strong>
|
||||
<Icon name="bot" />
|
||||
<strong style={{ fontSize: "var(--fs-body)" }}>{selectedProvider.label}</strong>
|
||||
{draft.providerModel && <Pill tone="violet">{draft.providerModel}</Pill>}
|
||||
</div>
|
||||
<div style={{ marginTop: 10, fontSize: 12, color: "var(--text-3)" }}>
|
||||
<div style={{ marginTop: 10, fontSize: "var(--fs-body)", color: "var(--text-3)" }}>
|
||||
{t("We never embed the key in the build. Credentials encrypt locally via OS-protected storage.")}
|
||||
</div>
|
||||
</div>
|
||||
@@ -201,7 +201,7 @@ export function Onboarding({
|
||||
<form className="onboarding-panel" onSubmit={submit} noValidate>
|
||||
<div key={step} className="step-view">
|
||||
{restored && step !== "connectors" && (
|
||||
<p role="status" style={{ fontSize: 13, color: "var(--text-2)", margin: "0 0 12px" }}>
|
||||
<p role="status" style={{ fontSize: "var(--fs-body)", color: "var(--text-2)", margin: "0 0 12px" }}>
|
||||
{t("Your progress was restored. Keys are never saved before launch, so enter yours again.")}
|
||||
</p>
|
||||
)}
|
||||
@@ -249,7 +249,7 @@ export function Onboarding({
|
||||
/>
|
||||
)}
|
||||
</div>
|
||||
{error && <div style={{ color: "var(--red)", marginTop: 16, fontSize: 14 }}>{error}</div>}
|
||||
{error && <div style={{ color: "var(--red)", marginTop: 16, fontSize: "var(--fs-body)" }}>{error}</div>}
|
||||
</form>
|
||||
</main>
|
||||
</div>
|
||||
@@ -284,10 +284,10 @@ function WelcomeStep({
|
||||
/>
|
||||
</div>
|
||||
<RestartForLanguage language={language} />
|
||||
<p style={{ color: "var(--text-2)", fontSize: 14, lineHeight: 1.55 }}>
|
||||
<p style={{ color: "var(--text-2)", fontSize: "var(--fs-body)", lineHeight: 1.55 }}>
|
||||
{t("AgentCompany sets up your operating loop in six steps. Bring an API key, pick a runtime for the founding CEO, and we'll wire up the first goal, project, and task.")}
|
||||
</p>
|
||||
<ul style={{ paddingLeft: 20, color: "var(--text-2)", lineHeight: 1.8, margin: 0, fontSize: 14 }}>
|
||||
<ul style={{ paddingLeft: 20, color: "var(--text-2)", lineHeight: 1.8, margin: 0, fontSize: "var(--fs-body)" }}>
|
||||
<li>{t("Connect one model provider (OpenAI, Anthropic, xAI, or Groq).")}</li>
|
||||
<li>{t("Name the company and the human board chair.")}</li>
|
||||
<li>{t("Pick execution mode and bind the workspace path.")}</li>
|
||||
@@ -321,7 +321,7 @@ function CompanyStep({ draft, onChange, onBack, onNext }: StepProps) {
|
||||
<Field label={t("Workspace path (optional)")}>
|
||||
<div className="row" style={{ gap: 6 }}>
|
||||
<input className="input" value={draft.workspacePath} onChange={(event) => onChange({ workspacePath: event.target.value })} />
|
||||
<Button tone="ghost" onClick={chooseWorkspace}><Icon name="folder" size={16} /> {t("Choose")}</Button>
|
||||
<Button tone="ghost" onClick={chooseWorkspace}><Icon name="folder" /> {t("Choose")}</Button>
|
||||
</div>
|
||||
</Field>
|
||||
<Actions onBack={onBack} onNext={onNext} />
|
||||
@@ -333,7 +333,7 @@ function ModeStep({ draft, onChange, onBack, onNext }: StepProps) {
|
||||
return (
|
||||
<div className="form-grid">
|
||||
<h2 className="page-h1">{t("Mode")}</h2>
|
||||
<p style={{ color: "var(--text-3)", fontSize: 14 }}>{t("How autonomous should the CEO be?")}</p>
|
||||
<p style={{ color: "var(--text-3)", fontSize: "var(--fs-body)" }}>{t("How autonomous should the CEO be?")}</p>
|
||||
<ModeCard
|
||||
title={t("AI CEO")}
|
||||
description={t("Runs on its own: approves its risky work and large hires, and writes deliverables without review.")}
|
||||
|
||||
@@ -25,7 +25,7 @@ export function ProviderStep({
|
||||
return (
|
||||
<div className="form-grid">
|
||||
<h2 className="page-h1">{t("Provider")}</h2>
|
||||
<p style={{ color: "var(--text-3)", fontSize: 14 }}>
|
||||
<p style={{ color: "var(--text-3)", fontSize: "var(--fs-body)" }}>
|
||||
{t("Pick the runtime for the founding CEO. You can attach more providers in Settings later.")}
|
||||
</p>
|
||||
<div className="option-grid">
|
||||
@@ -112,7 +112,7 @@ function ProviderCredentialFields({
|
||||
return (
|
||||
<div className="provider-inline-form">
|
||||
{selected.credentialHelp && (
|
||||
<div style={{ fontSize: 13, color: "var(--text-3)", lineHeight: 1.5 }}>{selected.credentialHelp}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", lineHeight: 1.5 }}>{selected.credentialHelp}</div>
|
||||
)}
|
||||
{isOAuthLike ? (
|
||||
<ProviderOAuthConnect
|
||||
@@ -160,7 +160,7 @@ function ProviderCredentialFields({
|
||||
{loading ? t("Getting models...") : fetched ? t("Reload models") : t("Get models")}
|
||||
</Button>
|
||||
)}
|
||||
{loadError && <div style={{ color: "var(--red)", fontSize: 12 }}>{loadError}</div>}
|
||||
{loadError && <div style={{ color: "var(--red)", fontSize: "var(--fs-body)" }}>{loadError}</div>}
|
||||
{(hasCredential || isCustom) && (
|
||||
<Field label={t("Model")}>
|
||||
{fetched || showCuratedList ? (
|
||||
|
||||
@@ -9,7 +9,7 @@ export function StaleBanner({ failure, syncedAt, onRetry }: { failure: SyncFailu
|
||||
// Outside the app root, so it stays usable while a dialog makes the app inert.
|
||||
return createPortal(
|
||||
<div role="alert" className="card" style={{ position: "fixed", top: 8, left: "50%", transform: "translateX(-50%)", zIndex: 900, display: "flex", gap: 10, alignItems: "center", padding: "8px 12px", borderColor: "var(--amber, var(--red))", maxWidth: "min(720px, calc(100vw - 32px))" }}>
|
||||
<div style={{ fontSize: 13, minWidth: 0 }}>
|
||||
<div style={{ fontSize: "var(--fs-body)", minWidth: 0 }}>
|
||||
<strong>{t("Not up to date.")}</strong>{" "}
|
||||
{syncedAt ? t("Showing data from {time}.", { time: formatTime(syncedAt) }) : null}{" "}
|
||||
<span style={{ color: "var(--text-2)", wordBreak: "break-word" }}>{t("Updating failed: {reason} (attempt {count}).", { reason: failure.message, count: failure.attempts })}</span>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Button } from "../shared/ui";
|
||||
import { GameOver } from "../shared/GameOver";
|
||||
import { t } from "../i18n/i18n";
|
||||
import type { SyncFailure } from "./useSnapshot";
|
||||
|
||||
@@ -7,12 +7,12 @@ export function StartupScreen({ failure, onRetry }: { failure: SyncFailure | nul
|
||||
return (
|
||||
<div className="app-shell" style={{ display: "grid", placeItems: "center", padding: 24 }}>
|
||||
{failure ? (
|
||||
<div role="alert" style={{ maxWidth: 480, display: "grid", gap: 12, textAlign: "center" }}>
|
||||
<strong>{t("AgentCompany could not load its data.")}</strong>
|
||||
<div className="mono" style={{ fontSize: 12, color: "var(--text-2)", wordBreak: "break-word" }}>{failure.message}</div>
|
||||
<div style={{ fontSize: 13, color: "var(--text-3)" }}>{t("Retrying every few seconds (attempt {count}).", { count: failure.attempts })}</div>
|
||||
<div><Button onClick={onRetry}>{t("Retry now")}</Button></div>
|
||||
</div>
|
||||
<GameOver
|
||||
title={t("AgentCompany could not load its data.")}
|
||||
error={failure.message}
|
||||
note={t("Retrying every few seconds (attempt {count}); Continue tries now.", { count: failure.attempts })}
|
||||
onContinue={onRetry}
|
||||
/>
|
||||
) : (
|
||||
<div role="status" style={{ color: "var(--text-3)" }}>{t("Starting AgentCompany…")}</div>
|
||||
)}
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,96 @@
|
||||
Fusion Pixel Font
|
||||
https://github.com/TakWolf/fusion-pixel-font
|
||||
|
||||
Copyright (c) 2022, TakWolf (https://takwolf.com).
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
https://openfontlicense.org
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
@@ -0,0 +1,96 @@
|
||||
Ark Pixel Font
|
||||
https://github.com/TakWolf/ark-pixel-font
|
||||
|
||||
Copyright (c) 2021, TakWolf (https://takwolf.com).
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
https://openfontlicense.org
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
@@ -0,0 +1,108 @@
|
||||
[Cubic 11]
|
||||
These fonts are free software.
|
||||
Unlimited permission is granted to use, copy, and distribute them, with or without modification, either commercially or noncommercially.
|
||||
THESE FONTS ARE PROVIDED "AS IS" WITHOUT WARRANTY.
|
||||
此字型是免費的。
|
||||
無論您是否進行對本字型進行商業或非商業性修改,均可無限制地使用,複製和分發它們。
|
||||
本字型的衍生品之授權必須與此字型相同,且不作任何擔保。
|
||||
[JF Dot M+H 12]
|
||||
Copyright(c) 2005 M+ FONTS PROJECT
|
||||
[M+ BITMAP FONTS]
|
||||
Copyright (C) 2002-2004 COZ
|
||||
These fonts are free software.
|
||||
Unlimited permission is granted to use, copy, and distribute it, with or without modification, either commercially and noncommercially.
|
||||
THESE FONTS ARE PROVIDED "AS IS" WITHOUT WARRANTY.
|
||||
これらのフォントはフリー(自由な)ソフトウエアです。
|
||||
あらゆる改変の有無に関わらず、また商業的な利用であっても、自由にご利用、複製、再配布することができますが、全て無保証とさせていただきます。
|
||||
|
||||
This Font Software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
https://scripts.sil.org/OFL
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
@@ -0,0 +1,93 @@
|
||||
Copyright (c) 2019–2025 Lee Minseo (quiple@quiple.dev)
|
||||
|
||||
This font software is licensed under the SIL Open Font License, Version 1.1.
|
||||
This license is copied below, and is also available with a FAQ at:
|
||||
https://openfontlicense.org
|
||||
|
||||
|
||||
-----------------------------------------------------------
|
||||
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
|
||||
-----------------------------------------------------------
|
||||
|
||||
PREAMBLE
|
||||
The goals of the Open Font License (OFL) are to stimulate worldwide
|
||||
development of collaborative font projects, to support the font creation
|
||||
efforts of academic and linguistic communities, and to provide a free and
|
||||
open framework in which fonts may be shared and improved in partnership
|
||||
with others.
|
||||
|
||||
The OFL allows the licensed fonts to be used, studied, modified and
|
||||
redistributed freely as long as they are not sold by themselves. The
|
||||
fonts, including any derivative works, can be bundled, embedded,
|
||||
redistributed and/or sold with any software provided that any reserved
|
||||
names are not used by derivative works. The fonts and derivatives,
|
||||
however, cannot be released under any other type of license. The
|
||||
requirement for fonts to remain under this license does not apply
|
||||
to any document created using the fonts or their derivatives.
|
||||
|
||||
DEFINITIONS
|
||||
"Font Software" refers to the set of files released by the Copyright
|
||||
Holder(s) under this license and clearly marked as such. This may
|
||||
include source files, build scripts and documentation.
|
||||
|
||||
"Reserved Font Name" refers to any names specified as such after the
|
||||
copyright statement(s).
|
||||
|
||||
"Original Version" refers to the collection of Font Software components as
|
||||
distributed by the Copyright Holder(s).
|
||||
|
||||
"Modified Version" refers to any derivative made by adding to, deleting,
|
||||
or substituting -- in part or in whole -- any of the components of the
|
||||
Original Version, by changing formats or by porting the Font Software to a
|
||||
new environment.
|
||||
|
||||
"Author" refers to any designer, engineer, programmer, technical
|
||||
writer or other person who contributed to the Font Software.
|
||||
|
||||
PERMISSION & CONDITIONS
|
||||
Permission is hereby granted, free of charge, to any person obtaining
|
||||
a copy of the Font Software, to use, study, copy, merge, embed, modify,
|
||||
redistribute, and sell modified and unmodified copies of the Font
|
||||
Software, subject to the following conditions:
|
||||
|
||||
1) Neither the Font Software nor any of its individual components,
|
||||
in Original or Modified Versions, may be sold by itself.
|
||||
|
||||
2) Original or Modified Versions of the Font Software may be bundled,
|
||||
redistributed and/or sold with any software, provided that each copy
|
||||
contains the above copyright notice and this license. These can be
|
||||
included either as stand-alone text files, human-readable headers or
|
||||
in the appropriate machine-readable metadata fields within text or
|
||||
binary files as long as those fields can be easily viewed by the user.
|
||||
|
||||
3) No Modified Version of the Font Software may use the Reserved Font
|
||||
Name(s) unless explicit written permission is granted by the corresponding
|
||||
Copyright Holder. This restriction only applies to the primary font name as
|
||||
presented to the users.
|
||||
|
||||
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
|
||||
Software shall not be used to promote, endorse or advertise any
|
||||
Modified Version, except to acknowledge the contribution(s) of the
|
||||
Copyright Holder(s) and the Author(s) or with their explicit written
|
||||
permission.
|
||||
|
||||
5) The Font Software, modified or unmodified, in part or in whole,
|
||||
must be distributed entirely under this license, and must not be
|
||||
distributed under any other license. The requirement for fonts to
|
||||
remain under this license does not apply to any document created
|
||||
using the Font Software.
|
||||
|
||||
TERMINATION
|
||||
This license becomes null and void if any of the above conditions are
|
||||
not met.
|
||||
|
||||
DISCLAIMER
|
||||
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
|
||||
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
|
||||
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
|
||||
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
|
||||
OTHER DEALINGS IN THE FONT SOFTWARE.
|
||||
@@ -20,8 +20,8 @@ const APPROVAL_KINDS: Record<string, string> = {
|
||||
};
|
||||
export const approvalKindLabel = (kind: string) => labelOf("approval kind", APPROVAL_KINDS, kind);
|
||||
|
||||
const OFFICE_ACTIVITIES: Record<string, string> = { active: t("Active"), thinking: t("Thinking"), busy: t("Busy"), idle: t("Idle") };
|
||||
export const officeActivityLabel = (activity: string) => labelOf("office activity", OFFICE_ACTIVITIES, activity);
|
||||
const OFFICE_STATES: Record<string, string> = { running: t("Running"), queued: t("Queued"), cooldown: t("Cooling down"), blocked: t("Blocked"), idle: t("Idle") };
|
||||
export const officeStateLabel = (state: string) => labelOf("office state", OFFICE_STATES, state);
|
||||
|
||||
const APPROVAL_STATES: Record<string, string> = { pending: t("Pending"), approved: t("Approved"), declined: t("Declined"), superseded: t("Superseded") };
|
||||
export const approvalStateLabel = (state: string) => labelOf("approval state", APPROVAL_STATES, state);
|
||||
|
||||
+11
-11
@@ -256,12 +256,13 @@ export const zh: Record<string, string> = {
|
||||
"Base URL is required.": "请填写基础 URL。",
|
||||
"Billing": "用量账单",
|
||||
"Blocked": "受阻",
|
||||
"Cooling down": "冷却中",
|
||||
"Waiting for your approval.": "正在等待你的审批。",
|
||||
"Board": "看板",
|
||||
"Browse": "浏览",
|
||||
"Budget": "预算",
|
||||
"Budget cap": "预算上限",
|
||||
"Budget utilization": "预算使用率",
|
||||
"Busy": "忙碌",
|
||||
"By agent": "按智能体",
|
||||
"CEO": "CEO",
|
||||
"CEO OFFICE": "CEO 办公室",
|
||||
@@ -343,7 +344,6 @@ export const zh: Record<string, string> = {
|
||||
"That file could not be read as an image.": "无法将该文件读取为图片。",
|
||||
"Conversation messages": "会话消息",
|
||||
"Office tools": "办公室工具",
|
||||
"Agents with work stay at their desks. Only idle agents walk to coffee, snacks or the meeting table.": "有工作的智能体会一直待在工位;只有空闲的智能体才会去咖啡机、零食区或会议桌。",
|
||||
"Avatar": "头像",
|
||||
"Avatar emoji": "头像表情",
|
||||
"Avatar color": "头像颜色",
|
||||
@@ -580,7 +580,6 @@ export const zh: Record<string, string> = {
|
||||
"Team": "团队",
|
||||
"Tests": "测试",
|
||||
"Theme": "主题",
|
||||
"Thinking": "思考中",
|
||||
"Progress": "进度",
|
||||
"Title": "标题",
|
||||
"Today": "今天",
|
||||
@@ -601,6 +600,14 @@ export const zh: Record<string, string> = {
|
||||
"Version (semver)": "版本(semver)",
|
||||
"Visibility": "可见性",
|
||||
"Needs you": "需要你处理",
|
||||
"Goal progress": "目标进度",
|
||||
"Budget allocated": "已分配预算",
|
||||
"Budget compared with the largest agent budget": "与最高智能体预算相比",
|
||||
"GAME OVER": "游戏结束",
|
||||
"The rest of the app still works; Continue tries this page again.": "应用其他部分仍可使用;点“继续”会重新打开此页。",
|
||||
"Continue reloads the window; your data is kept.": "点“继续”会重新加载窗口;数据会保留。",
|
||||
"Retrying every few seconds (attempt {count}); Continue tries now.": "每隔几秒自动重试(第 {count} 次);点“继续”立即重试。",
|
||||
"Follow the clock": "跟随时间(夜间变暗)",
|
||||
"Next in line": "下一项工作",
|
||||
"Stopped: {reason}": "已停下:{reason}",
|
||||
"{n} more after these": "之后还有 {n} 项",
|
||||
@@ -701,8 +708,6 @@ export const zh: Record<string, string> = {
|
||||
"Waiting for the {name} sign-in in your browser (check {check} of {checks}).": "正在等待你在浏览器中完成 {name} 登录(第 {check}/{checks} 次检查)。",
|
||||
"Stop waiting": "停止等待",
|
||||
"People to mention": "可提及的人",
|
||||
"Only a task runs: an agent picks it up and does the work. Goals and projects group tasks; documents and knowledge are what agents read and write along the way.": "只有任务会被执行:智能体接手任务并完成工作。目标和项目用来归组任务;文档和知识是智能体在工作中读写的内容。",
|
||||
"Agents read and write these while working on tasks. Nothing here starts work; a task does.": "智能体在执行任务时读写这些内容。这里的内容不会自行启动工作,只有任务会。",
|
||||
"{title}: use the arrow keys to read each value": "{title}:用方向键逐项读取数值",
|
||||
"{rate}% of judged work accepted": "已评判的工作中 {rate}% 被接受",
|
||||
"No work judged yet": "还没有评判过的工作",
|
||||
@@ -719,7 +724,7 @@ export const zh: Record<string, string> = {
|
||||
"Copy failed": "复制失败",
|
||||
"Checking account status with Composio…": "正在向 Composio 核对账号状态…",
|
||||
"Account status checked with Composio at {time}.": "已于 {time} 向 Composio 核对账号状态。",
|
||||
"Account status could not be checked with Composio: {reason}. The statuses below may be out of date.": "无法向 Composio 核对账号状态:{reason}。下方状态可能已过时。",
|
||||
"Account status could not be checked with Composio, so the statuses below may be out of date. Reason: {reason}": "无法向 Composio 核对账号状态,下方状态可能已过时。原因:{reason}",
|
||||
"{name} ({label}) is connected.": "{name}({label})已连接。",
|
||||
"{name} ({label}) is still not connected. If you finished signing in, check again; otherwise connect again.": "{name}({label})仍未连接。如果已经完成登录,请再次检查;否则请重新连接。",
|
||||
"Check again": "再次检查",
|
||||
@@ -741,12 +746,7 @@ export const zh: Record<string, string> = {
|
||||
"Stay": "留下",
|
||||
"This page could not be shown.": "此页面无法显示。",
|
||||
"AgentCompany hit an error it could not recover from here.": "AgentCompany 遇到了无法在此恢复的错误。",
|
||||
"The rest of the app still works; go to another page or try this one again.": "应用的其他部分仍可使用;可以前往其他页面,或重试此页面。",
|
||||
"Reloading the window starts it again; your data is kept.": "重新加载窗口即可重新开始;你的数据会保留。",
|
||||
"Try again": "重试",
|
||||
"Reload": "重新加载",
|
||||
"AgentCompany could not load its data.": "AgentCompany 无法加载数据。",
|
||||
"Retrying every few seconds (attempt {count}).": "每隔几秒重试一次(第 {count} 次)。",
|
||||
"Retry now": "立即重试",
|
||||
"Starting AgentCompany…": "正在启动 AgentCompany…",
|
||||
"Direct: only its members take part, and every message wakes the other members. As the board, you can read it even when you are not a member.": "私聊:只有成员参与,每条消息都会唤醒其他成员。作为董事会,即使你不是成员也能阅读。",
|
||||
|
||||
@@ -7,6 +7,7 @@ import "./styles/fonts.css";
|
||||
import "./styles.css";
|
||||
import "./styles/components.css";
|
||||
import "./overlays.css";
|
||||
import "./styles/pixel.css";
|
||||
|
||||
ReactDOM.createRoot(document.getElementById("root")!).render(
|
||||
<React.StrictMode>
|
||||
|
||||
@@ -12,10 +12,6 @@
|
||||
width: min(520px, 100%);
|
||||
max-height: min(760px, 100%);
|
||||
overflow: auto;
|
||||
border: 1px solid var(--border);
|
||||
border-radius: var(--r-xl);
|
||||
background: var(--panel);
|
||||
box-shadow: 0 20px 60px rgba(24, 24, 24, 0.18);
|
||||
padding: var(--sp-5);
|
||||
animation: overlay-enter var(--motion-base) var(--ease-out-expo);
|
||||
}
|
||||
@@ -27,7 +23,8 @@
|
||||
from { opacity: 0; transform: translateY(8px) scale(0.98); }
|
||||
to { opacity: 1; transform: none; }
|
||||
}
|
||||
.modal-title { margin: 0 0 var(--sp-4); font-size: var(--fs-title); font-weight: 600; letter-spacing: -0.01em; }
|
||||
/* Dialog name plate, as a speaker's name above an RPG text box. */
|
||||
.modal-title { display: inline-block; margin: 0 0 var(--sp-4); padding: 2px 10px; font-size: var(--fs-title); background: var(--btn-primary-bg); color: var(--btn-primary-fg); box-shadow: 2px 2px 0 0 var(--border-strong); }
|
||||
.modal-actions { display: flex; justify-content: flex-end; gap: var(--sp-2); margin-top: var(--sp-5); }
|
||||
|
||||
.onboarding-window {
|
||||
@@ -107,7 +104,7 @@
|
||||
.option-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
|
||||
.option-card:active { transform: scale(0.99); }
|
||||
.option-card.active { border-color: var(--text-1); box-shadow: inset 0 0 0 1px var(--text-1); }
|
||||
.option-card .opt-title { font-size: var(--fs-body); font-weight: 540; }
|
||||
.option-card .opt-title { font-size: var(--fs-body); }
|
||||
.option-card .opt-sub { font-size: var(--fs-caption); color: var(--text-3); margin-top: var(--sp-1); }
|
||||
.provider-inline-form {
|
||||
display: grid;
|
||||
@@ -145,8 +142,6 @@
|
||||
.menu-label {
|
||||
padding: var(--sp-2) var(--sp-2) var(--sp-1);
|
||||
font-size: var(--fs-caption);
|
||||
font-weight: 540;
|
||||
letter-spacing: 0.01em;
|
||||
color: var(--text-3);
|
||||
}
|
||||
.menu-row {
|
||||
@@ -164,7 +159,7 @@
|
||||
transition: background var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
|
||||
}
|
||||
.menu-row:hover { background: var(--hover); color: var(--text-1); }
|
||||
.menu-row.active { background: var(--panel-3); color: var(--text-1); font-weight: 540; }
|
||||
.menu-row.active { background: var(--panel-3); color: var(--text-1); }
|
||||
.menu-row.danger { color: var(--red); }
|
||||
.menu-row.danger:hover { background: rgba(210, 59, 59, 0.1); color: var(--red); }
|
||||
.menu-row .menu-check { margin-left: auto; color: var(--accent); display: inline-flex; }
|
||||
|
||||
@@ -158,7 +158,7 @@ export function ApprovalsPage({ snapshot, actions, navigate, focus }: PageProps)
|
||||
{decided.length > 0 && (
|
||||
<>
|
||||
<div className="section-label" style={{ margin: "32px 0 10px" }}>{t("Recently decided")}</div>
|
||||
{driftError && <div style={{ color: "var(--red)", fontSize: 13, marginBottom: 8 }}>{t("Could not check approved content: {message}", { message: driftError })}</div>}
|
||||
{driftError && <div style={{ color: "var(--red)", fontSize: "var(--fs-body)", marginBottom: 8 }}>{t("Could not check approved content: {message}", { message: driftError })}</div>}
|
||||
<div className="card" style={{ padding: 0, overflow: "hidden" }}>
|
||||
{shownDecided.map((approval, index) => (
|
||||
<DecidedRow
|
||||
@@ -176,7 +176,7 @@ export function ApprovalsPage({ snapshot, actions, navigate, focus }: PageProps)
|
||||
</div>
|
||||
{decided.length > decidedLimit && (
|
||||
<div className="row" style={{ justifyContent: "center", marginTop: 12, gap: 10 }}>
|
||||
<span style={{ fontSize: 12, color: "var(--text-3)" }}>{t("Showing {shown} of {total}", { shown: Math.min(decidedLimit, decided.length), total: decided.length })}</span>
|
||||
<span style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{t("Showing {shown} of {total}", { shown: Math.min(decidedLimit, decided.length), total: decided.length })}</span>
|
||||
<Button size="small" onClick={() => setDecidedLimit((limit) => limit + DECIDED_PAGE)}>{t("Show earlier decisions")}</Button>
|
||||
</div>
|
||||
)}
|
||||
@@ -232,7 +232,7 @@ function StatTile({ label, value, tone }: { label: string; value: string; tone?:
|
||||
<div className="card-label" style={{ marginBottom: 6 }}>{label}</div>
|
||||
<div
|
||||
className="num"
|
||||
style={{ fontSize: 18, fontWeight: 600, color: tone === "amber" ? "var(--amber)" : "var(--text-1)", letterSpacing: "-0.02em" }}
|
||||
style={{ fontSize: "var(--fs-display)", color: tone === "amber" ? "var(--amber)" : "var(--text-1)" }}
|
||||
>
|
||||
{value}
|
||||
</div>
|
||||
@@ -266,7 +266,6 @@ function ApprovalRow({
|
||||
<div
|
||||
style={{
|
||||
border: "1px solid var(--border)",
|
||||
borderRadius: 12,
|
||||
background: "var(--panel)",
|
||||
padding: 18,
|
||||
marginBottom: 10,
|
||||
@@ -276,20 +275,20 @@ function ApprovalRow({
|
||||
alignItems: "flex-start",
|
||||
}}
|
||||
>
|
||||
<div style={{ width: 3, alignSelf: "stretch", background: tone.color, borderRadius: 2 }} />
|
||||
<div style={{ width: 3, alignSelf: "stretch", background: tone.color }} />
|
||||
<div style={{ minWidth: 0 }}>
|
||||
<div className="row" style={{ marginBottom: 4 }}>
|
||||
<span style={{ fontSize: 12, color: tone.color, fontWeight: 540, letterSpacing: "0.02em" }}>{tone.label}</span>
|
||||
<span style={{ fontSize: "var(--fs-body)", color: tone.color }}>{tone.label}</span>
|
||||
<span style={{ color: "var(--text-4)" }}>·</span>
|
||||
<Pill>{approvalKindLabel(approval.kind)}</Pill>
|
||||
</div>
|
||||
<div style={{ fontSize: 15, fontWeight: 540, letterSpacing: "-0.01em", marginBottom: 4 }}>{approval.title}</div>
|
||||
<div style={{ fontSize: 14, color: "var(--text-2)", lineHeight: 1.5, marginBottom: 12, whiteSpace: "pre-wrap" }}>
|
||||
<div style={{ fontSize: "var(--fs-body)", marginBottom: 4 }}>{approval.title}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-2)", lineHeight: 1.5, marginBottom: 12, whiteSpace: "pre-wrap" }}>
|
||||
{approval.details}
|
||||
</div>
|
||||
<div className="row" style={{ gap: 8 }}>
|
||||
<Avatar name={requester} size="sm" bot={isBot} />
|
||||
<span style={{ fontSize: 12, color: "var(--text-3)" }}>{t("Requested by {requester}", { requester })} · {formatRelative(approval.createdAt)}</span>
|
||||
<span style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{t("Requested by {requester}", { requester })} · {formatRelative(approval.createdAt)}</span>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: 6, alignItems: "flex-end" }}>
|
||||
@@ -336,27 +335,27 @@ function DecidedRow({
|
||||
style={{
|
||||
gap: 12,
|
||||
padding: "12px 18px",
|
||||
fontSize: 14,
|
||||
fontSize: "var(--fs-body)",
|
||||
borderBottom: last ? "none" : "1px solid var(--border-soft)",
|
||||
background: focused ? "var(--accent-soft)" : undefined,
|
||||
}}
|
||||
>
|
||||
<Icon name={approved ? "check" : "x"} size={14} color={approved ? "var(--green)" : superseded ? "var(--text-3)" : "var(--red)"} />
|
||||
<Icon name={approved ? "check" : "x"} color={approved ? "var(--green)" : superseded ? "var(--text-3)" : "var(--red)"} />
|
||||
<button
|
||||
type="button"
|
||||
className="link-button"
|
||||
aria-label={t("View record of {title}", { title: approval.title })}
|
||||
onClick={onView}
|
||||
style={{ flex: 1, fontWeight: 480, color: "var(--text-1)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", textAlign: "left" }}
|
||||
style={{ flex: 1, color: "var(--text-1)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", textAlign: "left" }}
|
||||
>
|
||||
{approval.title}
|
||||
</button>
|
||||
{approval.sourceEntityType === "task" && approval.sourceEntityId && (
|
||||
<button type="button" className="link-button" style={{ fontSize: 12 }} onClick={() => onOpenTask(approval.sourceEntityId!)}>{t("Open task")}</button>
|
||||
<button type="button" className="link-button" style={{ fontSize: "var(--fs-body)" }} onClick={() => onOpenTask(approval.sourceEntityId!)}>{t("Open task")}</button>
|
||||
)}
|
||||
{drift && <Pill tone="amber">{drift === "changed" ? t("Changed since approval") : t("Removed since approval")}</Pill>}
|
||||
<Avatar name={requester} size="sm" bot />
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)", width: 180, textAlign: "right", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }}>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", width: 180, textAlign: "right", whiteSpace: "nowrap", overflow: "hidden", textOverflow: "ellipsis" }}>
|
||||
{decidedLabel} · {formatRelative(approval.decidedAt ?? approval.createdAt)}{superseded ? "" : ` · ${decider.split(" ")[0]}`}
|
||||
</div>
|
||||
</div>
|
||||
@@ -412,7 +411,7 @@ function BatchSummary({ total, result, onDismiss }: { total: number; result: Bat
|
||||
return (
|
||||
<div role="status" className="card" style={{ padding: 14, marginBottom: 16 }}>
|
||||
<div className="row" style={{ gap: 8 }}>
|
||||
<span style={{ fontWeight: 600 }}>{t("Approved {n} of {total}.", { n: result.approved.length, total })}</span>
|
||||
<span>{t("Approved {n} of {total}.", { n: result.approved.length, total })}</span>
|
||||
<span style={{ marginLeft: "auto" }}><Button size="small" tone="ghost" onClick={onDismiss}>{t("Dismiss")}</Button></span>
|
||||
</div>
|
||||
{result.failed.map((failure) => (
|
||||
|
||||
@@ -46,7 +46,7 @@ export function ConnectorsPage({ snapshot, actions }: PageProps) {
|
||||
|
||||
return (
|
||||
<div style={{ maxWidth: 1060 }}>
|
||||
<h2 style={{ margin: "0 0 18px", fontSize: 16, fontWeight: 600 }}>{t("Connectors")}</h2>
|
||||
<h2 style={{ margin: "0 0 18px", fontSize: "var(--fs-body)" }}>{t("Connectors")}</h2>
|
||||
|
||||
{connectError && <ErrorText message={connectError} />}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ export function FilesPage({ snapshot, actions, focus }: PageProps) {
|
||||
]}
|
||||
/>
|
||||
<Button tone="primary" onClick={upload}>
|
||||
<Icon name="upload" size={16} /> {t("Upload")}
|
||||
<Icon name="upload" /> {t("Upload")}
|
||||
</Button>
|
||||
</TopbarActions>
|
||||
<h1 className="page-h1">{t("Files")}</h1>
|
||||
@@ -119,7 +119,7 @@ export function FilesPage({ snapshot, actions, focus }: PageProps) {
|
||||
|
||||
<div className="row" style={{ marginBottom: 10 }}>
|
||||
<div className="section-label">{labelFor(section)}</div>
|
||||
<div style={{ marginLeft: "auto", fontSize: 12, color: "var(--text-3)" }}>{t("Modified")} ↓</div>
|
||||
<div style={{ marginLeft: "auto", fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{t("Modified")} ↓</div>
|
||||
</div>
|
||||
|
||||
{view === "list" ? (
|
||||
@@ -163,7 +163,7 @@ function FilesFilter({
|
||||
<Popover
|
||||
trigger={({ toggle }) => (
|
||||
<button type="button" className="button ghost" aria-label={t("Filter files")} onClick={toggle}>
|
||||
<Icon name="filter" size={16} color={scan !== "all" ? "var(--accent)" : "currentColor"} />
|
||||
<Icon name="filter" color={scan !== "all" ? "var(--accent)" : "currentColor"} />
|
||||
</button>
|
||||
)}
|
||||
>
|
||||
@@ -173,7 +173,7 @@ function FilesFilter({
|
||||
{options.map((option) => (
|
||||
<MenuRow key={option.id} active={scan === option.id} onClick={() => onScan(option.id)}>
|
||||
{option.label}
|
||||
{scan === option.id && <span className="menu-check"><Icon name="check" size={16} /></span>}
|
||||
{scan === option.id && <span className="menu-check"><Icon name="check" /></span>}
|
||||
</MenuRow>
|
||||
))}
|
||||
</>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { XpBar } from "../shared/XpBar";
|
||||
import { runTriggerLabel } from "../i18n/labels";
|
||||
import { goalProgress, type GoalPace } from "./home/goal-progress";
|
||||
import { nextUp } from "./home/next-up";
|
||||
@@ -57,7 +58,7 @@ export function HomePage({ snapshot, actions, navigate }: PageProps) {
|
||||
return (
|
||||
<div className="page-wide" style={{ maxWidth: 1240 }}>
|
||||
<TopbarActions>
|
||||
<Button tone="primary" onClick={() => setNewTaskOpen(true)}><Icon name="plus" size={16} /> {t("New task")}</Button>
|
||||
<Button tone="primary" onClick={() => setNewTaskOpen(true)}><Icon name="plus" /> {t("New task")}</Button>
|
||||
</TopbarActions>
|
||||
<h1 className="page-h1">{greeting}, {firstName}</h1>
|
||||
<p className="page-sub">{renderSummary(needsYou.length, agents.length)}</p>
|
||||
@@ -114,17 +115,15 @@ function GoalCard({
|
||||
return (
|
||||
<section className="card">
|
||||
<div className="card-label" style={{ marginBottom: 12 }}>{t("Quarter goal")}</div>
|
||||
<div style={{ fontSize: 16, fontWeight: 540, lineHeight: 1.4, letterSpacing: "-0.01em", display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical", overflow: "hidden", minHeight: 44 }}>
|
||||
<div style={{ fontSize: "var(--fs-body)", lineHeight: 1.4, display: "-webkit-box", WebkitLineClamp: 2, WebkitBoxOrient: "vertical", overflow: "hidden", minHeight: 44 }}>
|
||||
{goal ? goal.title : t("Set the first goal for {organizationName}.", { organizationName })}
|
||||
</div>
|
||||
<div className="row" style={{ alignItems: "baseline", gap: 8, marginTop: 16 }}>
|
||||
<span className="num" style={{ fontSize: 18, fontWeight: 600 }}>{progress ? `${percent}%` : "—"}</span>
|
||||
<span style={{ fontSize: 12, color: "var(--text-3)" }}>{progress?.pace ? statusLabel(progress.pace) : t("no target date")}</span>
|
||||
<span className="num" style={{ fontSize: "var(--fs-display)" }}>{progress ? `${percent}%` : "—"}</span>
|
||||
<span style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{progress?.pace ? statusLabel(progress.pace) : t("no target date")}</span>
|
||||
{goal && <TargetDate goal={goal} actions={actions} />}
|
||||
</div>
|
||||
<div style={{ marginTop: 12, height: 4, background: "var(--panel-3)", borderRadius: 999, overflow: "hidden" }}>
|
||||
<div style={{ width: `${percent}%`, height: "100%", background: "var(--text-1)", transition: "width var(--motion-slow) var(--ease-out)" }} />
|
||||
</div>
|
||||
<div style={{ marginTop: 12 }}><XpBar percent={percent} label={t("Goal progress")} /></div>
|
||||
{goal?.status === "active" && goal.stalledReason && (
|
||||
<div className="row" style={{ marginTop: 12, gap: 8, alignItems: "center" }}>
|
||||
<span className="form-error" role="status" style={{ flex: 1, marginTop: 0 }}>{goal.stalledReason}</span>
|
||||
@@ -153,23 +152,21 @@ function SpendCard({
|
||||
<section className="card">
|
||||
<div className="card-label" style={{ marginBottom: 12 }}>{t("Monthly budget")}</div>
|
||||
<div className="row" style={{ alignItems: "baseline", gap: 6 }}>
|
||||
<span className="num" style={{ fontSize: 18, fontWeight: 600 }}>{money(totalBudgetCents)}</span>
|
||||
<span style={{ fontSize: 12, color: "var(--text-3)" }}>{capCents > 0 ? `/ ${money(capCents)}` : t("allocated")}</span>
|
||||
</div>
|
||||
<div style={{ marginTop: 12, height: 4, background: "var(--panel-3)", borderRadius: 999, overflow: "hidden" }}>
|
||||
<div style={{ width: `${fillPct}%`, height: "100%", background: "var(--text-1)" }} />
|
||||
<span className="num" style={{ fontSize: "var(--fs-display)" }}>{money(totalBudgetCents)}</span>
|
||||
<span style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{capCents > 0 ? `/ ${money(capCents)}` : t("allocated")}</span>
|
||||
</div>
|
||||
<div style={{ marginTop: 12 }}><XpBar percent={fillPct} label={t("Budget allocated")} /></div>
|
||||
<div style={{ marginTop: 12, display: "flex", flexDirection: "column", gap: 8 }}>
|
||||
{connected.slice(0, 3).map((provider) => {
|
||||
const allocatedCents = agents.filter((agent) => agent.modelProviderId === provider.id).reduce((sum, agent) => sum + agent.budgetCents, 0);
|
||||
return (
|
||||
<div key={provider.id} className="row" style={{ fontSize: 14 }}>
|
||||
<div key={provider.id} className="row" style={{ fontSize: "var(--fs-body)" }}>
|
||||
<span style={{ color: "var(--text-2)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{provider.label}</span>
|
||||
<span className="num mono" style={{ marginLeft: "auto", color: "var(--text-1)", fontWeight: 500 }}>{money(allocatedCents)}</span>
|
||||
<span className="num mono" style={{ marginLeft: "auto", color: "var(--text-1)" }}>{money(allocatedCents)}</span>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
{connected.length === 0 && <span style={{ fontSize: 14, color: "var(--text-3)" }}>{t("No providers connected")}</span>}
|
||||
{connected.length === 0 && <span style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{t("No providers connected")}</span>}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
@@ -191,7 +188,7 @@ function RunActivityCard({
|
||||
<section className="card">
|
||||
<div className="row" style={{ marginBottom: 12 }}>
|
||||
<span className="card-label">{t("Agent runs")}</span>
|
||||
<button type="button" className="link-button" style={{ marginLeft: "auto", fontSize: 12 }} onClick={onViewAll}>{t("All runs")} →</button>
|
||||
<button type="button" className="link-button" style={{ marginLeft: "auto", fontSize: "var(--fs-body)" }} onClick={onViewAll}>{t("All runs")} →</button>
|
||||
</div>
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: 12 }}>
|
||||
{recent.map((run) => {
|
||||
@@ -201,15 +198,15 @@ function RunActivityCard({
|
||||
<div key={run.id} className="row" style={{ gap: 10 }}>
|
||||
{agent && <Avatar name={agent.name} size="sm" bot />}
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ fontSize: 14, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{task?.title ?? run.taskId}</div>
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)" }}>{agent?.name ?? t("Agent")} · {runTriggerLabel(run.trigger)}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{task?.title ?? run.taskId}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{agent?.name ?? t("Agent")} · {runTriggerLabel(run.trigger)}</div>
|
||||
</div>
|
||||
<Pill tone={runStateTone(run.state)}>{runStateLabel(run.state)}</Pill>
|
||||
<span className="mono" style={{ fontSize: 12, color: "var(--text-3)", flexShrink: 0 }}>{formatRelative(run.createdAt)}</span>
|
||||
<span className="mono" style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", flexShrink: 0 }}>{formatRelative(run.createdAt)}</span>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
{recent.length === 0 && <div style={{ fontSize: 14, color: "var(--text-3)" }}>{t("No runs yet")}</div>}
|
||||
{recent.length === 0 && <div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{t("No runs yet")}</div>}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
@@ -233,7 +230,7 @@ function RecentMessagesCard({
|
||||
<section className="card">
|
||||
<div className="row" style={{ marginBottom: 12 }}>
|
||||
<span className="card-label">{t("Recent messages")}</span>
|
||||
<button type="button" className="link-button" style={{ marginLeft: "auto", fontSize: 12 }} onClick={onViewAll}>{t("Open chat")} →</button>
|
||||
<button type="button" className="link-button" style={{ marginLeft: "auto", fontSize: "var(--fs-body)" }} onClick={onViewAll}>{t("Open chat")} →</button>
|
||||
</div>
|
||||
<div style={{ display: "flex", flexDirection: "column", gap: 12 }}>
|
||||
{recent.map((msg) => {
|
||||
@@ -247,16 +244,16 @@ function RecentMessagesCard({
|
||||
<Avatar name={name} size="sm" bot={msg.senderType === "agent"} />
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div className="row" style={{ gap: 6 }}>
|
||||
<span style={{ fontSize: 14, fontWeight: 540 }}>{name}</span>
|
||||
{space && <span style={{ fontSize: 12, color: "var(--text-3)" }}>#{space.name}</span>}
|
||||
<span className="mono" style={{ marginLeft: "auto", fontSize: 12, color: "var(--text-3)", flexShrink: 0 }}>{formatTime(msg.createdAt)}</span>
|
||||
<span style={{ fontSize: "var(--fs-body)" }}>{name}</span>
|
||||
{space && <span style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>#{space.name}</span>}
|
||||
<span className="mono" style={{ marginLeft: "auto", fontSize: "var(--fs-body)", color: "var(--text-3)", flexShrink: 0 }}>{formatTime(msg.createdAt)}</span>
|
||||
</div>
|
||||
<div style={{ fontSize: 14, color: "var(--text-2)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", lineHeight: 1.4 }}>{preview}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-2)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", lineHeight: 1.4 }}>{preview}</div>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
{recent.length === 0 && <div style={{ fontSize: 14, color: "var(--text-3)" }}>{t("No messages yet")}</div>}
|
||||
{recent.length === 0 && <div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{t("No messages yet")}</div>}
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
@@ -316,7 +313,7 @@ function TargetDate({ goal, actions }: { goal: GoalRecord; actions: PageProps["a
|
||||
};
|
||||
return (
|
||||
<span style={{ marginLeft: "auto", display: "inline-flex", alignItems: "center", gap: 6 }}>
|
||||
<input className="input" type="date" aria-label={t("Target date")} value={value} onChange={(event) => change(event.target.value)} style={{ height: 26, padding: "0 6px", fontSize: 12 }} />
|
||||
<input className="input" type="date" aria-label={t("Target date")} value={value} onChange={(event) => change(event.target.value)} style={{ height: 26, padding: "0 6px", fontSize: "var(--fs-body)" }} />
|
||||
{error && <span className="form-error" role="alert">{error}</span>}
|
||||
</span>
|
||||
);
|
||||
|
||||
@@ -30,7 +30,7 @@ export function LibraryPage({ snapshot, actions, focus }: PageProps) {
|
||||
return (
|
||||
<div className="split-main">
|
||||
<aside className="secondary-pane">
|
||||
<div style={{ fontSize: 14, fontWeight: 600, padding: "4px 8px 14px" }}>{t("Library")}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", padding: "4px 8px 14px" }}>{t("Library")}</div>
|
||||
<div className="nav" style={{ gap: 1 }}>
|
||||
{TABS.map((item) => (
|
||||
<button
|
||||
@@ -49,7 +49,6 @@ export function LibraryPage({ snapshot, actions, focus }: PageProps) {
|
||||
<div className="content">
|
||||
<div className="page">
|
||||
<h1 className="page-h1">{tab === "documents" ? t("Documents") : t("Knowledge")}</h1>
|
||||
<p className="page-sub">{t("Agents read and write these while working on tasks. Nothing here starts work; a task does.")}</p>
|
||||
{tab === "documents"
|
||||
? <DocumentsPanel focusId={focus?.kind === "document" ? focus.id : null} orgId={orgId} employeeId={employee.id} documents={documents} tasks={tasks} actions={actions} />
|
||||
: <KnowledgePanel focusId={focus?.kind === "knowledge" ? focus.id : null} orgId={orgId} employeeId={employee.id} entries={entries} scopes={scopes} actions={actions} />}
|
||||
|
||||
@@ -5,9 +5,14 @@ import { activeOrgId, requireActiveEmployee } from "./types";
|
||||
import { hashString, renderOffice, type RenderPerson } from "./office/office-renderer";
|
||||
import { OfficeSimulation, cameraFor, type MoveInput } from "./office/simulation";
|
||||
import { AgentDetailCard } from "./office/AgentDetailCard";
|
||||
import { officeActivityLabel } from "../i18n/labels";
|
||||
import { officeStateLabel } from "../i18n/labels";
|
||||
import { cardPositionFor, CARD_FALLBACK_H } from "./office/agent-card-position";
|
||||
import type { AgentActivity, Camera, OfficeAgentInput, Vec } from "./office/office-types";
|
||||
import { isoFrame, isoPixelSize, pickAt, toIso, type IsoFrame } from "./office/iso";
|
||||
import { dayPart, season } from "../shared/palette-clock";
|
||||
import { pixelScale } from "../shared/pixel-scale";
|
||||
import type { Camera, OfficeAgentInput } from "./office/office-types";
|
||||
import { officeStatus } from "./office/agent-state";
|
||||
import { ceoIdOf, officeRoster } from "./office/roster";
|
||||
import { t } from "../i18n/i18n";
|
||||
|
||||
const FPS_INTERVAL = 1000 / 24;
|
||||
@@ -29,6 +34,8 @@ export function OfficePage({ snapshot }: PageProps) {
|
||||
const canvasRef = useRef<HTMLCanvasElement>(null);
|
||||
const keysRef = useRef<MoveInput>({ up: false, down: false, left: false, right: false });
|
||||
const cameraRef = useRef<Camera>({ x: 0, y: 0 });
|
||||
/** How the last frame mapped plan to screen, for turning clicks into picks. */
|
||||
const viewRef = useRef<{ frame: IsoFrame; pixel: number } | null>(null);
|
||||
const selectedIdRef = useRef<string | null>(null);
|
||||
const cardBoxRef = useRef<HTMLDivElement>(null);
|
||||
const [selectedId, setSelectedId] = useState<string | null>(null);
|
||||
@@ -36,10 +43,9 @@ export function OfficePage({ snapshot }: PageProps) {
|
||||
if (simRef.current === null) simRef.current = new OfficeSimulation();
|
||||
|
||||
const inputs = useMemo<OfficeAgentInput[]>(() => {
|
||||
const orgAgents = snapshot.agents
|
||||
.filter((agent) => agent.orgId === orgId && agent.lifecycle === "active")
|
||||
.sort((a, b) => a.createdAt.localeCompare(b.createdAt) || a.id.localeCompare(b.id));
|
||||
const orgTasks = snapshot.tasks.filter((task) => task.orgId === orgId && isBusinessTask(task));
|
||||
const orgAgents = officeRoster(snapshot.agents.filter((agent) => agent.orgId === orgId));
|
||||
const allTasks = snapshot.tasks.filter((task) => task.orgId === orgId);
|
||||
const orgTasks = allTasks.filter(isBusinessTask);
|
||||
return orgAgents.map((agent) => ({
|
||||
id: agent.id,
|
||||
name: agent.name,
|
||||
@@ -47,10 +53,10 @@ export function OfficePage({ snapshot }: PageProps) {
|
||||
title: agent.title,
|
||||
department: agent.department,
|
||||
roleLevel: agent.roleLevel,
|
||||
activity: resolveActivity(snapshot.chatPresence, snapshot.taskRuns, agent.id),
|
||||
status: officeStatus(agent.id, { runs: snapshot.taskRuns, tasks: allTasks, approvals: snapshot.approvals }),
|
||||
taskTitle: orgTasks.find((task) => task.assigneeAgentId === agent.id && task.status === "in_progress")?.title ?? null,
|
||||
}));
|
||||
}, [snapshot.agents, snapshot.tasks, snapshot.chatPresence, snapshot.taskRuns, orgId]);
|
||||
}, [snapshot.agents, snapshot.tasks, snapshot.approvals, snapshot.taskRuns, orgId]);
|
||||
|
||||
useEffect(() => {
|
||||
simRef.current!.sync(inputs);
|
||||
@@ -112,6 +118,7 @@ export function OfficePage({ snapshot }: PageProps) {
|
||||
let running = true;
|
||||
let raf = 0;
|
||||
let lastFrame = 0;
|
||||
const scene = document.createElement("canvas");
|
||||
|
||||
const tick = (now: number) => {
|
||||
if (!running) return;
|
||||
@@ -134,13 +141,16 @@ export function OfficePage({ snapshot }: PageProps) {
|
||||
|
||||
const sim = simRef.current!;
|
||||
sim.step(elapsed, keysRef.current);
|
||||
const focus = sim.player ? { x: sim.player.x, y: sim.player.y } : { x: sim.plan.world.w / 2, y: viewH / 2 };
|
||||
const camera = cameraFor(sim.plan.world, viewW, viewH, focus);
|
||||
const frame = isoFrame(sim.plan.world);
|
||||
const pixel = isoPixelSize(dpr);
|
||||
const focus = sim.player ? { x: sim.player.x, y: sim.player.y } : { x: sim.plan.world.w / 2, y: sim.plan.world.h / 2 };
|
||||
const camera = cameraFor(frame.size, viewW / pixel, viewH / pixel, toIso(frame, focus));
|
||||
cameraRef.current = camera;
|
||||
viewRef.current = { frame, pixel };
|
||||
const people: RenderPerson[] = sim.agents.map((agent) => ({
|
||||
id: agent.input.id,
|
||||
name: agent.input.name,
|
||||
activity: agent.input.activity,
|
||||
state: agent.input.status.state,
|
||||
x: agent.x,
|
||||
y: agent.y,
|
||||
desk: agent.isCeo ? sim.plan.ceoDesk : sim.plan.desks[agent.deskIndex!].bounds,
|
||||
@@ -156,7 +166,7 @@ export function OfficePage({ snapshot }: PageProps) {
|
||||
people.push({
|
||||
id: `board:${sim.player.employeeId}`,
|
||||
name: sim.player.name,
|
||||
activity: "idle",
|
||||
state: "idle",
|
||||
x: sim.player.x,
|
||||
y: sim.player.y,
|
||||
desk: null,
|
||||
@@ -169,7 +179,22 @@ export function OfficePage({ snapshot }: PageProps) {
|
||||
carrying: null,
|
||||
});
|
||||
}
|
||||
renderOffice(ctx, viewW, viewH, sim.plan, camera, people, now, new Date(), selectedIdRef.current);
|
||||
const clock = new Date();
|
||||
renderOffice(ctx, scene, {
|
||||
frame,
|
||||
plan: sim.plan,
|
||||
camera,
|
||||
pixel,
|
||||
fontScale: pixelScale(dpr),
|
||||
viewW,
|
||||
viewH,
|
||||
people,
|
||||
timeMs: now,
|
||||
clock,
|
||||
dayPart: dayPart(clock),
|
||||
season: season(clock),
|
||||
selectedId: selectedIdRef.current,
|
||||
});
|
||||
|
||||
// The detail card rides beside its agent, even while they walk.
|
||||
const cardBox = cardBoxRef.current;
|
||||
@@ -178,7 +203,8 @@ export function OfficePage({ snapshot }: PageProps) {
|
||||
: null;
|
||||
if (cardBox && selected) {
|
||||
const cardH = cardBox.offsetHeight || CARD_FALLBACK_H;
|
||||
const position = cardPositionFor({ x: selected.x, y: selected.y }, camera, viewW, viewH, cardH);
|
||||
const feet = toIso(frame, selected);
|
||||
const position = cardPositionFor({ x: (feet.x - camera.x) * pixel, y: (feet.y - camera.y) * pixel }, { x: 0, y: 0 }, viewW, viewH, cardH);
|
||||
cardBox.style.transform = `translate(${position.left}px, ${position.top}px)`;
|
||||
cardBox.style.visibility = "visible";
|
||||
}
|
||||
@@ -191,28 +217,26 @@ export function OfficePage({ snapshot }: PageProps) {
|
||||
};
|
||||
}, []);
|
||||
|
||||
const worldPointFrom = (event: MouseEvent<HTMLCanvasElement>): Vec | null => {
|
||||
/** The agent drawn under the pointer, picked in the same iso pixels the frame was drawn in. */
|
||||
const agentAt = (event: MouseEvent<HTMLCanvasElement>) => {
|
||||
const canvas = canvasRef.current;
|
||||
if (!canvas) return null;
|
||||
const view = viewRef.current;
|
||||
if (!canvas || !view) return null;
|
||||
const bounds = canvas.getBoundingClientRect();
|
||||
return {
|
||||
x: event.clientX - bounds.left + cameraRef.current.x,
|
||||
y: event.clientY - bounds.top + cameraRef.current.y,
|
||||
const point = {
|
||||
x: (event.clientX - bounds.left) / view.pixel + Math.round(cameraRef.current.x),
|
||||
y: (event.clientY - bounds.top) / view.pixel + Math.round(cameraRef.current.y),
|
||||
};
|
||||
return pickAt(view.frame, simRef.current!.agents, point);
|
||||
};
|
||||
|
||||
const onCanvasClick = (event: MouseEvent<HTMLCanvasElement>) => {
|
||||
const point = worldPointFrom(event);
|
||||
if (!point) return;
|
||||
const hit = simRef.current!.hitTest(point);
|
||||
const hit = agentAt(event);
|
||||
setSelectedId(hit ? hit.input.id : null);
|
||||
};
|
||||
|
||||
const onCanvasMouseMove = (event: MouseEvent<HTMLCanvasElement>) => {
|
||||
const canvas = canvasRef.current;
|
||||
const point = worldPointFrom(event);
|
||||
if (!canvas || !point) return;
|
||||
canvas.style.cursor = simRef.current!.hitTest(point) ? "pointer" : "default";
|
||||
event.currentTarget.style.cursor = agentAt(event) ? "pointer" : "default";
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -227,7 +251,7 @@ export function OfficePage({ snapshot }: PageProps) {
|
||||
/>
|
||||
{selectedAgent && (
|
||||
<div ref={cardBoxRef} style={{ position: "absolute", left: 0, top: 0, willChange: "transform", visibility: "hidden" }}>
|
||||
<AgentDetailCard agent={selectedAgent} onClose={() => setSelectedId(null)} />
|
||||
<AgentDetailCard agent={selectedAgent} isCeo={selectedAgent.id === ceoIdOf(inputs)} onClose={() => setSelectedId(null)} />
|
||||
</div>
|
||||
)}
|
||||
<div className="office-toolbar" role="toolbar" aria-label={t("Office tools")}>
|
||||
@@ -236,26 +260,12 @@ export function OfficePage({ snapshot }: PageProps) {
|
||||
aria-label={t("Show a person")}
|
||||
value={selectedId ?? ""}
|
||||
onChange={(event) => setSelectedId(event.target.value || null)}
|
||||
style={{ width: 200, height: 30 }}
|
||||
style={{ width: 200 }}
|
||||
>
|
||||
<option value="">{t("Show a person…")}</option>
|
||||
{inputs.map((input) => <option key={input.id} value={input.id}>{t("{name}, {activity}", { name: input.name, activity: officeActivityLabel(input.activity) })}</option>)}
|
||||
{inputs.map((input) => <option key={input.id} value={input.id}>{t("{name}, {activity}", { name: input.name, activity: officeStateLabel(input.status.state) })}</option>)}
|
||||
</select>
|
||||
<span className="office-legend">{t("Agents with work stay at their desks. Only idle agents walk to coffee, snacks or the meeting table.")}</span>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function resolveActivity(
|
||||
presence: Array<{ principalType: string; principalId: string; status: string }>,
|
||||
runs: Array<{ agentId: string | null; state: string }>,
|
||||
agentId: string,
|
||||
): AgentActivity {
|
||||
if (runs.some((run) => run.agentId === agentId && run.state === "running")) return "active";
|
||||
const record = presence.find((row) => row.principalType === "agent" && row.principalId === agentId);
|
||||
if (record?.status === "thinking") return "thinking";
|
||||
if (record?.status === "waiting_approval" || record?.status === "busy") return "busy";
|
||||
if (record?.status === "active" || record?.status === "online") return "active";
|
||||
return "idle";
|
||||
}
|
||||
@@ -90,8 +90,8 @@ export function RunsPage({ snapshot, actions, navigate, focus }: PageProps) {
|
||||
<div className="split-main">
|
||||
<aside className="secondary-pane" style={{ width: 340 }}>
|
||||
<div style={{ padding: "12px 12px 8px" }}>
|
||||
<div style={{ fontSize: 14, fontWeight: 600, marginBottom: 8 }}>{t("Runs")}</div>
|
||||
<div className="row" style={{ gap: 8, marginBottom: 8, fontSize: 12, color: "var(--text-3)" }}>
|
||||
<div style={{ fontSize: "var(--fs-body)", marginBottom: 8 }}>{t("Runs")}</div>
|
||||
<div className="row" style={{ gap: 8, marginBottom: 8, fontSize: "var(--fs-body)", color: "var(--text-3)" }}>
|
||||
<span>{t("{n} queued", { n: queued })}</span><span>·</span><span>{t("{n} running", { n: running })}</span><span>·</span><span>{t("{n} failed", { n: failed })}</span>
|
||||
</div>
|
||||
<input
|
||||
@@ -118,10 +118,10 @@ export function RunsPage({ snapshot, actions, navigate, focus }: PageProps) {
|
||||
onClick={() => setSelectedId(run.id)}
|
||||
>
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ fontSize: 14, fontWeight: 500, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
<div style={{ fontSize: "var(--fs-body)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
{task?.title ?? run.taskId}
|
||||
</div>
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
{agent?.name ?? t("Agent")} · {runTriggerLabel(run.trigger)}
|
||||
</div>
|
||||
</div>
|
||||
@@ -129,11 +129,11 @@ export function RunsPage({ snapshot, actions, navigate, focus }: PageProps) {
|
||||
</button>
|
||||
);
|
||||
})}
|
||||
{filtered.length === 0 && <div style={{ padding: 16, fontSize: 14, color: "var(--text-3)" }}>{t("No runs")}</div>}
|
||||
{filtered.length === 0 && <div style={{ padding: 16, fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{t("No runs")}</div>}
|
||||
{historyError && <div className="form-error" role="alert" style={{ padding: "0 16px" }}>{historyError}</div>}
|
||||
<div style={{ padding: 12, display: "flex", justifyContent: "center" }}>
|
||||
{olderDone
|
||||
? <span style={{ fontSize: 12, color: "var(--text-3)" }}>{t("These are all the runs.")}</span>
|
||||
? <span style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{t("These are all the runs.")}</span>
|
||||
: <Button size="small" onClick={loadOlder}>{t("Show older runs")}</Button>}
|
||||
</div>
|
||||
</div>
|
||||
@@ -142,7 +142,7 @@ export function RunsPage({ snapshot, actions, navigate, focus }: PageProps) {
|
||||
{selected ? (
|
||||
<RunDetail key={selected.id} run={selected} tasks={tasks} agents={agents} providers={providers} actions={actions} onOpenTask={(taskId) => navigate("work", { kind: "task", id: taskId })} />
|
||||
) : (
|
||||
<div style={{ display: "grid", placeItems: "center", height: "100%", color: "var(--text-3)", fontSize: 14 }}>
|
||||
<div style={{ display: "grid", placeItems: "center", height: "100%", color: "var(--text-3)", fontSize: "var(--fs-body)" }}>
|
||||
{t("Select a run")}
|
||||
</div>
|
||||
)}
|
||||
@@ -190,10 +190,10 @@ function RunDetail({ run, tasks, agents, providers, actions, onOpenTask }: {
|
||||
<div className="row" style={{ gap: 10, marginBottom: 16 }}>
|
||||
{agent && <Avatar name={agent.name} size="sm" bot />}
|
||||
<div>
|
||||
<button type="button" className="link-button" style={{ fontSize: 16, fontWeight: 600 }} aria-label={t("Open task {title}", { title: task?.title ?? run.taskId })} onClick={() => onOpenTask(run.taskId)}>
|
||||
<button type="button" className="link-button" style={{ fontSize: "var(--fs-body)" }} aria-label={t("Open task {title}", { title: task?.title ?? run.taskId })} onClick={() => onOpenTask(run.taskId)}>
|
||||
{task?.title ?? run.taskId}
|
||||
</button>
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)" }}>{run.id}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{run.id}</div>
|
||||
</div>
|
||||
<Pill tone={runTone(run.state)}>{runLabel(run.state)}</Pill>
|
||||
{run.state === "running" && <Button size="small" onClick={stop} disabled={busy}>{t("Stop")}</Button>}
|
||||
@@ -201,13 +201,13 @@ function RunDetail({ run, tasks, agents, providers, actions, onOpenTask }: {
|
||||
{run.state === "failed" && <Button size="small" onClick={again} disabled={busy}>{busy ? t("Running…") : t("Retry")}</Button>}
|
||||
{(run.state === "stopped" || run.state === "superseded") && <Button size="small" onClick={again} disabled={busy}>{busy ? t("Running…") : t("Resume")}</Button>}
|
||||
</div>
|
||||
{run.state === "queued" && <div style={{ fontSize: 12, color: "var(--text-3)", marginBottom: 8 }}>{t("A cancelled session can start again on the next heartbeat; block the task to keep it stopped.")}</div>}
|
||||
{run.state === "queued" && <div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", marginBottom: 8 }}>{t("A cancelled session can start again on the next heartbeat; block the task to keep it stopped.")}</div>}
|
||||
{(run.state === "failed" || run.state === "stopped" || run.state === "superseded") && (
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)", marginBottom: 8 }}>{t("A new session on the task picks up from what earlier sessions did and where they stopped.")}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", marginBottom: 8 }}>{t("A new session on the task picks up from what earlier sessions did and where they stopped.")}</div>
|
||||
)}
|
||||
{controlError && <div className="form-error" role="alert">{controlError}</div>}
|
||||
|
||||
<div style={{ display: "grid", gridTemplateColumns: "120px 1fr", gap: "8px 16px", fontSize: 14, marginBottom: 20 }}>
|
||||
<div style={{ display: "grid", gridTemplateColumns: "120px 1fr", gap: "8px 16px", fontSize: "var(--fs-body)", marginBottom: 20 }}>
|
||||
<MetaLabel>{t("Agent")}</MetaLabel><div>{agent?.name ?? "—"} ({agent?.role ?? "—"})</div>
|
||||
<MetaLabel>{t("Provider")}</MetaLabel><div>{provider?.label ?? "—"}</div>
|
||||
<MetaLabel>{t("Model")}</MetaLabel><div>{run.runModel ?? t("Chosen when the session starts")}</div>
|
||||
@@ -216,7 +216,7 @@ function RunDetail({ run, tasks, agents, providers, actions, onOpenTask }: {
|
||||
{run.startedAt && (<><MetaLabel>{t("Started")}</MetaLabel><div>{formatRelative(run.startedAt)}</div></>)}
|
||||
{run.completedAt && (<><MetaLabel>{t("Completed")}</MetaLabel><div>{formatRelative(run.completedAt)}</div></>)}
|
||||
{durationMs !== null && (<><MetaLabel>{t("Duration")}</MetaLabel><div>{formatDuration(durationMs)}</div></>)}
|
||||
<MetaLabel>{t("Context")}</MetaLabel><div className="mono" style={{ fontSize: 12, overflow: "hidden", textOverflow: "ellipsis" }}>{run.executionContextId}</div>
|
||||
<MetaLabel>{t("Context")}</MetaLabel><div className="mono" style={{ fontSize: "var(--fs-body)", overflow: "hidden", textOverflow: "ellipsis" }}>{run.executionContextId}</div>
|
||||
</div>
|
||||
|
||||
<RunRequestList loaded={loadedRequests} />
|
||||
@@ -224,28 +224,28 @@ function RunDetail({ run, tasks, agents, providers, actions, onOpenTask }: {
|
||||
{run.state === "superseded" && run.errorMessage && (
|
||||
<div className="card" style={{ padding: 16, marginBottom: 16 }}>
|
||||
<div className="section-label" style={{ marginBottom: 8 }}>{t("Why it did not run")}</div>
|
||||
<div style={{ fontSize: 14, color: "var(--text-1)", whiteSpace: "pre-wrap", lineHeight: 1.5 }}>{run.errorMessage}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-1)", whiteSpace: "pre-wrap", lineHeight: 1.5 }}>{run.errorMessage}</div>
|
||||
</div>
|
||||
)}
|
||||
{run.state === "failed" && run.errorMessage && (
|
||||
<div className="card" style={{ padding: 16, marginBottom: 16, borderColor: "var(--red)" }}>
|
||||
<div className="section-label" style={{ color: "var(--red)", marginBottom: 8 }}>{t("Error")}</div>
|
||||
<div style={{ fontSize: 14, color: "var(--text-1)", whiteSpace: "pre-wrap", lineHeight: 1.5 }}>{run.errorMessage}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-1)", whiteSpace: "pre-wrap", lineHeight: 1.5 }}>{run.errorMessage}</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{run.capabilityWarnings && (
|
||||
<div className="card" style={{ padding: 16, marginBottom: 16, borderColor: "var(--amber)" }}>
|
||||
<div className="section-label" style={{ color: "var(--amber)", marginBottom: 8 }}>{t("Missing this run")}</div>
|
||||
<div style={{ fontSize: 14, color: "var(--text-1)", whiteSpace: "pre-wrap", lineHeight: 1.5 }}>{run.capabilityWarnings}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-1)", whiteSpace: "pre-wrap", lineHeight: 1.5 }}>{run.capabilityWarnings}</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{request && (
|
||||
<div className="card" style={{ padding: 16, marginBottom: 16 }}>
|
||||
<div className="section-label" style={{ marginBottom: 8 }}>{t("Provider request")}</div>
|
||||
<div style={{ display: "grid", gridTemplateColumns: "120px 1fr", gap: "8px 16px", fontSize: 14 }}>
|
||||
<MetaLabel>{t("Request ID")}</MetaLabel><div className="mono" style={{ fontSize: 12, overflow: "hidden", textOverflow: "ellipsis" }}>{request.id}</div>
|
||||
<div style={{ display: "grid", gridTemplateColumns: "120px 1fr", gap: "8px 16px", fontSize: "var(--fs-body)" }}>
|
||||
<MetaLabel>{t("Request ID")}</MetaLabel><div className="mono" style={{ fontSize: "var(--fs-body)", overflow: "hidden", textOverflow: "ellipsis" }}>{request.id}</div>
|
||||
<MetaLabel>{t("Model")}</MetaLabel><div>{request.model}</div>
|
||||
<MetaLabel>{t("State")}</MetaLabel><div>{requestStateLabel(request.state)}</div>
|
||||
<MetaLabel>{t("Input chars")}</MetaLabel><div className="num">{request.inputCharCount.toLocaleString()}</div>
|
||||
@@ -257,7 +257,7 @@ function RunDetail({ run, tasks, agents, providers, actions, onOpenTask }: {
|
||||
<div style={{ marginTop: 12 }}>
|
||||
<div className="section-label" style={{ marginBottom: 6 }}>{t("Response")}</div>
|
||||
<div style={{
|
||||
fontSize: 12,
|
||||
fontSize: "var(--fs-body)",
|
||||
color: "var(--text-2)",
|
||||
whiteSpace: "pre-wrap",
|
||||
lineHeight: 1.5,
|
||||
@@ -265,7 +265,6 @@ function RunDetail({ run, tasks, agents, providers, actions, onOpenTask }: {
|
||||
overflow: "auto",
|
||||
padding: 10,
|
||||
background: "var(--panel-3)",
|
||||
borderRadius: 8,
|
||||
fontFamily: "var(--font-mono)",
|
||||
}}>
|
||||
{request.responseText}
|
||||
|
||||
@@ -46,7 +46,7 @@ export function SettingsPage({ snapshot, actions, focus }: PageProps) {
|
||||
return (
|
||||
<div className="split-main">
|
||||
<aside className="secondary-pane">
|
||||
<div style={{ fontSize: 14, fontWeight: 600, padding: "4px 8px 14px" }}>{t("Settings")}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", padding: "4px 8px 14px" }}>{t("Settings")}</div>
|
||||
<div className="pane-scroll">
|
||||
<NavGroup items={TABS} active={tab} onChange={(next) => requestLeave(() => setTab(next))} />
|
||||
</div>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { XpBar } from "../shared/XpBar";
|
||||
import { useRevealObject } from "../shared/reveal";
|
||||
import { oneOf, usePersistentState } from "../shared/view-state";
|
||||
import { agentModel } from "../../../shared/agent-model";
|
||||
@@ -105,9 +106,9 @@ export function TeamPage({ snapshot, actions, focus }: PageProps) {
|
||||
<div className="page">
|
||||
<TopbarActions>
|
||||
<Button tone="ghost" onClick={() => cycleFilter(filter, setFilter)} title={t("Filter")}>
|
||||
<Icon name="filter" size={16} /> {filterLabel(filter)}
|
||||
<Icon name="filter" /> {filterLabel(filter)}
|
||||
</Button>
|
||||
<Button tone="primary" onClick={openHireDialog}><Icon name="plus" size={16} /> {t("Hire")}</Button>
|
||||
<Button tone="primary" onClick={openHireDialog}><Icon name="plus" /> {t("Hire")}</Button>
|
||||
</TopbarActions>
|
||||
<h1 className="page-h1">{t("Team")}</h1>
|
||||
<p className="page-sub">
|
||||
@@ -154,7 +155,7 @@ export function TeamPage({ snapshot, actions, focus }: PageProps) {
|
||||
<input className="input" name="modelId" list="hire-model-suggestions" value={hireModelId} disabled={!hireProviderId} placeholder={providers.find((provider) => provider.id === hireProviderId)?.model ?? ""} onChange={(event) => setHireModelId(event.currentTarget.value)} />
|
||||
</Field>
|
||||
<ModelSuggestions id="hire-model-suggestions" providerId={hireProviderId} providers={providers} catalog={snapshot.providerCatalog} />
|
||||
<p style={{ fontSize: 12, color: "var(--text-3)", margin: 0 }}>{t("Leave the model blank to use the provider's default. A changed model applies from the agent's next session.")}</p>
|
||||
<p style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", margin: 0 }}>{t("Leave the model blank to use the provider's default. A changed model applies from the agent's next session.")}</p>
|
||||
<Field label={t("Manager")}>
|
||||
<select className="input" name="managerAgentId" defaultValue="">
|
||||
<option value="">{t("None")}</option>
|
||||
@@ -180,13 +181,13 @@ export function TeamPage({ snapshot, actions, focus }: PageProps) {
|
||||
<Field label={t("Department")}><input className="input" name="department" defaultValue={editingAgent.department} required /></Field>
|
||||
<Field label={t("Monthly budget")}><input className="input" name="budget" type="number" min="0" step="1" defaultValue={editingAgent.budgetCents / 100} /></Field>
|
||||
<EditModelFields agent={editingAgent} providers={providers} catalog={snapshot.providerCatalog} />
|
||||
<p style={{ fontSize: 12, color: "var(--text-3)", margin: 0 }}>{t("Leave the model blank to use the provider's default. A changed model applies from the agent's next session.")}</p>
|
||||
<p style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", margin: 0 }}>{t("Leave the model blank to use the provider's default. A changed model applies from the agent's next session.")}</p>
|
||||
<Field label={t("Seniority")}>
|
||||
{/* The CEO's rank carries company-wide powers, so it is shown, never picked. */}
|
||||
{editingAgent.roleLevel === "c_suite" ? (
|
||||
<>
|
||||
<input type="hidden" name="roleLevel" value="c_suite" />
|
||||
<div style={{ fontSize: 13, color: "var(--text-2)" }}>{t("CEO: hires officers, grants connectors and skills, and closes goals. This rank cannot be changed.")}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-2)" }}>{t("CEO: hires officers, grants connectors and skills, and closes goals. This rank cannot be changed.")}</div>
|
||||
</>
|
||||
) : (
|
||||
<select className="input" name="roleLevel" defaultValue={editingAgent.roleLevel}>
|
||||
@@ -300,8 +301,8 @@ function RosterRow({ row, last, onEdit }: { row: RosterEntry; last: boolean; onE
|
||||
<div className="row" style={{ gap: 10, minWidth: 0 }}>
|
||||
<Avatar name={row.name} size="sm" bot={!row.human} />
|
||||
<div style={{ minWidth: 0 }}>
|
||||
<div style={{ fontWeight: 500, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{row.name}</div>
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{row.role}</div>
|
||||
<div style={{ overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{row.name}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{row.role}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ color: "var(--text-2)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{row.dept}</div>
|
||||
@@ -309,7 +310,7 @@ function RosterRow({ row, last, onEdit }: { row: RosterEntry; last: boolean; onE
|
||||
style={{
|
||||
color: "var(--text-2)",
|
||||
fontFamily: row.human ? "inherit" : "var(--font-mono)",
|
||||
fontSize: row.human ? 13 : 12,
|
||||
fontSize: "var(--fs-body)",
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis",
|
||||
whiteSpace: "nowrap",
|
||||
@@ -322,16 +323,10 @@ function RosterRow({ row, last, onEdit }: { row: RosterEntry; last: boolean; onE
|
||||
<span style={{ color: "var(--text-4)" }}>—</span>
|
||||
) : (
|
||||
<div className="row" style={{ gap: 8 }}>
|
||||
<div style={{ flex: 1, height: 3, background: "var(--panel-3)", borderRadius: 2, overflow: "hidden", maxWidth: 100 }}>
|
||||
<div
|
||||
style={{
|
||||
width: `${row.budgetCapCents && row.budgetCapCents > 0 ? Math.min(100, Math.round((row.budgetCents / row.budgetCapCents) * 100)) : 0}%`,
|
||||
height: "100%",
|
||||
background: "var(--text-2)",
|
||||
}}
|
||||
/>
|
||||
<div style={{ flex: 1, maxWidth: 100 }}>
|
||||
<XpBar percent={row.budgetCapCents && row.budgetCapCents > 0 ? (row.budgetCents / row.budgetCapCents) * 100 : 0} label={t("Budget compared with the largest agent budget")} />
|
||||
</div>
|
||||
<span className="num mono" style={{ fontSize: 12, color: "var(--text-3)" }}>{money(row.budgetCents)}</span>
|
||||
<span className="num mono" style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{money(row.budgetCents)}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -108,12 +108,11 @@ export function WorkPage({ snapshot, actions, navigate, focus }: PageProps) {
|
||||
onPriority={setPriorityFilter}
|
||||
onAssignee={setAssigneeFilter}
|
||||
/>
|
||||
<Button tone="ghost" onClick={() => setNewGoalOpen(true)}><Icon name="plus" size={16} /> {t("Goal")}</Button>
|
||||
<Button tone="ghost" onClick={() => setNewProjectOpen(true)}><Icon name="plus" size={16} /> {t("Project")}</Button>
|
||||
<Button tone="primary" onClick={() => setNewTaskOpen(true)}><Icon name="plus" size={16} /> {t("New task")}</Button>
|
||||
<Button tone="ghost" onClick={() => setNewGoalOpen(true)}><Icon name="plus" /> {t("Goal")}</Button>
|
||||
<Button tone="ghost" onClick={() => setNewProjectOpen(true)}><Icon name="plus" /> {t("Project")}</Button>
|
||||
<Button tone="primary" onClick={() => setNewTaskOpen(true)}><Icon name="plus" /> {t("New task")}</Button>
|
||||
</TopbarActions>
|
||||
<h1 className="page-h1">{t("Work")}</h1>
|
||||
<p className="page-sub">{t("Only a task runs: an agent picks it up and does the work. Goals and projects group tasks; documents and knowledge are what agents read and write along the way.")}</p>
|
||||
{scope && (
|
||||
<div className="row" style={{ gap: 8, marginBottom: 8 }}>
|
||||
<Pill>
|
||||
@@ -121,7 +120,7 @@ export function WorkPage({ snapshot, actions, navigate, focus }: PageProps) {
|
||||
? t("Goal: {title}", { title: goals.find((goal) => goal.id === scope.id)?.title ?? scope.id })
|
||||
: t("Project: {name}", { name: projects.find((project) => project.id === scope.id)?.name ?? scope.id })}
|
||||
</Pill>
|
||||
<button type="button" className="link-button" style={{ fontSize: 12 }} onClick={() => setScope(null)}>{t("Show all work")}</button>
|
||||
<button type="button" className="link-button" style={{ fontSize: "var(--fs-body)" }} onClick={() => setScope(null)}>{t("Show all work")}</button>
|
||||
</div>
|
||||
)}
|
||||
<p className="page-sub">
|
||||
@@ -227,7 +226,7 @@ function WorkFilter({
|
||||
<Popover
|
||||
trigger={({ toggle }) => (
|
||||
<button type="button" className="button ghost" aria-label={t("Filter tasks")} onClick={toggle}>
|
||||
<Icon name="filter" size={16} color={active ? "var(--accent)" : "currentColor"} />
|
||||
<Icon name="filter" color={active ? "var(--accent)" : "currentColor"} />
|
||||
</button>
|
||||
)}
|
||||
>
|
||||
@@ -237,19 +236,19 @@ function WorkFilter({
|
||||
{priorities.map((option) => (
|
||||
<MenuRow key={option.id} active={priority === option.id} onClick={() => onPriority(option.id)}>
|
||||
{option.label}
|
||||
{priority === option.id && <span className="menu-check"><Icon name="check" size={16} /></span>}
|
||||
{priority === option.id && <span className="menu-check"><Icon name="check" /></span>}
|
||||
</MenuRow>
|
||||
))}
|
||||
<MenuDivider />
|
||||
<MenuLabel>{t("Assignee")}</MenuLabel>
|
||||
<MenuRow active={assignee === "all"} onClick={() => onAssignee("all")}>
|
||||
{t("All assignees")}
|
||||
{assignee === "all" && <span className="menu-check"><Icon name="check" size={16} /></span>}
|
||||
{assignee === "all" && <span className="menu-check"><Icon name="check" /></span>}
|
||||
</MenuRow>
|
||||
{agents.map((agent) => (
|
||||
<MenuRow key={agent.id} active={assignee === agent.id} onClick={() => onAssignee(agent.id)}>
|
||||
{agent.name}
|
||||
{assignee === agent.id && <span className="menu-check"><Icon name="check" size={16} /></span>}
|
||||
{assignee === agent.id && <span className="menu-check"><Icon name="check" /></span>}
|
||||
</MenuRow>
|
||||
))}
|
||||
</>
|
||||
@@ -286,9 +285,9 @@ function BoardView({
|
||||
return (
|
||||
<div key={column.id} style={{ display: "flex", flexDirection: "column", minWidth: 0, minHeight: 0 }}>
|
||||
<div className="row" style={{ padding: "4px 6px 8px", flexShrink: 0 }}>
|
||||
<span style={{ width: 8, height: 8, borderRadius: 2, background: column.tone, flexShrink: 0 }} />
|
||||
<span style={{ fontSize: 12, fontWeight: 540 }}>{column.label}</span>
|
||||
<span className="num" style={{ fontSize: 12, color: "var(--text-3)" }}>{columnTasks.length}</span>
|
||||
<span style={{ width: 8, height: 8, background: column.tone, flexShrink: 0 }} />
|
||||
<span style={{ fontSize: "var(--fs-body)" }}>{column.label}</span>
|
||||
<span className="num" style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{columnTasks.length}</span>
|
||||
<IconButton icon="plus" label={t("Add task")} onClick={onCreate} />
|
||||
</div>
|
||||
<div style={{ flex: 1, minHeight: 0, overflowY: "auto", display: "flex", flexDirection: "column", gap: 8, paddingBottom: 24 }}>
|
||||
@@ -341,7 +340,6 @@ function TaskCard({
|
||||
style={{
|
||||
background: "var(--panel)",
|
||||
border: "1px solid var(--border)",
|
||||
borderRadius: 10,
|
||||
padding: 12,
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
@@ -351,15 +349,13 @@ function TaskCard({
|
||||
}}
|
||||
>
|
||||
<div style={{ display: "flex", alignItems: "flex-start", gap: 6 }}>
|
||||
{task.priority === "high" && <span style={{ width: 3, height: 14, background: "var(--red)", borderRadius: 2, marginTop: 2, flexShrink: 0 }} />}
|
||||
{task.priority === "high" && <span style={{ width: 3, height: 14, background: "var(--red)", marginTop: 2, flexShrink: 0 }} />}
|
||||
<div
|
||||
style={{
|
||||
flex: 1,
|
||||
minWidth: 0,
|
||||
fontSize: 14,
|
||||
fontWeight: 480,
|
||||
fontSize: "var(--fs-body)",
|
||||
lineHeight: 1.35,
|
||||
letterSpacing: "-0.005em",
|
||||
color: task.status === "done" ? "var(--text-3)" : "var(--text-1)",
|
||||
display: "-webkit-box",
|
||||
WebkitLineClamp: 3,
|
||||
|
||||
@@ -45,14 +45,14 @@ export function ApprovalDetailDialog({
|
||||
<IconButton icon="x" label={t("Close")} onClick={onClose} />
|
||||
</div>
|
||||
<div className="row" style={{ flexWrap: "wrap", gap: 6, marginBottom: 14 }}>
|
||||
<span style={{ fontSize: 12, color: tone.color, fontWeight: 540, letterSpacing: "0.02em" }}>{tone.label}</span>
|
||||
<span style={{ fontSize: "var(--fs-body)", color: tone.color }}>{tone.label}</span>
|
||||
<span style={{ color: "var(--text-4)" }}>·</span>
|
||||
<Pill>{approvalKindLabel(approval.kind)}</Pill>
|
||||
</div>
|
||||
<p style={{ margin: "0 0 16px", color: "var(--text-2)", fontSize: 14, lineHeight: 1.55, whiteSpace: "pre-wrap" }}>
|
||||
<p style={{ margin: "0 0 16px", color: "var(--text-2)", fontSize: "var(--fs-body)", lineHeight: 1.55, whiteSpace: "pre-wrap" }}>
|
||||
{approval.details}
|
||||
</p>
|
||||
<div style={{ display: "grid", gridTemplateColumns: "100px 1fr", gap: "10px 14px", fontSize: 12 }}>
|
||||
<div style={{ display: "grid", gridTemplateColumns: "100px 1fr", gap: "10px 14px", fontSize: "var(--fs-body)" }}>
|
||||
<span style={{ color: "var(--text-3)" }}>{t("Requested by")}</span>
|
||||
<span>{requester}</span>
|
||||
{approval.sourceEntityType && (
|
||||
@@ -117,8 +117,8 @@ export function ApprovalRecordDialog({ approval, requester, decider, drift, onCl
|
||||
<Pill>{approvalKindLabel(approval.kind)}</Pill>
|
||||
{drift && <Pill tone="amber">{drift === "changed" ? t("Changed since approval") : t("Removed since approval")}</Pill>}
|
||||
</div>
|
||||
<p style={{ margin: "0 0 16px", color: "var(--text-2)", fontSize: 14, lineHeight: 1.55, whiteSpace: "pre-wrap" }}>{approval.details}</p>
|
||||
<div style={{ display: "grid", gridTemplateColumns: "110px 1fr", gap: "10px 14px", fontSize: 12 }}>
|
||||
<p style={{ margin: "0 0 16px", color: "var(--text-2)", fontSize: "var(--fs-body)", lineHeight: 1.55, whiteSpace: "pre-wrap" }}>{approval.details}</p>
|
||||
<div style={{ display: "grid", gridTemplateColumns: "110px 1fr", gap: "10px 14px", fontSize: "var(--fs-body)" }}>
|
||||
<span style={{ color: "var(--text-3)" }}>{t("Requested by")}</span>
|
||||
<span>{requester} · {formatRelative(approval.createdAt)}</span>
|
||||
<span style={{ color: "var(--text-3)" }}>{t("Decided by")}</span>
|
||||
|
||||
@@ -80,7 +80,7 @@ export function ChatComposer({
|
||||
|
||||
return (
|
||||
<form onSubmit={onSubmit} onInput={() => { if (spaceId && ref.current) noteTyping(spaceId, ref.current.value); }} data-space-id={spaceId ?? undefined} style={{ padding: 14, paddingTop: 4, flexShrink: 0 }}>
|
||||
<div style={{ border: "1px solid var(--border-strong)", borderRadius: 12, background: "var(--panel)", padding: "10px 12px" }}>
|
||||
<div style={{ border: "1px solid var(--border-strong)", background: "var(--panel)", padding: "10px 12px" }}>
|
||||
<MentionTextarea
|
||||
name="message"
|
||||
defaultValue={draft.body}
|
||||
@@ -97,7 +97,7 @@ export function ChatComposer({
|
||||
<IconButton icon="sparkle" label={t("Commands")} onClick={() => setSlashOpen((open) => !open)} disabled={locked} />
|
||||
{attachments.map((attachment) => (
|
||||
<span key={attachment.id} className="pill" style={{ maxWidth: 220 }}>
|
||||
<Icon name="file" size={14} />
|
||||
<Icon name="file" />
|
||||
<span style={{ overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{attachment.name}</span>
|
||||
<button
|
||||
type="button"
|
||||
@@ -106,13 +106,13 @@ export function ChatComposer({
|
||||
onClick={() => onAttachmentRemove(attachment.id)}
|
||||
style={{ display: "inline-flex", border: 0, background: "transparent", padding: 0, color: "var(--text-3)", cursor: "pointer" }}
|
||||
>
|
||||
<Icon name="x" size={14} />
|
||||
<Icon name="x" />
|
||||
</button>
|
||||
</span>
|
||||
))}
|
||||
<div style={{ marginLeft: "auto", display: "flex", alignItems: "center", gap: 6 }}>
|
||||
<span className="mono" style={{ fontSize: 12, color: "var(--text-3)" }}>{shortcutLabel("Enter")}</span>
|
||||
<Button tone="primary" size="small" type="submit" disabled={locked}><Icon name="send" size={12} /> {t("Send")}</Button>
|
||||
<span className="mono" style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{shortcutLabel("Enter")}</span>
|
||||
<Button tone="primary" size="small" type="submit" disabled={locked}><Icon name="send" /> {t("Send")}</Button>
|
||||
</div>
|
||||
</div>
|
||||
{send.error && <div className="form-error" role="alert">{t("Not sent: {reason}", { reason: send.error })}</div>}
|
||||
|
||||
@@ -239,7 +239,7 @@ export function ChatConversation({
|
||||
</div>
|
||||
{!atBottom && (
|
||||
<button type="button" className="jump-latest" onClick={() => jumpToLatest("smooth")}>
|
||||
<span aria-hidden style={{ fontSize: 13, lineHeight: 1 }}>↓</span>
|
||||
<span aria-hidden style={{ fontSize: "var(--fs-body)", lineHeight: 1 }}>↓</span>
|
||||
{t("Jump to latest")}
|
||||
</button>
|
||||
)}
|
||||
@@ -297,11 +297,11 @@ function ConversationHeader({
|
||||
};
|
||||
return (
|
||||
<header className="row" style={{ height: 52, padding: "0 24px", borderBottom: "1px solid var(--border-soft)", flexShrink: 0 }}>
|
||||
<Icon name={space.visibility === "restricted" ? "lock" : "hash"} size={15} color="var(--text-3)" />
|
||||
<span style={{ fontSize: 14, fontWeight: 600 }}>{space.name}</span>
|
||||
<Icon name={space.visibility === "restricted" ? "lock" : "hash"} color="var(--text-3)" />
|
||||
<span style={{ fontSize: "var(--fs-body)" }}>{space.name}</span>
|
||||
<span
|
||||
style={{
|
||||
fontSize: 12,
|
||||
fontSize: "var(--fs-body)",
|
||||
color: "var(--text-3)",
|
||||
borderLeft: "1px solid var(--border)",
|
||||
paddingLeft: 10,
|
||||
@@ -341,20 +341,20 @@ function MembersButton({ space, members }: { space: ChatSpaceRecord; members: Sp
|
||||
trigger={({ toggle }) => (
|
||||
<button type="button" onClick={toggle} aria-label={t("Members ({count})", { count: String(members.length) })} style={{ display: "flex", alignItems: "center", gap: 6, border: 0, background: "transparent", cursor: "pointer", padding: 0 }}>
|
||||
<AvatarStack names={members.slice(0, 5).map((member) => member.name)} />
|
||||
<span style={{ fontSize: 12, color: "var(--text-3)" }}>{members.length}</span>
|
||||
<span style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{members.length}</span>
|
||||
</button>
|
||||
)}
|
||||
>
|
||||
{() => (
|
||||
// A large roster scrolls inside the window instead of running past it.
|
||||
<div className="members-roster" style={{ padding: 12, width: 320, maxHeight: "min(480px, calc(100vh - 120px))", overflowY: "auto", display: "flex", flexDirection: "column", gap: 10 }}>
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)" }}>{spaceReaders(space)}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{spaceReaders(space)}</div>
|
||||
{members.map((member) => (
|
||||
<div key={member.id} className="row" style={{ gap: 8, alignItems: "flex-start" }}>
|
||||
<Avatar name={member.name} size="sm" bot={member.bot} />
|
||||
<div style={{ minWidth: 0 }}>
|
||||
<div style={{ fontSize: 13, fontWeight: 540 }}>{member.name}</div>
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)" }}>{member.duty}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)" }}>{member.name}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{member.duty}</div>
|
||||
</div>
|
||||
</div>
|
||||
))}
|
||||
|
||||
@@ -84,14 +84,14 @@ export function ChatMessageRow({
|
||||
<Avatar name={name} bot={bot} />
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div className="row" style={{ alignItems: "baseline", gap: 8, marginBottom: 2 }}>
|
||||
<span style={{ fontSize: 14, fontWeight: 540 }}>{name}</span>
|
||||
<span className="mono" style={{ fontSize: 12, color: "var(--text-3)" }}>{formatTime(message.createdAt)}</span>
|
||||
{message.editedAt && !deleted && <span style={{ fontSize: 12, color: "var(--text-3)" }}>{t("(edited)")}</span>}
|
||||
<span style={{ fontSize: "var(--fs-body)" }}>{name}</span>
|
||||
<span className="mono" style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{formatTime(message.createdAt)}</span>
|
||||
{message.editedAt && !deleted && <span style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{t("(edited)")}</span>}
|
||||
{!editing && (canModify || (onOpenThread && !deleted)) && (
|
||||
<span style={{ marginLeft: "auto", display: "flex", gap: 2 }}>
|
||||
{onOpenThread && !deleted && <IconButton icon="chat" label={t("Reply in thread")} size={16} onClick={onOpenThread} />}
|
||||
{canModify && <IconButton icon="edit" label={t("Edit message")} size={16} onClick={() => setEditing(true)} />}
|
||||
{canModify && <IconButton icon="x" label={t("Delete message")} size={16} onClick={onDelete} />}
|
||||
{onOpenThread && !deleted && <IconButton icon="chat" label={t("Reply in thread")} onClick={onOpenThread} />}
|
||||
{canModify && <IconButton icon="edit" label={t("Edit message")} onClick={() => setEditing(true)} />}
|
||||
{canModify && <IconButton icon="x" label={t("Delete message")} onClick={onDelete} />}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
@@ -102,7 +102,7 @@ export function ChatMessageRow({
|
||||
? t("Replying in thread: {snippet}", { snippet: thread.replyTo.snippet })
|
||||
: t("Replying to {name}: {snippet}", { name: thread.replyTo.name, snippet: thread.replyTo.snippet })}
|
||||
onClick={onOpenThread}
|
||||
style={{ display: "block", maxWidth: "100%", margin: "0 0 4px", padding: 0, border: 0, background: "transparent", color: "var(--text-3)", fontSize: 12, textAlign: "left", cursor: "pointer", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}
|
||||
style={{ display: "block", maxWidth: "100%", margin: "0 0 4px", padding: 0, border: 0, background: "transparent", color: "var(--text-3)", fontSize: "var(--fs-body)", textAlign: "left", cursor: "pointer", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}
|
||||
>
|
||||
↳ {thread.replyTo.name === null ? thread.replyTo.snippet : `${thread.replyTo.name}: ${thread.replyTo.snippet}`}
|
||||
</button>
|
||||
@@ -113,7 +113,7 @@ export function ChatMessageRow({
|
||||
</div>
|
||||
)}
|
||||
{deleted ? (
|
||||
<div style={{ fontSize: 14, color: "var(--text-3)", fontStyle: "italic" }}>{t("Message deleted")}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", fontStyle: "italic" }}>{t("Message deleted")}</div>
|
||||
) : editing ? (
|
||||
<form onSubmit={submitEdit} onInput={() => setChanged(true)}>
|
||||
<textarea
|
||||
@@ -132,7 +132,7 @@ export function ChatMessageRow({
|
||||
</div>
|
||||
</form>
|
||||
) : (
|
||||
<div style={{ fontSize: 14, color: "var(--text-1)", lineHeight: 1.5, wordBreak: "break-word" }}>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-1)", lineHeight: 1.5, wordBreak: "break-word" }}>
|
||||
{renderBody(message.bodyMd, messageMentions, context)}
|
||||
</div>
|
||||
)}
|
||||
@@ -146,17 +146,17 @@ export function ChatMessageRow({
|
||||
</div>
|
||||
)}
|
||||
{thread && thread.replyCount > 0 && (
|
||||
<button type="button" onClick={onOpenThread} style={{ marginTop: 4, padding: 0, border: 0, background: "transparent", color: "var(--accent)", fontSize: 12, cursor: "pointer" }}>
|
||||
<button type="button" onClick={onOpenThread} style={{ marginTop: 4, padding: 0, border: 0, background: "transparent", color: "var(--accent)", fontSize: "var(--fs-body)", cursor: "pointer" }}>
|
||||
{thread.replyCount === 1 ? t("1 reply") : t("{count} replies", { count: String(thread.replyCount) })}
|
||||
</button>
|
||||
)}
|
||||
{replyStatuses.filter((status) => status.state !== "replied").map((status) => (
|
||||
<div key={`${status.agentId}-${status.state}`} role="status" style={{ fontSize: 12, color: status.state === "failed" || status.state === "expired" ? "var(--red)" : "var(--text-3)", marginTop: 4 }}>
|
||||
<div key={`${status.agentId}-${status.state}`} role="status" style={{ fontSize: "var(--fs-body)", color: status.state === "failed" || status.state === "expired" ? "var(--red)" : "var(--text-3)", marginTop: 4 }}>
|
||||
{replyStatusText(status, context)}
|
||||
</div>
|
||||
))}
|
||||
{readers.length > 0 && (
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)", marginTop: 4 }}>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", marginTop: 4 }}>
|
||||
{t("Read by {names}", { names: readers.join(", ") })}
|
||||
</div>
|
||||
)}
|
||||
@@ -200,8 +200,6 @@ function renderBody(body: string, mentions: ChatMentionRecord[], context: Messag
|
||||
background: failed ? "rgba(255,100,80,0.1)" : "var(--accent-soft)",
|
||||
color: failed ? "var(--text-3)" : "var(--accent)",
|
||||
padding: "1px 5px",
|
||||
borderRadius: 4,
|
||||
fontWeight: 500,
|
||||
textDecoration: failed ? "line-through" : undefined,
|
||||
}}
|
||||
>
|
||||
@@ -235,7 +233,6 @@ function AttachmentCard({ file, handoff = false, onOpen }: { file: FileObjectRec
|
||||
style={{
|
||||
maxWidth: 360,
|
||||
border: "1px solid var(--border)",
|
||||
borderRadius: 10,
|
||||
padding: 10,
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
@@ -247,25 +244,24 @@ function AttachmentCard({ file, handoff = false, onOpen }: { file: FileObjectRec
|
||||
style={{
|
||||
width: 32,
|
||||
height: 32,
|
||||
borderRadius: 6,
|
||||
background: "var(--panel-3)",
|
||||
color: "var(--text-2)",
|
||||
display: "grid",
|
||||
placeItems: "center",
|
||||
}}
|
||||
>
|
||||
<Icon name={file.kind === "folder" ? "folder" : "file"} size={16} />
|
||||
<Icon name={file.kind === "folder" ? "folder" : "file"} />
|
||||
</div>
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div className="row" style={{ gap: 6, minWidth: 0 }}>
|
||||
<span style={{ fontSize: 12, fontWeight: 540, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{file.name}</span>
|
||||
<span style={{ fontSize: "var(--fs-body)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{file.name}</span>
|
||||
{handoff && (
|
||||
<span className="pill violet" style={{ flexShrink: 0 }}>
|
||||
<Icon name="bot" size={10} /> {t("AI → AI")}
|
||||
<Icon name="bot" /> {t("AI → AI")}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)" }}>{fileKindLabel(file.kind)}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{fileKindLabel(file.kind)}</div>
|
||||
</div>
|
||||
{canOpen && <IconButton icon="arrowUpRight" label={t("Open {name}", { name: file.name })} onClick={onOpen ?? undefined} />}
|
||||
</div>
|
||||
|
||||
@@ -84,7 +84,7 @@ export function ChatSidebar({
|
||||
return (
|
||||
<aside className="secondary-pane" style={{ width: paneWidth, position: "relative" }}>
|
||||
<div className="row" style={{ padding: "4px 8px 12px" }}>
|
||||
<div style={{ fontSize: 14, fontWeight: 600 }}>{t("Messages")}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)" }}>{t("Messages")}</div>
|
||||
<IconButton icon="plus" label={t("New space")} onClick={onCreateSpace} />
|
||||
</div>
|
||||
<div className="pane-scroll">
|
||||
@@ -147,7 +147,6 @@ function ConversationRow({
|
||||
style={{
|
||||
width: 22,
|
||||
height: 22,
|
||||
borderRadius: 6,
|
||||
background: "var(--panel-3)",
|
||||
display: "inline-flex",
|
||||
alignItems: "center",
|
||||
@@ -156,14 +155,13 @@ function ConversationRow({
|
||||
marginTop: 2,
|
||||
}}
|
||||
>
|
||||
<Icon name={conversation.space.visibility === "restricted" ? "lock" : "hash"} size={13} color="var(--text-3)" />
|
||||
<Icon name={conversation.space.visibility === "restricted" ? "lock" : "hash"} color="var(--text-3)" />
|
||||
</span>
|
||||
)}
|
||||
<span style={{ flex: 1, minWidth: 0, display: "flex", flexDirection: "column", gap: 1 }}>
|
||||
<span className="row" style={{ gap: 8 }}>
|
||||
<span
|
||||
style={{
|
||||
fontWeight: conversation.unread > 0 ? 600 : 520,
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis",
|
||||
whiteSpace: "nowrap",
|
||||
@@ -174,14 +172,14 @@ function ConversationRow({
|
||||
{conversation.title}
|
||||
</span>
|
||||
{conversation.isCeo && <span className="convo-ceo-badge">{t("CEO")}</span>}
|
||||
<span style={{ fontSize: 11, color: "var(--text-3)", flexShrink: 0 }}>
|
||||
<span style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", flexShrink: 0 }}>
|
||||
{conversation.preview ? formatRelative(conversation.lastActivityAt) : ""}
|
||||
</span>
|
||||
</span>
|
||||
<span className="row" style={{ gap: 8 }}>
|
||||
<span
|
||||
style={{
|
||||
fontSize: 12,
|
||||
fontSize: "var(--fs-body)",
|
||||
color: "var(--text-3)",
|
||||
overflow: "hidden",
|
||||
textOverflow: "ellipsis",
|
||||
|
||||
@@ -97,7 +97,7 @@ export function ChatTimeline({
|
||||
</div>,
|
||||
);
|
||||
} else {
|
||||
elements.push(<div key="history-start" style={{ textAlign: "center", fontSize: 12, color: "var(--text-3)", marginBottom: 16 }}>{t("This is the start of the conversation.")}</div>);
|
||||
elements.push(<div key="history-start" style={{ textAlign: "center", fontSize: "var(--fs-body)", color: "var(--text-3)", marginBottom: 16 }}>{t("This is the start of the conversation.")}</div>);
|
||||
}
|
||||
let lastDay = "";
|
||||
for (const message of visible) {
|
||||
@@ -138,7 +138,7 @@ function DayDivider({ label }: { label: string }) {
|
||||
return (
|
||||
<div className="row" style={{ gap: 12, margin: "8px 0 16px" }}>
|
||||
<div style={{ flex: 1, height: 1, background: "var(--border-soft)" }} />
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)", fontWeight: 540 }}>{label}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{label}</div>
|
||||
<div style={{ flex: 1, height: 1, background: "var(--border-soft)" }} />
|
||||
</div>
|
||||
);
|
||||
@@ -146,14 +146,14 @@ function DayDivider({ label }: { label: string }) {
|
||||
|
||||
function ApprovalInline({ approval, onApprove, onDecline }: { approval: ApprovalRecord; onApprove: () => void; onDecline: () => void }) {
|
||||
return (
|
||||
<div style={{ margin: "14px 0 18px 44px", maxWidth: 480, border: "1px solid var(--border-strong)", borderRadius: 12, background: "var(--panel)", padding: 14 }}>
|
||||
<div style={{ margin: "14px 0 18px 44px", maxWidth: 480, border: "1px solid var(--border-strong)", background: "var(--panel)", padding: 14 }}>
|
||||
<div className="row" style={{ marginBottom: 8 }}>
|
||||
<Icon name="approve" size={14} color="var(--amber)" />
|
||||
<span style={{ fontSize: 12, color: "var(--amber)", fontWeight: 540 }}>{t("Approval needed")}</span>
|
||||
<Icon name="approve" color="var(--amber)" />
|
||||
<span style={{ fontSize: "var(--fs-body)", color: "var(--amber)" }}>{t("Approval needed")}</span>
|
||||
<Pill tone={approval.risk === "high" ? "red" : approval.risk === "medium" ? "amber" : undefined}>{riskLabel(approval.risk)}</Pill>
|
||||
</div>
|
||||
<div style={{ fontSize: 14, fontWeight: 540, marginBottom: 4 }}>{approval.title}</div>
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)", marginBottom: 12, lineHeight: 1.5 }}>{approval.details}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", marginBottom: 4 }}>{approval.title}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", marginBottom: 12, lineHeight: 1.5 }}>{approval.details}</div>
|
||||
<div className="row" style={{ gap: 6 }}>
|
||||
<Button tone="primary" size="small" onClick={onApprove}>{t("Approve")}</Button>
|
||||
<Button size="small" onClick={onDecline}>{t("Decline")}</Button>
|
||||
|
||||
@@ -125,7 +125,6 @@ export function MentionTextarea({
|
||||
marginBottom: 4,
|
||||
background: "var(--panel)",
|
||||
border: "1px solid var(--border)",
|
||||
borderRadius: 10,
|
||||
boxShadow: "0 4px 16px rgba(0,0,0,0.12)",
|
||||
maxHeight: 200,
|
||||
overflow: "auto",
|
||||
@@ -149,13 +148,13 @@ export function MentionTextarea({
|
||||
border: 0,
|
||||
background: i === index ? "var(--accent-soft)" : "transparent",
|
||||
cursor: "pointer",
|
||||
fontSize: 14,
|
||||
fontSize: "var(--fs-body)",
|
||||
color: "var(--text-1)",
|
||||
textAlign: "left",
|
||||
}}
|
||||
>
|
||||
<Avatar name={c.displayName} size="sm" bot={c.bot} />
|
||||
<span style={{ fontWeight: 500 }}>{c.label}</span>
|
||||
<span>{c.label}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
@@ -175,7 +174,7 @@ export function MentionTextarea({
|
||||
border: 0,
|
||||
resize: "none",
|
||||
outline: "none",
|
||||
fontSize: 14,
|
||||
fontSize: "var(--fs-body)",
|
||||
color: "var(--text-1)",
|
||||
background: "transparent",
|
||||
padding: 0,
|
||||
|
||||
@@ -7,7 +7,7 @@ import { t } from "../../i18n/i18n";
|
||||
export type SpaceType = "company" | "division" | "department" | "project" | "pod" | "ad_hoc" | "direct";
|
||||
export type Visibility = "workspace" | "restricted";
|
||||
|
||||
const hint = { fontSize: 12, color: "var(--text-3)", margin: 0, lineHeight: 1.5 } as const;
|
||||
const hint = { fontSize: "var(--fs-body)", color: "var(--text-3)", margin: 0, lineHeight: 1.5 } as const;
|
||||
|
||||
/** Each choice says what it changes: who is a member, who can read it, and which agents a message wakes. */
|
||||
export function NewSpaceDialog({ open, employee, employees, agents, onClose, onSubmit }: {
|
||||
|
||||
@@ -74,7 +74,7 @@ export function ThreadPanel({
|
||||
return (
|
||||
<aside role="complementary" aria-label={t("Thread")} style={{ width: 360, flexShrink: 0, display: "flex", flexDirection: "column", borderLeft: "1px solid var(--border-soft)", background: "var(--panel)" }}>
|
||||
<header className="row" style={{ height: 52, padding: "0 16px", borderBottom: "1px solid var(--border-soft)", flexShrink: 0 }}>
|
||||
<span style={{ fontSize: 14, fontWeight: 600 }}>{t("Thread")}</span>
|
||||
<span style={{ fontSize: "var(--fs-body)" }}>{t("Thread")}</span>
|
||||
<span style={{ marginLeft: "auto" }}><IconButton icon="x" label={t("Close thread")} onClick={onClose} /></span>
|
||||
</header>
|
||||
<div style={{ flex: 1, overflow: "auto", padding: "16px 16px 8px" }}>
|
||||
|
||||
@@ -7,14 +7,14 @@ import type { AccountSync } from "./useConnectorCatalog";
|
||||
export function AccountSyncNote({ sync, onRetry }: { sync: AccountSync; onRetry: () => void }) {
|
||||
if (sync.phase === "failed") {
|
||||
return (
|
||||
<div role="alert" className="row" style={{ gap: 10, fontSize: 13, marginBottom: 14, color: "var(--red)" }}>
|
||||
<span style={{ flex: 1, minWidth: 0, wordBreak: "break-word" }}>{t("Account status could not be checked with Composio: {reason}. The statuses below may be out of date.", { reason: sync.message })}</span>
|
||||
<div role="alert" className="row" style={{ gap: 10, fontSize: "var(--fs-body)", marginBottom: 14, color: "var(--red)" }}>
|
||||
<span style={{ flex: 1, minWidth: 0, wordBreak: "break-word" }}>{t("Account status could not be checked with Composio, so the statuses below may be out of date. Reason: {reason}", { reason: sync.message })}</span>
|
||||
<Button size="small" onClick={onRetry}>{t("Retry")}</Button>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div role="status" style={{ fontSize: 12, marginBottom: 14, color: "var(--text-3)" }}>
|
||||
<div role="status" style={{ fontSize: "var(--fs-body)", marginBottom: 14, color: "var(--text-3)" }}>
|
||||
{sync.phase === "syncing" ? t("Checking account status with Composio…") : t("Account status checked with Composio at {time}.", { time: formatTime(sync.at) })}
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -68,7 +68,7 @@ export function ConnectedList({
|
||||
const grantable = agents.filter((agent) => agent.roleLevel !== "c_suite" && !grants.some((grant) => grant.agentId === agent.id && grant.toolkitSlug === account.toolkitSlug));
|
||||
const busy = busySlug !== null;
|
||||
return (
|
||||
<div key={account.id} style={{ border: "1px solid var(--border)", borderRadius: 12, padding: 14, background: "var(--panel)" }}>
|
||||
<div key={account.id} style={{ border: "1px solid var(--border)", padding: 14, background: "var(--panel)" }}>
|
||||
<div className="row" style={{ gap: 10 }}>
|
||||
<ToolkitTile
|
||||
name={account.toolkitName}
|
||||
@@ -76,8 +76,8 @@ export function ConnectedList({
|
||||
logoUrl={logoBySlug.get(account.toolkitSlug) ?? null}
|
||||
size={30}
|
||||
/>
|
||||
<span style={{ fontWeight: 600, fontSize: 13.5 }}>{account.toolkitName}</span>
|
||||
<span style={{ color: "var(--text-2)", fontSize: 12.5 }}>{account.label}</span>
|
||||
<span style={{ fontSize: "var(--fs-body)" }}>{account.toolkitName}</span>
|
||||
<span style={{ color: "var(--text-2)", fontSize: "var(--fs-body)" }}>{account.label}</span>
|
||||
<Pill tone={STATUS_TONE[account.status]} dot>{account.status.charAt(0) + account.status.slice(1).toLowerCase()}</Pill>
|
||||
{account.pendingAccountId && <Pill tone="amber" dot>{t("Reconnect waiting for authorization")}</Pill>}
|
||||
<span className="row" style={{ gap: 6, marginLeft: "auto" }}>
|
||||
@@ -96,7 +96,7 @@ export function ConnectedList({
|
||||
{holders.map((holder) => (
|
||||
<span key={holder.agentId} className="row" style={{ gap: 2 }}>
|
||||
<Pill>{holder.text}</Pill>
|
||||
<IconButton icon="x" size={12} label={t("Revoke {name}", { name: holder.text })} disabled={busy} onClick={() => onRevoke(holder.agentId, account.toolkitSlug)} />
|
||||
<IconButton icon="x" label={t("Revoke {name}", { name: holder.text })} disabled={busy} onClick={() => onRevoke(holder.agentId, account.toolkitSlug)} />
|
||||
</span>
|
||||
))}
|
||||
{account.status === "ACTIVE" && grantable.length > 0 && (
|
||||
|
||||
@@ -7,7 +7,7 @@ export function SignInStatus({ signIn, onStop, onCheckAgain }: { signIn: SignIn;
|
||||
const name = signIn.slug;
|
||||
const failed = signIn.phase === "failed" || signIn.phase === "timed_out";
|
||||
return (
|
||||
<div role={failed ? "alert" : "status"} className="row" style={{ gap: 10, fontSize: 13, marginBottom: 14, color: failed ? "var(--red)" : "var(--text-2)" }}>
|
||||
<div role={failed ? "alert" : "status"} className="row" style={{ gap: 10, fontSize: "var(--fs-body)", marginBottom: 14, color: failed ? "var(--red)" : "var(--text-2)" }}>
|
||||
<span style={{ flex: 1, minWidth: 0 }}>
|
||||
{signIn.phase === "waiting" && t("Waiting for the {name} sign-in in your browser (check {check} of {checks}).", { name, check: signIn.check, checks: signIn.checks })}
|
||||
{signIn.phase === "connected" && t("{name} ({label}) is connected.", { name, label: signIn.label })}
|
||||
|
||||
@@ -20,7 +20,7 @@ export function ToolkitTile({ name, slug, logoUrl, size = 34 }: { name: string;
|
||||
alt=""
|
||||
width={size}
|
||||
height={size}
|
||||
style={{ width: size, height: size, borderRadius: 9, objectFit: "cover", flexShrink: 0 }}
|
||||
style={{ width: size, height: size, objectFit: "cover", flexShrink: 0 }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -29,14 +29,12 @@ export function ToolkitTile({ name, slug, logoUrl, size = 34 }: { name: string;
|
||||
style={{
|
||||
width: size,
|
||||
height: size,
|
||||
borderRadius: 9,
|
||||
background: tileColor(slug),
|
||||
color: "#fff",
|
||||
display: "inline-flex",
|
||||
alignItems: "center",
|
||||
justifyContent: "center",
|
||||
fontSize: size * 0.44,
|
||||
fontWeight: 600,
|
||||
fontSize: "var(--fs-body)",
|
||||
flexShrink: 0,
|
||||
}}
|
||||
>
|
||||
@@ -67,14 +65,14 @@ export function ToolkitCatalog({
|
||||
<section>
|
||||
<div className="row" style={{ marginBottom: 12, gap: 10 }}>
|
||||
<div className="section-label" style={{ flex: 1 }}>{t("Catalog")}</div>
|
||||
<div className="row" style={{ gap: 6, background: "var(--panel-2)", borderRadius: 8, padding: "5px 10px", width: 240 }}>
|
||||
<Icon name="search" size={13} color="var(--text-3)" />
|
||||
<div className="row" style={{ gap: 6, background: "var(--panel-2)", padding: "5px 10px", width: 240 }}>
|
||||
<Icon name="search" color="var(--text-3)" />
|
||||
<input
|
||||
aria-label={t("Search connectors")}
|
||||
value={query}
|
||||
onChange={(event) => setQuery(event.target.value)}
|
||||
placeholder={t("Search connectors")}
|
||||
style={{ border: 0, outline: 0, background: "transparent", fontSize: 13, flex: 1, minWidth: 0, color: "var(--text-1)" }}
|
||||
style={{ border: 0, outline: 0, background: "transparent", fontSize: "var(--fs-body)", flex: 1, minWidth: 0, color: "var(--text-1)" }}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -86,7 +84,6 @@ export function ToolkitCatalog({
|
||||
key={entry.slug}
|
||||
style={{
|
||||
border: "1px solid var(--border)",
|
||||
borderRadius: 12,
|
||||
padding: 12,
|
||||
background: "var(--panel)",
|
||||
display: "flex",
|
||||
@@ -95,7 +92,7 @@ export function ToolkitCatalog({
|
||||
}}
|
||||
>
|
||||
<ToolkitTile name={entry.name} slug={entry.slug} logoUrl={entry.logoUrl} />
|
||||
<span style={{ fontWeight: 600, fontSize: 13.5, flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
<span style={{ fontSize: "var(--fs-body)", flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
{entry.name}
|
||||
</span>
|
||||
{connected ? (
|
||||
|
||||
@@ -9,7 +9,7 @@ export function FileIcon({ kind, big = false }: { kind: string; big?: boolean })
|
||||
if (kind === "folder") {
|
||||
return (
|
||||
<div style={{ width: big ? 28 : 22, height: big ? 28 : 22, display: "grid", placeItems: "center", color: "var(--text-3)" }}>
|
||||
<Icon name="folder" size={big ? 22 : 17} />
|
||||
<Icon name="folder" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -20,14 +20,11 @@ export function FileIcon({ kind, big = false }: { kind: string; big?: boolean })
|
||||
style={{
|
||||
width: big ? 28 : 22,
|
||||
height: big ? 28 : 22,
|
||||
borderRadius: big ? 6 : 4,
|
||||
background: `${map.color}14`,
|
||||
color: map.color,
|
||||
display: "grid",
|
||||
placeItems: "center",
|
||||
fontSize: big ? 9 : 8,
|
||||
fontWeight: 700,
|
||||
letterSpacing: 0.5,
|
||||
fontSize: "var(--fs-body)",
|
||||
}}
|
||||
>
|
||||
{label}
|
||||
|
||||
@@ -26,7 +26,7 @@ export function FilesGrid({
|
||||
onTogglePin: (file: FileObjectRecord) => void;
|
||||
}) {
|
||||
return (
|
||||
<div style={{ display: "grid", gridTemplateColumns: "repeat(auto-fill, minmax(220px, 1fr))", gap: 12 }}>
|
||||
<div className="inventory">
|
||||
{files.map((file) => (
|
||||
<PinnedCard
|
||||
key={file.id}
|
||||
@@ -58,22 +58,12 @@ export function PinnedCard({
|
||||
return (
|
||||
<div
|
||||
data-object-id={file.id}
|
||||
className={canOpen ? "clickable-card" : ""}
|
||||
className={`inventory-slot ${canOpen ? "clickable-card" : ""}`.trim()}
|
||||
role={canOpen ? "button" : undefined}
|
||||
tabIndex={canOpen ? 0 : undefined}
|
||||
onClick={canOpen ? onOpen : undefined}
|
||||
onKeyDown={canOpen ? (event) => { if (event.key === "Enter") onOpen(); } : undefined}
|
||||
style={{
|
||||
border: "1px solid var(--border)",
|
||||
borderRadius: 10,
|
||||
background: "var(--panel)",
|
||||
padding: 14,
|
||||
display: "flex",
|
||||
flexDirection: "column",
|
||||
gap: 10,
|
||||
minWidth: 0,
|
||||
cursor: canOpen ? "pointer" : "default",
|
||||
}}
|
||||
style={{ cursor: canOpen ? "pointer" : "default" }}
|
||||
>
|
||||
<div className="row" style={{ gap: 10 }}>
|
||||
<FileIcon kind={file.kind} big />
|
||||
@@ -83,23 +73,23 @@ export function PinnedCard({
|
||||
onClick={(event) => { event.stopPropagation(); onUnpin(); }}
|
||||
style={{ marginLeft: "auto", padding: 4, border: 0, background: "transparent", color: file.pinned ? "var(--accent)" : "var(--text-4)", cursor: "pointer" }}
|
||||
>
|
||||
<Icon name="pin" size={14} />
|
||||
<Icon name="pin" />
|
||||
</button>
|
||||
</div>
|
||||
<div style={{ fontSize: 14, fontWeight: 540, letterSpacing: "-0.005em", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
<div style={{ fontSize: "var(--fs-body)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
{file.name}
|
||||
</div>
|
||||
<div className="mono" style={{ color: "var(--text-3)", fontSize: 10, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
<div className="mono" style={{ color: "var(--text-3)", fontSize: "var(--fs-body)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
sha:{shortChecksum(file.sha256)} · obj:{shortObjectRef(file.storagePath)}
|
||||
</div>
|
||||
<div className="row" style={{ gap: 6 }}>
|
||||
<ScanPill file={file} />
|
||||
<span className="mono" style={{ color: "var(--text-3)", fontSize: 12 }}>{grantCount}</span>
|
||||
<span className="mono" style={{ color: "var(--text-3)", fontSize: "var(--fs-body)" }}>{grantCount}</span>
|
||||
</div>
|
||||
<ScanLabelStrip file={file} />
|
||||
<div className="row" style={{ gap: 8, marginTop: "auto", minWidth: 0 }}>
|
||||
<Avatar name={ownerName} size="sm" bot={isAgentOwner(file)} />
|
||||
<span style={{ fontSize: 12, color: "var(--text-3)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
<span style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
{formatRelative(file.updatedAt ?? file.createdAt)} · {ownerName.split(" ")[0]}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -77,23 +77,23 @@ function FileRow({
|
||||
<div className="row" style={{ gap: 10, minWidth: 0 }}>
|
||||
<FileIcon kind={file.kind} />
|
||||
<div style={{ display: "grid", gap: 3, minWidth: 0 }}>
|
||||
<span style={{ fontWeight: 480, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{file.name}</span>
|
||||
<span className="mono" style={{ color: "var(--text-3)", fontSize: 10, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
<span style={{ overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{file.name}</span>
|
||||
<span className="mono" style={{ color: "var(--text-3)", fontSize: "var(--fs-body)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
sha:{shortChecksum(file.sha256)} · obj:{shortObjectRef(file.storagePath)}
|
||||
</span>
|
||||
</div>
|
||||
{file.pinned && <Pill tone="violet" dot>{t("Pinned")}</Pill>}
|
||||
</div>
|
||||
<div className="num mono" style={{ color: "var(--text-3)", fontSize: 12 }}>{formatBytes(file.sizeBytes)}</div>
|
||||
<div className="num mono" style={{ color: "var(--text-3)", fontSize: "var(--fs-body)" }}>{formatBytes(file.sizeBytes)}</div>
|
||||
<div className="row" style={{ gap: 8, minWidth: 0 }}>
|
||||
<Avatar name={owner} size="sm" bot={isAgentOwner(file)} />
|
||||
<span style={{ color: "var(--text-2)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{owner}</span>
|
||||
</div>
|
||||
<div className="row" style={{ gap: 6, minWidth: 0 }}>
|
||||
<ScanPill file={file} />
|
||||
<span className="mono" style={{ color: "var(--text-3)", fontSize: 12 }}>{grantCount}</span>
|
||||
<span className="mono" style={{ color: "var(--text-3)", fontSize: "var(--fs-body)" }}>{grantCount}</span>
|
||||
</div>
|
||||
<div style={{ color: "var(--text-3)", fontSize: 12 }}>{formatRelative(file.updatedAt ?? file.createdAt)}</div>
|
||||
<div style={{ color: "var(--text-3)", fontSize: "var(--fs-body)" }}>{formatRelative(file.updatedAt ?? file.createdAt)}</div>
|
||||
<div style={{ textAlign: "right" }} onClick={(event) => event.stopPropagation()}>
|
||||
<Popover trigger={({ toggle }) => <IconButton icon="more" label={t("Actions for {name}", { name: file.name })} onClick={toggle} />}>
|
||||
{(close) => (
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Icon } from "../../shared/ui";
|
||||
import type { IconName } from "../../shared/Icon";
|
||||
import type { AgentRecord, FileObjectRecord } from "../../../../shared/domain";
|
||||
import { isRecent, type Section } from "./file-helpers";
|
||||
import { t } from "../../i18n/i18n";
|
||||
@@ -84,7 +85,7 @@ function TreeItem({
|
||||
active,
|
||||
onClick,
|
||||
}: {
|
||||
icon: string;
|
||||
icon: IconName;
|
||||
label: string;
|
||||
count: number;
|
||||
active: boolean;
|
||||
@@ -92,7 +93,7 @@ function TreeItem({
|
||||
}) {
|
||||
return (
|
||||
<button type="button" aria-current={active ? "true" : undefined} className={`nav-item ${active ? "active" : ""}`.trim()} onClick={onClick}>
|
||||
<span className="icon-box"><Icon name={icon} size={18} /></span>
|
||||
<span className="icon-box"><Icon name={icon} /></span>
|
||||
<span>{label}</span>
|
||||
<span className="nav-badge num">{count}</span>
|
||||
</button>
|
||||
|
||||
@@ -4,7 +4,8 @@ import { useState, type ReactNode, type KeyboardEvent } from "react";
|
||||
import type { AgentRecord, TaskRecord } from "../../../../shared/domain";
|
||||
import { t } from "../../i18n/i18n";
|
||||
|
||||
const CHART_H = 116;
|
||||
/** Plot height; axis labels sit below it as HTML text. */
|
||||
const PLOT_H = 100;
|
||||
const CHART_W = 260;
|
||||
const BAR_GAP = 4;
|
||||
|
||||
@@ -30,7 +31,7 @@ function ChartCard({ title, readout, values, point, onPoint, children }: {
|
||||
};
|
||||
return (
|
||||
<section className="card metric-card" aria-label={title}>
|
||||
<div className="row" style={{ marginBottom: 12, gap: 8 }}>
|
||||
<div style={{ display: "grid", gap: 4, marginBottom: 12 }}>
|
||||
<span className="card-label">{title}</span>
|
||||
<span className="metric-readout num" aria-live="polite">{readout}</span>
|
||||
</div>
|
||||
@@ -60,28 +61,27 @@ export function AgentWorkloadChart({ agents, tasks }: { agents: AgentRecord[]; t
|
||||
|
||||
return (
|
||||
<ChartCard title={t("Agent workload")} readout={readout} values={data.map((d) => `${d.label}: ${d.count}`)} point={hover} onPoint={setHover}>
|
||||
<svg viewBox={`0 0 ${CHART_W} ${CHART_H}`} style={{ width: "100%", height: CHART_H }}>
|
||||
<svg viewBox={`0 0 ${CHART_W} ${PLOT_H}`} preserveAspectRatio="none" shapeRendering="crispEdges" style={{ width: "100%", height: PLOT_H }}>
|
||||
{data.map((d, i) => {
|
||||
const h = (d.count / max) * (CHART_H - 22);
|
||||
const h = (d.count / max) * (PLOT_H - 6);
|
||||
const x = i * (barW + BAR_GAP);
|
||||
return (
|
||||
<g key={d.key} onMouseEnter={() => setHover(i)} onMouseLeave={() => setHover(null)}>
|
||||
<rect x={x} y={0} width={barW} height={CHART_H - 16} fill="transparent" />
|
||||
<rect x={x} y={0} width={barW} height={PLOT_H} fill="transparent" />
|
||||
<rect
|
||||
x={x}
|
||||
y={CHART_H - h - 16}
|
||||
y={PLOT_H - h}
|
||||
width={barW}
|
||||
height={Math.max(2, h)}
|
||||
rx={4}
|
||||
fill="var(--accent)"
|
||||
opacity={hover === null || hover === i ? 0.85 : 0.32}
|
||||
style={{ transition: "opacity var(--motion-fast) var(--ease-out)" }}
|
||||
/>
|
||||
<text x={x + barW / 2} y={CHART_H - 2} textAnchor="middle" fontSize="9" fill="var(--text-3)">{d.label}</text>
|
||||
</g>
|
||||
);
|
||||
})}
|
||||
</svg>
|
||||
<ChartAxis labels={data.map((d) => d.label)} />
|
||||
</ChartCard>
|
||||
);
|
||||
}
|
||||
@@ -96,28 +96,27 @@ export function RunActivityChart({ days }: { days: UsageDays }) {
|
||||
|
||||
return (
|
||||
<ChartCard title={t("Run activity")} readout={readout} values={buckets.map((b) => `${b.label}: ${b.count}`)} point={hover} onPoint={setHover}>
|
||||
<svg viewBox={`0 0 ${CHART_W} ${CHART_H}`} style={{ width: "100%", height: CHART_H }}>
|
||||
<svg viewBox={`0 0 ${CHART_W} ${PLOT_H}`} preserveAspectRatio="none" shapeRendering="crispEdges" style={{ width: "100%", height: PLOT_H }}>
|
||||
{buckets.map((b, i) => {
|
||||
const h = (b.count / max) * (CHART_H - 24);
|
||||
const h = (b.count / max) * (PLOT_H - 6);
|
||||
const x = i * (barW + BAR_GAP);
|
||||
return (
|
||||
<g key={`${b.label}-${i}`} onMouseEnter={() => setHover(i)} onMouseLeave={() => setHover(null)}>
|
||||
<rect x={x} y={0} width={barW} height={CHART_H - 16} fill="transparent" />
|
||||
<rect x={x} y={0} width={barW} height={PLOT_H} fill="transparent" />
|
||||
<rect
|
||||
x={x}
|
||||
y={CHART_H - h - 16}
|
||||
y={PLOT_H - h}
|
||||
width={barW}
|
||||
height={Math.max(2, h)}
|
||||
rx={4}
|
||||
fill="var(--text-1)"
|
||||
opacity={hover === null || hover === i ? 0.82 : 0.28}
|
||||
style={{ transition: "opacity var(--motion-fast) var(--ease-out)" }}
|
||||
/>
|
||||
<text x={x + barW / 2} y={CHART_H - 2} textAnchor="middle" fontSize="9" fill="var(--text-3)">{b.label}</text>
|
||||
</g>
|
||||
);
|
||||
})}
|
||||
</svg>
|
||||
<ChartAxis labels={buckets.map((b) => b.label)} />
|
||||
</ChartCard>
|
||||
);
|
||||
}
|
||||
@@ -139,16 +138,18 @@ export function AcceptanceChart({ days }: { days: UsageDays }) {
|
||||
readout={t("{accepted} done · {returned} sent back · sessions: {ok} ended, {failed} failed", { accepted, returned, ok: completed, failed })}
|
||||
values={[judged > 0 ? t("{rate}% of judged work accepted", { rate }) : t("No work judged yet")]}
|
||||
>
|
||||
<svg viewBox="0 0 100 100" style={{ width: 96, height: 96, margin: "4px auto", display: "block" }}>
|
||||
<circle cx="50" cy="50" r="42" fill="none" stroke="var(--panel-3)" strokeWidth="8" />
|
||||
<circle
|
||||
cx="50" cy="50" r="42" fill="none" stroke="var(--green)" strokeWidth="8"
|
||||
strokeDasharray={circumference} strokeDashoffset={offset}
|
||||
strokeLinecap="round" transform="rotate(-90 50 50)"
|
||||
style={{ transition: "stroke-dashoffset var(--motion-slow) var(--ease-out)" }}
|
||||
/>
|
||||
<text x="50" y="50" textAnchor="middle" dominantBaseline="central" fontSize="20" fontWeight="600" fill="var(--text-1)">{judged > 0 ? `${rate}%` : "—"}</text>
|
||||
</svg>
|
||||
<div style={{ position: "relative", width: 96, height: 96, margin: "4px auto" }}>
|
||||
<svg viewBox="0 0 100 100" shapeRendering="crispEdges" style={{ width: 96, height: 96, display: "block" }}>
|
||||
<circle cx="50" cy="50" r="42" fill="none" stroke="var(--panel-3)" strokeWidth="8" />
|
||||
<circle
|
||||
cx="50" cy="50" r="42" fill="none" stroke="var(--green)" strokeWidth="8"
|
||||
strokeDasharray={circumference} strokeDashoffset={offset}
|
||||
transform="rotate(-90 50 50)"
|
||||
style={{ transition: "stroke-dashoffset var(--motion-slow) var(--ease-out)" }}
|
||||
/>
|
||||
</svg>
|
||||
<span className="num" style={{ position: "absolute", inset: 0, display: "grid", placeItems: "center", fontSize: "var(--fs-display)" }}>{judged > 0 ? `${rate}%` : "—"}</span>
|
||||
</div>
|
||||
</ChartCard>
|
||||
);
|
||||
}
|
||||
@@ -161,7 +162,7 @@ export function CostTrendChart({ days }: { days: UsageDays }) {
|
||||
const max = Math.max(1, ...tokenBuckets.map((b) => b.tokens));
|
||||
const coords = tokenBuckets.map((b, i) => ({
|
||||
x: (i / 6) * (CHART_W - 10) + 5,
|
||||
y: CHART_H - 20 - (b.tokens / max) * (CHART_H - 30),
|
||||
y: PLOT_H - 4 - (b.tokens / max) * (PLOT_H - 8),
|
||||
b,
|
||||
}));
|
||||
const points = coords.map((c) => `${c.x},${c.y}`).join(" ");
|
||||
@@ -175,20 +176,32 @@ export function CostTrendChart({ days }: { days: UsageDays }) {
|
||||
|
||||
return (
|
||||
<ChartCard title={t("Token usage")} readout={readout} values={tokenBuckets.map((b) => `${b.label}: ${compact(b.tokens)}`)} point={hover} onPoint={setHover}>
|
||||
<svg viewBox={`0 0 ${CHART_W} ${CHART_H}`} style={{ width: "100%", height: CHART_H }}>
|
||||
<polyline points={points} fill="none" stroke="var(--accent)" strokeWidth="2" strokeLinejoin="round" strokeLinecap="round" />
|
||||
{coords.map((c, i) => (
|
||||
<g key={`${c.b.label}-${i}`} onMouseEnter={() => setHover(i)} onMouseLeave={() => setHover(null)}>
|
||||
<circle cx={c.x} cy={c.y} r="9" fill="transparent" />
|
||||
<circle cx={c.x} cy={c.y} r={hover === i ? 4 : 3} fill="var(--accent)" style={{ transition: "r var(--motion-fast) var(--ease-out)" }} />
|
||||
<text x={c.x} y={CHART_H - 2} textAnchor="middle" fontSize="9" fill="var(--text-3)">{c.b.label}</text>
|
||||
</g>
|
||||
))}
|
||||
<svg viewBox={`0 0 ${CHART_W} ${PLOT_H}`} shapeRendering="crispEdges" style={{ width: "100%", height: PLOT_H }}>
|
||||
<polyline points={points} fill="none" stroke="var(--accent)" strokeWidth="2" />
|
||||
{coords.map((c, i) => {
|
||||
const side = hover === i ? 8 : 6;
|
||||
return (
|
||||
<g key={`${c.b.label}-${i}`} onMouseEnter={() => setHover(i)} onMouseLeave={() => setHover(null)}>
|
||||
<rect x={c.x - 9} y={c.y - 9} width={18} height={18} fill="transparent" />
|
||||
<rect x={c.x - side / 2} y={c.y - side / 2} width={side} height={side} fill="var(--accent)" />
|
||||
</g>
|
||||
);
|
||||
})}
|
||||
</svg>
|
||||
<ChartAxis labels={tokenBuckets.map((b) => b.label)} />
|
||||
</ChartCard>
|
||||
);
|
||||
}
|
||||
|
||||
/** Axis labels as pixel text, one evenly spaced cell per datum under the plot. */
|
||||
function ChartAxis({ labels }: { labels: string[] }) {
|
||||
return (
|
||||
<div aria-hidden="true" style={{ display: "flex", marginTop: 2, fontSize: "var(--fs-caption)", color: "var(--text-3)" }}>
|
||||
{labels.map((label, index) => <span key={index} style={{ flex: 1, textAlign: "center", overflow: "hidden", whiteSpace: "nowrap" }}>{label}</span>)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
function compact(count: number): string {
|
||||
if (count >= 1_000_000) return `${(count / 1_000_000).toFixed(1)}M`;
|
||||
if (count >= 1000) return `${(count / 1000).toFixed(count >= 10000 ? 0 : 1)}k`;
|
||||
|
||||
@@ -5,8 +5,8 @@ import { Button, Icon, Pill } from "../../shared/ui";
|
||||
import type { NextUpItem } from "./next-up";
|
||||
|
||||
const SHOWN = 3;
|
||||
const TITLE = { fontSize: 14, fontWeight: 500, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } as const;
|
||||
const META = { fontSize: 12, color: "var(--text-3)", margin: "2px 0 8px" } as const;
|
||||
const TITLE = { fontSize: "var(--fs-body)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" } as const;
|
||||
const META = { fontSize: "var(--fs-body)", color: "var(--text-3)", margin: "2px 0 8px" } as const;
|
||||
|
||||
/** Home's one place for what to look at next: decisions and stopped work in priority order, or else the next task in line. */
|
||||
export function NextUpCard({
|
||||
@@ -35,8 +35,8 @@ export function NextUpCard({
|
||||
</div>
|
||||
{needsYou.length === 0 ? (
|
||||
<>
|
||||
<div className="row" style={{ gap: 8, color: "var(--text-3)", fontSize: 14, marginBottom: 12 }}>
|
||||
<Icon name="check" size={16} /><span>{t("You're all caught up")}</span>
|
||||
<div className="row" style={{ gap: 8, color: "var(--text-3)", fontSize: "var(--fs-body)", marginBottom: 12 }}>
|
||||
<Icon name="check" /><span>{t("You're all caught up")}</span>
|
||||
</div>
|
||||
{next?.kind === "next" && (
|
||||
<div>
|
||||
@@ -68,7 +68,7 @@ export function NextUpCard({
|
||||
<Button size="small" onClick={() => onOpenTask(item.task.id)}>{t("Open")}</Button>
|
||||
</li>
|
||||
) : null)}
|
||||
{more > 0 && <li style={{ fontSize: 12, color: "var(--text-3)" }}>{t("{n} more after these", { n: more })}</li>}
|
||||
{more > 0 && <li style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{t("{n} more after these", { n: more })}</li>}
|
||||
</ol>
|
||||
)}
|
||||
</section>
|
||||
|
||||
@@ -97,14 +97,14 @@ export function DocumentsPanel({
|
||||
style={{ display: "grid", justifyItems: "start", gap: 2 }}
|
||||
>
|
||||
<span>{doc.title}</span>
|
||||
<span style={{ fontSize: 12, color: "var(--text-3)" }}>{doc.docType} · v{doc.version} · {formatTime(doc.updatedAt)}</span>
|
||||
<span style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{doc.docType} · v{doc.version} · {formatTime(doc.updatedAt)}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
{selected && (
|
||||
<article aria-label={selected.title} style={{ minWidth: 0 }}>
|
||||
<div className="row" style={{ gap: 8, marginBottom: 8, flexWrap: "wrap" }}>
|
||||
<h2 style={{ margin: 0, fontSize: 18 }}>{shown?.title ?? selected.title}</h2>
|
||||
<h2 style={{ margin: 0, fontSize: "var(--fs-display)" }}>{shown?.title ?? selected.title}</h2>
|
||||
<Pill>{selected.docType}</Pill>
|
||||
<Pill tone={selected.status === "approved" ? "green" : undefined}>{documentStatusLabel(shown?.status ?? selected.status)}</Pill>
|
||||
</div>
|
||||
|
||||
@@ -131,7 +131,7 @@ export function KnowledgePanel({
|
||||
style={{ display: "grid", justifyItems: "start", gap: 2 }}
|
||||
>
|
||||
<span>{entry.topic}</span>
|
||||
<span style={{ fontSize: 12, color: "var(--text-3)" }}>{entry.category} · {entry.scopeType} · {entry.importance}</span>
|
||||
<span style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{entry.category} · {entry.scopeType} · {entry.importance}</span>
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
@@ -139,7 +139,7 @@ export function KnowledgePanel({
|
||||
{selected && (
|
||||
<article aria-label={selected.topic} style={{ minWidth: 0 }}>
|
||||
<div className="row" style={{ gap: 8, marginBottom: 8, flexWrap: "wrap" }}>
|
||||
<h2 style={{ margin: 0, fontSize: 18 }}>{selected.topic}</h2>
|
||||
<h2 style={{ margin: 0, fontSize: "var(--fs-display)" }}>{selected.topic}</h2>
|
||||
<Pill>{selected.category}</Pill>
|
||||
<Pill>{selected.scopeType}</Pill>
|
||||
<Pill tone={entryState(selected, now) === "active" ? "green" : "amber"}>{entryState(selected, now)}</Pill>
|
||||
@@ -155,7 +155,7 @@ export function KnowledgePanel({
|
||||
<ol style={{ display: "grid", gap: 10, paddingLeft: 18 }}>
|
||||
{revisions.map((revision) => (
|
||||
<li key={revision.revision}>
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)" }}>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>
|
||||
r{revision.revision} · {formatTime(revision.createdAt)} · {revision.changedByType} · {revision.reason}
|
||||
</div>
|
||||
<div style={{ whiteSpace: "pre-wrap" }}>{revision.content}</div>
|
||||
|
||||
@@ -1,13 +1,16 @@
|
||||
import { Avatar, Icon, IconButton, Pill } from "../../shared/ui";
|
||||
import { officeActivityLabel, roleLevelLabel } from "../../i18n/labels";
|
||||
import { Icon, IconButton, Pill } from "../../shared/ui";
|
||||
import { officeStateLabel, roleLevelLabel } from "../../i18n/labels";
|
||||
import { t } from "../../i18n/i18n";
|
||||
import type { AgentActivity, OfficeAgentInput } from "./office-types";
|
||||
import { TaskHoldNotice } from "../work/TaskHoldNotice";
|
||||
import type { OfficeAgentInput } from "./office-types";
|
||||
import { PixelAvatar } from "./PixelAvatar";
|
||||
import type { OfficeState } from "./agent-state";
|
||||
|
||||
|
||||
const ACTIVITY_TONE: Record<AgentActivity, "green" | "violet" | "amber" | undefined> = {
|
||||
active: "green",
|
||||
thinking: "violet",
|
||||
busy: "amber",
|
||||
const STATE_TONE: Record<OfficeState, "green" | "amber" | "red" | undefined> = {
|
||||
running: "green",
|
||||
queued: undefined,
|
||||
cooldown: "amber",
|
||||
blocked: "red",
|
||||
idle: undefined,
|
||||
};
|
||||
|
||||
@@ -15,7 +18,7 @@ const ACTIVITY_TONE: Record<AgentActivity, "green" | "violet" | "amber" | undefi
|
||||
* Floating profile card for the agent selected on the office floor. The page
|
||||
* owns its placement (it follows the sprite); the card only sizes itself.
|
||||
*/
|
||||
export function AgentDetailCard({ agent, onClose }: { agent: OfficeAgentInput; onClose: () => void }) {
|
||||
export function AgentDetailCard({ agent, isCeo, onClose }: { agent: OfficeAgentInput; isCeo: boolean; onClose: () => void }) {
|
||||
return (
|
||||
<div
|
||||
role="dialog"
|
||||
@@ -24,30 +27,30 @@ export function AgentDetailCard({ agent, onClose }: { agent: OfficeAgentInput; o
|
||||
width: 264,
|
||||
background: "var(--panel)",
|
||||
border: "1px solid var(--border-strong)",
|
||||
borderRadius: 12,
|
||||
boxShadow: "0 12px 32px rgba(16,16,24,0.18)",
|
||||
padding: 14,
|
||||
}}
|
||||
>
|
||||
<div className="row" style={{ gap: 10, alignItems: "flex-start" }}>
|
||||
<Avatar name={agent.name} size="lg" bot />
|
||||
<PixelAvatar id={agent.id} isCeo={isCeo} />
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ fontSize: 14, fontWeight: 600, lineHeight: 1.3, wordBreak: "break-word" }}>{agent.name}</div>
|
||||
<div style={{ fontSize: 12, color: "var(--text-2)", marginTop: 1, wordBreak: "break-word" }}>{agent.title}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", lineHeight: 1.3, wordBreak: "break-word" }}>{agent.name}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-2)", marginTop: 1, wordBreak: "break-word" }}>{agent.title}</div>
|
||||
</div>
|
||||
<IconButton icon="x" label={t("Close agent details")} onClick={onClose} />
|
||||
</div>
|
||||
<div className="row" style={{ gap: 6, marginTop: 10, flexWrap: "wrap" }}>
|
||||
<Pill>{agent.department}</Pill>
|
||||
<Pill>{roleLevelLabel(agent.roleLevel)}</Pill>
|
||||
<Pill tone={ACTIVITY_TONE[agent.activity]} dot>{officeActivityLabel(agent.activity)}</Pill>
|
||||
<Pill tone={STATE_TONE[agent.status.state]} dot>{officeStateLabel(agent.status.state)}</Pill>
|
||||
</div>
|
||||
{agent.status.hold && <div style={{ marginTop: 10 }}><TaskHoldNotice hold={agent.status.hold} /></div>}
|
||||
{agent.taskTitle && (
|
||||
<div className="row" style={{ gap: 7, marginTop: 12, alignItems: "flex-start" }}>
|
||||
<Icon name="work" size={13} color="var(--text-3)" />
|
||||
<Icon name="work" color="var(--text-3)" />
|
||||
<span
|
||||
style={{
|
||||
fontSize: 12,
|
||||
fontSize: "var(--fs-body)",
|
||||
color: "var(--text-2)",
|
||||
lineHeight: 1.45,
|
||||
display: "-webkit-box",
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
import { useEffect, useRef } from "react";
|
||||
import { appearanceFor, drawPerson } from "./sprites";
|
||||
|
||||
const W = 24;
|
||||
const H = 24;
|
||||
/** Each sprite pixel shows as a 2×2 block. */
|
||||
const ZOOM = 2;
|
||||
|
||||
/** The person as the office draws them, from the shoulders up, so a face on the org chart is the same face at the desk. */
|
||||
export function PixelAvatar({ id, isCeo }: { id: string; isCeo: boolean }) {
|
||||
const ref = useRef<HTMLCanvasElement>(null);
|
||||
useEffect(() => {
|
||||
const canvas = ref.current!;
|
||||
const scale = ZOOM * Math.max(1, Math.ceil(window.devicePixelRatio));
|
||||
canvas.width = W * scale;
|
||||
canvas.height = H * scale;
|
||||
const ctx = canvas.getContext("2d");
|
||||
if (!ctx) throw new Error("The avatar canvas has no 2D context.");
|
||||
ctx.imageSmoothingEnabled = false;
|
||||
ctx.setTransform(scale, 0, 0, scale, 0, 0);
|
||||
drawPerson(ctx, W / 2, H + 10, appearanceFor(id, isCeo), { facing: "south", walkPhase: 0, working: false, carrying: null, timeMs: 0, animSeed: 0 }, isCeo);
|
||||
}, [id, isCeo]);
|
||||
return <canvas ref={ref} className="pixel-avatar" data-person={id} aria-hidden="true" style={{ width: W * ZOOM, height: H * ZOOM }} />;
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
import type { TaskHold } from "../../../../shared/domain";
|
||||
import { t } from "../../i18n/i18n";
|
||||
|
||||
/** What an agent in the office is doing, from real records: a running session, work held for the operator or a provider cooldown, a queued session, or nothing. */
|
||||
export type OfficeState = "running" | "blocked" | "cooldown" | "queued" | "idle";
|
||||
|
||||
export interface OfficeStatus {
|
||||
state: OfficeState;
|
||||
/** What holds a blocked or cooling-down agent. */
|
||||
hold: TaskHold | null;
|
||||
}
|
||||
|
||||
interface Inputs {
|
||||
runs: Array<{ agentId: string | null; state: string }>;
|
||||
tasks: Array<{ id: string; assigneeAgentId: string | null; status: string; hold: TaskHold | null }>;
|
||||
approvals: Array<{ sourceEntityType: string | null; sourceEntityId: string | null; state: string }>;
|
||||
}
|
||||
|
||||
/** The one state an agent shows: running beats blocked, which beats a cooldown, which beats a queued session. */
|
||||
export function officeStatus(agentId: string, inputs: Inputs): OfficeStatus {
|
||||
const runs = inputs.runs.filter((run) => run.agentId === agentId);
|
||||
if (runs.some((run) => run.state === "running")) return { state: "running", hold: null };
|
||||
const open = inputs.tasks.filter((task) => task.assigneeAgentId === agentId && task.status !== "done");
|
||||
const holds = open.filter((task) => task.hold !== null).map((task) => task.hold!);
|
||||
const operator = holds.find((hold) => hold.waitingOn === "operator");
|
||||
if (operator) return { state: "blocked", hold: operator };
|
||||
const awaitingApproval = inputs.approvals.some((approval) => approval.state === "pending" && approval.sourceEntityType === "task" && open.some((task) => task.id === approval.sourceEntityId));
|
||||
if (awaitingApproval) return { state: "blocked", hold: { reason: t("Waiting for your approval."), waitingOn: "operator", resumesAt: null } };
|
||||
const provider = holds.find((hold) => hold.waitingOn === "provider");
|
||||
if (provider) return { state: "cooldown", hold: provider };
|
||||
if (runs.some((run) => run.state === "queued")) return { state: "queued", hold: null };
|
||||
return { state: "idle", hold: null };
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
import type { Rect, Vec } from "./office-types";
|
||||
|
||||
// 2:1 isometric projection of the plan; the simulation stays in plan units, depth grows with x + y.
|
||||
const K = 0.5;
|
||||
/** Head room above the plan's north edge for the back wall and signs. */
|
||||
export const SKY_MARGIN = 64;
|
||||
/** Height of the back (north and west) walls, in iso pixels. */
|
||||
export const BACK_WALL_H = 48;
|
||||
|
||||
export interface IsoFrame {
|
||||
originX: number;
|
||||
size: { w: number; h: number };
|
||||
}
|
||||
|
||||
export function isoFrame(world: { w: number; h: number }): IsoFrame {
|
||||
return { originX: world.h * K, size: { w: (world.w + world.h) * K, h: ((world.w + world.h) * K) / 2 + SKY_MARGIN } };
|
||||
}
|
||||
|
||||
export function toIso(frame: IsoFrame, p: Vec, z = 0): Vec {
|
||||
return { x: frame.originX + (p.x - p.y) * K, y: SKY_MARGIN + ((p.x + p.y) * K) / 2 - z };
|
||||
}
|
||||
|
||||
/** The ground-plane point under an iso pixel. */
|
||||
export function fromIso(frame: IsoFrame, s: Vec): Vec {
|
||||
const difference = (s.x - frame.originX) / K;
|
||||
const sum = ((s.y - SKY_MARGIN) * 2) / K;
|
||||
return { x: (sum + difference) / 2, y: (sum - difference) / 2 };
|
||||
}
|
||||
|
||||
export function depthOf(p: Vec): number {
|
||||
return p.x + p.y;
|
||||
}
|
||||
|
||||
/** Draws plan-space art (rects in plan units) flat onto the iso ground. */
|
||||
export function setGroundTransform(ctx: CanvasRenderingContext2D, frame: IsoFrame): void {
|
||||
ctx.transform(K, K / 2, -K, K / 2, frame.originX, SKY_MARGIN);
|
||||
}
|
||||
|
||||
/** Draws face-space art onto a south-facing face at plan y = `planeY` whose top is at height `topZ`: x runs along the face, y down from its top. */
|
||||
export function setSouthFaceTransform(ctx: CanvasRenderingContext2D, frame: IsoFrame, planeY: number, topZ: number): void {
|
||||
ctx.transform(K, K / 2, 0, 1, frame.originX - planeY * K, SKY_MARGIN + (planeY * K) / 2 - topZ);
|
||||
}
|
||||
|
||||
export interface BoxColors {
|
||||
top: string;
|
||||
south: string;
|
||||
east: string;
|
||||
}
|
||||
|
||||
/** An extruded block over a plan footprint, from `z` up `height` iso pixels; its top and two camera-facing sides. */
|
||||
export function drawBox(ctx: CanvasRenderingContext2D, frame: IsoFrame, foot: Rect, z: number, height: number, colors: BoxColors): void {
|
||||
const x0 = foot.x;
|
||||
const y0 = foot.y;
|
||||
const x1 = foot.x + foot.w;
|
||||
const y1 = foot.y + foot.h;
|
||||
const top = z + height;
|
||||
polygon(ctx, colors.south, [toIso(frame, { x: x0, y: y1 }, z), toIso(frame, { x: x1, y: y1 }, z), toIso(frame, { x: x1, y: y1 }, top), toIso(frame, { x: x0, y: y1 }, top)]);
|
||||
polygon(ctx, colors.east, [toIso(frame, { x: x1, y: y1 }, z), toIso(frame, { x: x1, y: y0 }, z), toIso(frame, { x: x1, y: y0 }, top), toIso(frame, { x: x1, y: y1 }, top)]);
|
||||
polygon(ctx, colors.top, [toIso(frame, { x: x0, y: y0 }, top), toIso(frame, { x: x1, y: y0 }, top), toIso(frame, { x: x1, y: y1 }, top), toIso(frame, { x: x0, y: y1 }, top)]);
|
||||
}
|
||||
|
||||
function polygon(ctx: CanvasRenderingContext2D, color: string, points: Vec[]): void {
|
||||
ctx.fillStyle = color;
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(Math.round(points[0]!.x), Math.round(points[0]!.y));
|
||||
for (const point of points.slice(1)) ctx.lineTo(Math.round(point.x), Math.round(point.y));
|
||||
ctx.closePath();
|
||||
ctx.fill();
|
||||
}
|
||||
|
||||
/** Sprite box around a person's feet in iso pixels, matching how sprites are drawn. */
|
||||
const SPRITE = { halfW: 10, above: 40, below: 4 };
|
||||
|
||||
/** The person whose drawn sprite covers an iso point, frontmost first; at equal depth the later one, as it is drawn on top. */
|
||||
export function pickAt<T extends Vec>(frame: IsoFrame, people: T[], point: Vec): T | null {
|
||||
let hit: T | null = null;
|
||||
for (const person of people) {
|
||||
const feet = toIso(frame, person);
|
||||
const inside = Math.abs(point.x - feet.x) <= SPRITE.halfW && point.y >= feet.y - SPRITE.above && point.y <= feet.y + SPRITE.below;
|
||||
if (inside && (hit === null || depthOf(person) >= depthOf(hit))) hit = person;
|
||||
}
|
||||
return hit;
|
||||
}
|
||||
|
||||
/** Screen size of one iso pixel in CSS px: two CSS px rounded to whole device pixels. */
|
||||
export function isoPixelSize(devicePixelRatio: number): number {
|
||||
return Math.max(1, Math.round(2 * devicePixelRatio)) / devicePixelRatio;
|
||||
}
|
||||
@@ -1,12 +1,15 @@
|
||||
import type { AgentActivity, Camera, FloorPlan, Rect } from "./office-types";
|
||||
import { deskScreenRect, drawWorld } from "./scene-renderer";
|
||||
import { skyScene } from "./sky";
|
||||
import type { Camera, FloorPlan, Rect } from "./office-types";
|
||||
import type { OfficeState } from "./agent-state";
|
||||
import { drawBackWalls, drawGround, sceneDrawables, type Drawable } from "./scene-renderer";
|
||||
import { depthOf, toIso, type IsoFrame } from "./iso";
|
||||
import { skyScene, weatherFor } from "./sky";
|
||||
import { drawPerson, type Carrying, type Facing, type SpriteAppearance } from "./sprites";
|
||||
import type { DayPart, Season } from "../../shared/palette-clock";
|
||||
|
||||
export interface RenderPerson {
|
||||
id: string;
|
||||
name: string;
|
||||
activity: AgentActivity;
|
||||
state: OfficeState;
|
||||
x: number;
|
||||
y: number;
|
||||
desk: Rect | null;
|
||||
@@ -19,10 +22,40 @@ export interface RenderPerson {
|
||||
carrying: Carrying;
|
||||
}
|
||||
|
||||
const ACTIVITY_DOT: Partial<Record<AgentActivity, string>> = {
|
||||
active: "#34d399",
|
||||
thinking: "#818cf8",
|
||||
busy: "#f59e0b",
|
||||
/** One frame's inputs: the scene in iso pixels, and how those pixels land on the screen. */
|
||||
export interface OfficeFrame {
|
||||
frame: IsoFrame;
|
||||
plan: FloorPlan;
|
||||
/** Camera top-left, in iso pixels. */
|
||||
camera: Camera;
|
||||
/** CSS px per iso pixel. */
|
||||
pixel: number;
|
||||
/** CSS px per pixel-font pixel, for the crisp text drawn over the scene. */
|
||||
fontScale: number;
|
||||
viewW: number;
|
||||
viewH: number;
|
||||
people: RenderPerson[];
|
||||
timeMs: number;
|
||||
clock: Date;
|
||||
dayPart: DayPart;
|
||||
season: Season;
|
||||
selectedId: string | null;
|
||||
}
|
||||
|
||||
/** Marker over the head: green running, grey queued, amber cooling down, red blocked; none when idle. */
|
||||
const STATE_MARK: Partial<Record<OfficeState, string>> = {
|
||||
running: "#34d399",
|
||||
queued: "#9aa3b2",
|
||||
cooldown: "#f59e0b",
|
||||
blocked: "#ef4444",
|
||||
};
|
||||
|
||||
/** The day part washes over the whole floor: warm at dawn and dusk, blue at night. */
|
||||
const DAY_TINT: Record<DayPart, string | null> = {
|
||||
dawn: "#f3d9d6",
|
||||
day: null,
|
||||
dusk: "#f0c6a0",
|
||||
night: "#7d8bc0",
|
||||
};
|
||||
|
||||
export function hashString(value: string): number {
|
||||
@@ -31,94 +64,98 @@ export function hashString(value: string): number {
|
||||
return Math.abs(hash);
|
||||
}
|
||||
|
||||
/**
|
||||
* Composes one frame: static world under the camera transform, then desks'
|
||||
* activity glow, then people (painter's order by y) with full-name labels.
|
||||
*/
|
||||
export function renderOffice(
|
||||
ctx: CanvasRenderingContext2D,
|
||||
viewW: number,
|
||||
viewH: number,
|
||||
plan: FloorPlan,
|
||||
camera: Camera,
|
||||
people: RenderPerson[],
|
||||
timeMs: number,
|
||||
clock: Date,
|
||||
selectedId: string | null,
|
||||
): void {
|
||||
ctx.fillStyle = "#14161c";
|
||||
ctx.fillRect(0, 0, viewW, viewH);
|
||||
ctx.save();
|
||||
ctx.translate(-camera.x, -camera.y);
|
||||
/** Draws the scene at iso-pixel resolution on `scene`, depth-sorted, then scales it up unsmoothed onto `ctx` and writes labels in the pixel font. */
|
||||
export function renderOffice(ctx: CanvasRenderingContext2D, scene: HTMLCanvasElement, input: OfficeFrame): void {
|
||||
const sceneW = Math.ceil(input.viewW / input.pixel);
|
||||
const sceneH = Math.ceil(input.viewH / input.pixel);
|
||||
if (scene.width !== sceneW || scene.height !== sceneH) {
|
||||
scene.width = sceneW;
|
||||
scene.height = sceneH;
|
||||
}
|
||||
const sctx = scene.getContext("2d");
|
||||
if (!sctx) throw new Error("The office scene canvas has no 2D context.");
|
||||
sctx.setTransform(1, 0, 0, 1, 0, 0);
|
||||
sctx.fillStyle = "#14161c";
|
||||
sctx.fillRect(0, 0, sceneW, sceneH);
|
||||
sctx.translate(-Math.round(input.camera.x), -Math.round(input.camera.y));
|
||||
|
||||
drawWorld(ctx, plan, { x: camera.x, y: camera.y, w: viewW, h: viewH }, skyScene(clock));
|
||||
drawGround(sctx, input.frame, input.plan);
|
||||
drawBackWalls(sctx, input.frame, input.plan, { sky: skyScene(input.clock), weather: weatherFor(input.clock), clock: input.clock, timeMs: input.timeMs });
|
||||
const screens = new Map(input.people.filter((person) => person.desk).map((person) => [person.desk!, person.state]));
|
||||
const items: Drawable[] = [...sceneDrawables(input.frame, input.plan, input.season, screens, input.timeMs), ...input.people.map((person) => personDrawable(input, person))];
|
||||
items.sort((a, b) => a.depth - b.depth);
|
||||
for (const item of items) item.draw(sctx);
|
||||
|
||||
for (const person of people) {
|
||||
if (!person.desk) continue;
|
||||
if (person.activity !== "active" && person.activity !== "thinking") continue;
|
||||
const screen = deskScreenRect(person.desk);
|
||||
ctx.fillStyle = "#1c3a2c";
|
||||
ctx.fillRect(screen.x, screen.y, screen.w, screen.h);
|
||||
ctx.fillStyle = "#37d38a";
|
||||
const lines = 3 + (hashString(person.id) % 3);
|
||||
for (let i = 0; i < lines; i++) {
|
||||
const width = 6 + ((hashString(person.id) >> (i * 3)) % 14);
|
||||
ctx.fillRect(screen.x + 3, screen.y + 3 + i * 3, width, 1);
|
||||
}
|
||||
const tint = DAY_TINT[input.dayPart];
|
||||
if (tint) {
|
||||
sctx.setTransform(1, 0, 0, 1, 0, 0);
|
||||
sctx.globalCompositeOperation = "multiply";
|
||||
sctx.fillStyle = tint;
|
||||
sctx.fillRect(0, 0, sceneW, sceneH);
|
||||
sctx.globalCompositeOperation = "source-over";
|
||||
}
|
||||
|
||||
const ordered = [...people].sort((a, b) => a.y - b.y);
|
||||
for (const person of ordered) {
|
||||
if (person.id === selectedId) {
|
||||
ctx.strokeStyle = "rgba(94,106,210,0.9)";
|
||||
ctx.lineWidth = 2;
|
||||
ctx.beginPath();
|
||||
ctx.ellipse(Math.round(person.x), Math.round(person.y) + 2, 13, 6, 0, 0, Math.PI * 2);
|
||||
ctx.stroke();
|
||||
}
|
||||
const working = (person.activity === "active" || person.activity === "thinking") && person.walkPhase === 0;
|
||||
drawPerson(ctx, person.x, person.y, person.appearance, {
|
||||
facing: person.facing,
|
||||
walkPhase: person.walkPhase,
|
||||
working,
|
||||
carrying: person.carrying,
|
||||
timeMs,
|
||||
animSeed: person.animSeed,
|
||||
}, person.isCeo);
|
||||
const dot = ACTIVITY_DOT[person.activity];
|
||||
if (dot) {
|
||||
ctx.fillStyle = dot;
|
||||
ctx.beginPath();
|
||||
ctx.arc(Math.round(person.x) + 10, Math.round(person.y) - 36, 3, 0, Math.PI * 2);
|
||||
ctx.fill();
|
||||
}
|
||||
}
|
||||
for (const person of ordered) drawNameLabel(ctx, person);
|
||||
|
||||
ctx.restore();
|
||||
ctx.imageSmoothingEnabled = false;
|
||||
ctx.drawImage(scene, 0, 0, sceneW * input.pixel, sceneH * input.pixel);
|
||||
drawLabels(ctx, input);
|
||||
}
|
||||
|
||||
function drawNameLabel(ctx: CanvasRenderingContext2D, person: RenderPerson): void {
|
||||
ctx.font = "600 9px -apple-system, 'Segoe UI', sans-serif";
|
||||
const width = Math.ceil(ctx.measureText(person.name).width) + 10;
|
||||
const x = Math.round(person.x - width / 2);
|
||||
const y = Math.round(person.y + 7);
|
||||
ctx.fillStyle = person.isPlayer ? "rgba(94,106,210,0.92)" : "rgba(22,22,28,0.78)";
|
||||
drawRoundedRect(ctx, x, y, width, 13, 4);
|
||||
ctx.fillStyle = "#f2f2f5";
|
||||
function personDrawable(input: OfficeFrame, person: RenderPerson): Drawable {
|
||||
return {
|
||||
// Just in front of anything sharing the same footprint centre.
|
||||
depth: depthOf(person) + 0.5,
|
||||
draw: (ctx) => {
|
||||
const feet = toIso(input.frame, person);
|
||||
if (person.id === input.selectedId) {
|
||||
ctx.fillStyle = "rgba(94,106,210,0.9)";
|
||||
ctx.fillRect(Math.round(feet.x) - 12, Math.round(feet.y), 24, 2);
|
||||
ctx.fillRect(Math.round(feet.x) - 14, Math.round(feet.y) - 2, 2, 2);
|
||||
ctx.fillRect(Math.round(feet.x) + 12, Math.round(feet.y) - 2, 2, 2);
|
||||
}
|
||||
const working = person.state === "running" && person.walkPhase === 0;
|
||||
drawPerson(ctx, feet.x, feet.y, person.appearance, {
|
||||
facing: person.facing,
|
||||
walkPhase: person.walkPhase,
|
||||
working,
|
||||
carrying: person.carrying,
|
||||
timeMs: input.timeMs,
|
||||
animSeed: person.animSeed,
|
||||
}, person.isCeo);
|
||||
const dot = STATE_MARK[person.state];
|
||||
if (dot) {
|
||||
ctx.fillStyle = dot;
|
||||
ctx.fillRect(Math.round(feet.x) + 8, Math.round(feet.y) - 40, 4, 4);
|
||||
}
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/** Names under people and room signs over doors, in the pixel font at screen resolution so they stay crisp. */
|
||||
function drawLabels(ctx: CanvasRenderingContext2D, input: OfficeFrame): void {
|
||||
const size = 12 * input.fontScale;
|
||||
ctx.font = `${size}px "Fusion Pixel"`;
|
||||
ctx.textAlign = "center";
|
||||
ctx.textBaseline = "middle";
|
||||
ctx.fillText(person.name, person.x, y + 7);
|
||||
ctx.textBaseline = "top";
|
||||
const screen = (x: number, y: number, z = 0) => {
|
||||
const iso = toIso(input.frame, { x, y }, z);
|
||||
return { x: Math.round((iso.x - Math.round(input.camera.x)) * input.pixel), y: Math.round((iso.y - Math.round(input.camera.y)) * input.pixel) };
|
||||
};
|
||||
for (const room of input.plan.rooms) {
|
||||
const at = screen(room.doorCx, room.bounds.y + room.bounds.h, 22);
|
||||
plate(ctx, room.label, at.x, at.y - size, size, "rgba(47,42,37,0.9)");
|
||||
}
|
||||
for (const person of [...input.people].sort((a, b) => depthOf(a) - depthOf(b))) {
|
||||
const at = screen(person.x, person.y);
|
||||
plate(ctx, person.name, at.x, at.y + 6 * input.pixel, size, person.isPlayer ? "rgba(94,106,210,0.92)" : "rgba(22,22,28,0.78)");
|
||||
}
|
||||
ctx.textAlign = "start";
|
||||
ctx.textBaseline = "alphabetic";
|
||||
}
|
||||
|
||||
function drawRoundedRect(ctx: CanvasRenderingContext2D, x: number, y: number, w: number, h: number, r: number): void {
|
||||
ctx.beginPath();
|
||||
ctx.moveTo(x + r, y);
|
||||
ctx.arcTo(x + w, y, x + w, y + h, r);
|
||||
ctx.arcTo(x + w, y + h, x, y + h, r);
|
||||
ctx.arcTo(x, y + h, x, y, r);
|
||||
ctx.arcTo(x, y, x + w, y, r);
|
||||
ctx.fill();
|
||||
function plate(ctx: CanvasRenderingContext2D, text: string, cx: number, top: number, size: number, background: string): void {
|
||||
const width = Math.ceil(ctx.measureText(text).width) + size;
|
||||
ctx.fillStyle = background;
|
||||
ctx.fillRect(Math.round(cx - width / 2), top, width, Math.round(size * 1.5));
|
||||
ctx.fillStyle = "#f2f2f5";
|
||||
ctx.fillText(text, cx, top + Math.round(size * 0.25));
|
||||
}
|
||||
@@ -1,3 +1,4 @@
|
||||
import type { OfficeStatus } from "./agent-state";
|
||||
export interface Vec {
|
||||
x: number;
|
||||
y: number;
|
||||
@@ -61,8 +62,6 @@ export interface FloorPlan {
|
||||
entrance: Vec;
|
||||
}
|
||||
|
||||
export type AgentActivity = "active" | "thinking" | "busy" | "idle";
|
||||
|
||||
/** Snapshot-derived facts the office simulation needs about one agent. */
|
||||
export interface OfficeAgentInput {
|
||||
id: string;
|
||||
@@ -71,7 +70,7 @@ export interface OfficeAgentInput {
|
||||
title: string;
|
||||
department: string;
|
||||
roleLevel: string;
|
||||
activity: AgentActivity;
|
||||
status: OfficeStatus;
|
||||
taskTitle: string | null;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,101 @@
|
||||
import type { OfficeState } from "./agent-state";
|
||||
import type { Rect } from "./office-types";
|
||||
import { drawBox, setSouthFaceTransform, toIso, type IsoFrame } from "./iso";
|
||||
|
||||
/** Hand angles in radians, clockwise from twelve, for a local time. */
|
||||
export function clockHands(date: Date): { hour: number; minute: number } {
|
||||
const minutes = date.getMinutes();
|
||||
return {
|
||||
hour: (((date.getHours() % 12) + minutes / 60) / 12) * 2 * Math.PI,
|
||||
minute: (minutes / 60) * 2 * Math.PI,
|
||||
};
|
||||
}
|
||||
|
||||
/** A 16-pixel wall clock in wall-face coordinates (x along the wall, y down), showing the real time. */
|
||||
export function drawWallClock(ctx: CanvasRenderingContext2D, x: number, y: number, date: Date): void {
|
||||
ctx.fillStyle = "#3f3831";
|
||||
ctx.fillRect(x + 2, y, 12, 16);
|
||||
ctx.fillRect(x, y + 2, 16, 12);
|
||||
ctx.fillStyle = "#f2efe8";
|
||||
ctx.fillRect(x + 2, y + 2, 12, 12);
|
||||
ctx.fillStyle = "#8a8378";
|
||||
for (const [tx, ty] of [[7, 2], [12, 7], [7, 12], [2, 7]] as const) ctx.fillRect(x + tx, y + ty, 2, 1);
|
||||
const hands = clockHands(date);
|
||||
hand(ctx, x + 8, y + 8, hands.minute, 5, "#2b2622");
|
||||
hand(ctx, x + 8, y + 8, hands.hour, 3, "#b3543f");
|
||||
}
|
||||
|
||||
function hand(ctx: CanvasRenderingContext2D, cx: number, cy: number, angle: number, length: number, color: string): void {
|
||||
ctx.fillStyle = color;
|
||||
for (let step = 0; step <= length; step++) {
|
||||
ctx.fillRect(Math.round(cx + Math.sin(angle) * step - 0.5), Math.round(cy - Math.cos(angle) * step - 0.5), 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/** A desk monitor's screen on its south face: scrolling code while running, a progress dot for queued, an amber sweep for a cooldown, a blinking red mark when blocked, a standby light when idle. */
|
||||
export function drawMonitorScreen(ctx: CanvasRenderingContext2D, frame: IsoFrame, monitor: Rect, z: number, height: number, state: OfficeState, timeMs: number, seed: number): void {
|
||||
ctx.save();
|
||||
setSouthFaceTransform(ctx, frame, monitor.y + monitor.h, z + height);
|
||||
const glass = { x: monitor.x + 2, y: 2, w: monitor.w - 4, h: height - 4 };
|
||||
ctx.fillStyle = state === "running" ? "#0f2a1c" : state === "blocked" ? "#2a1012" : "#20242c";
|
||||
ctx.fillRect(glass.x, glass.y, glass.w, glass.h);
|
||||
if (state === "running") {
|
||||
const scroll = Math.floor(timeMs / 350);
|
||||
ctx.fillStyle = "#37d38a";
|
||||
for (let row = 0; row < 4; row++) {
|
||||
const width = 4 + ((seed * 7 + (scroll + row) * 13) % (glass.w - 6));
|
||||
ctx.fillRect(glass.x + 1 + (row % 2) * 2, glass.y + 1 + row * 2, width, 1);
|
||||
}
|
||||
if (Math.floor(timeMs / 500) % 2 === 0) ctx.fillRect(glass.x + glass.w - 3, glass.y + glass.h - 2, 2, 1);
|
||||
} else if (state === "queued") {
|
||||
ctx.fillStyle = "#9aa3b2";
|
||||
for (let dot = 0; dot <= Math.floor(timeMs / 400) % 3; dot++) ctx.fillRect(glass.x + 2 + dot * 3, glass.y + glass.h / 2, 2, 1);
|
||||
} else if (state === "cooldown") {
|
||||
ctx.fillStyle = "#e0a23a";
|
||||
ctx.fillRect(glass.x + 1, glass.y + glass.h / 2, Math.max(1, (glass.w - 2) * (1 - ((timeMs / 4000) % 1))), 1);
|
||||
} else if (state === "blocked") {
|
||||
if (Math.floor(timeMs / 500) % 2 === 0) {
|
||||
ctx.fillStyle = "#ef4444";
|
||||
const cx = Math.round(glass.x + glass.w / 2);
|
||||
ctx.fillRect(cx, glass.y + 1, 1, glass.h - 4);
|
||||
ctx.fillRect(cx, glass.y + glass.h - 2, 1, 1);
|
||||
}
|
||||
} else {
|
||||
ctx.fillStyle = "#e0a23a";
|
||||
ctx.fillRect(glass.x + glass.w - 2, glass.y + glass.h - 1, 1, 1);
|
||||
}
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
/** The snack bar's coffee machine: body, cap, a lit button and a cup, with steam curling up from the cup. */
|
||||
export function drawCoffeeMachine(ctx: CanvasRenderingContext2D, frame: IsoFrame, foot: Rect, z: number, timeMs: number): void {
|
||||
drawBox(ctx, frame, foot, z, 14, { top: "#454b52", south: "#2e3238", east: "#23262b" });
|
||||
drawBox(ctx, frame, { x: foot.x + 1, y: foot.y + 1, w: foot.w - 2, h: 5 }, z + 14, 3, { top: "#5a616a", south: "#3c4249", east: "#30353b" });
|
||||
ctx.save();
|
||||
setSouthFaceTransform(ctx, frame, foot.y + foot.h, z + 14);
|
||||
ctx.fillStyle = Math.floor(timeMs / 700) % 2 === 0 ? "#e2553b" : "#8f3426";
|
||||
ctx.fillRect(foot.x + 2, 2, 2, 2);
|
||||
ctx.fillStyle = "#d8d3c8";
|
||||
ctx.fillRect(foot.x + foot.w / 2 - 2, 9, 4, 4);
|
||||
ctx.restore();
|
||||
const cup = toIso(frame, { x: foot.x + foot.w / 2, y: foot.y + foot.h }, z + 6);
|
||||
for (let puff = 0; puff < 3; puff++) {
|
||||
const rise = ((timeMs / 120 + puff * 5) % 15);
|
||||
ctx.fillStyle = `rgba(242,242,245,${0.75 * (1 - rise / 15)})`;
|
||||
ctx.fillRect(Math.round(cup.x + Math.sin((rise + puff) / 2) * 1.5), Math.round(cup.y - 4 - rise), 1, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/** A toilet against the back wall: tank and bowl in porcelain white, the bowl's opening shaded. */
|
||||
export function drawToilet(ctx: CanvasRenderingContext2D, frame: IsoFrame, cx: number, backY: number): void {
|
||||
const porcelain = { top: "#f4f6f8", south: "#d9dee4", east: "#c3c9d0" };
|
||||
drawBox(ctx, frame, { x: cx - 6, y: backY, w: 12, h: 5 }, 0, 16, porcelain);
|
||||
drawBox(ctx, frame, { x: cx - 5, y: backY + 5, w: 10, h: 11 }, 0, 8, porcelain);
|
||||
drawBox(ctx, frame, { x: cx - 3, y: backY + 7, w: 6, h: 7 }, 8, 0, { top: "#9fb2c4", south: "#9fb2c4", east: "#9fb2c4" });
|
||||
}
|
||||
|
||||
/** A wash basin set into a counter top at height `z`: a pale rim around a shaded bowl. */
|
||||
export function drawBasin(ctx: CanvasRenderingContext2D, frame: IsoFrame, basin: Rect, z: number): void {
|
||||
drawBox(ctx, frame, basin, z, 0, { top: "#e4ebf2", south: "#e4ebf2", east: "#e4ebf2" });
|
||||
drawBox(ctx, frame, { x: basin.x + 4, y: basin.y + 3, w: basin.w - 8, h: basin.h - 6 }, z, 0, { top: "#8fa3b7", south: "#8fa3b7", east: "#8fa3b7" });
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
/** Agents who come to the office, in hire order: the office and the org chart read the same list. */
|
||||
export function officeRoster<T extends { id: string; lifecycle: string; createdAt: string }>(agents: T[]): T[] {
|
||||
return agents
|
||||
.filter((agent) => agent.lifecycle === "active")
|
||||
.sort((a, b) => a.createdAt.localeCompare(b.createdAt) || a.id.localeCompare(b.id));
|
||||
}
|
||||
|
||||
/** The first c-suite agent on the roster holds the CEO office and wears the CEO's look. */
|
||||
export function ceoIdOf(roster: Array<{ id: string; roleLevel: string }>): string | null {
|
||||
return roster.find((agent) => agent.roleLevel === "c_suite")?.id ?? null;
|
||||
}
|
||||
@@ -1,24 +1,33 @@
|
||||
import type { OfficeState } from "./agent-state";
|
||||
import type { FloorPlan, Rect, RoomSpec } from "./office-types";
|
||||
import { WALL } from "./floor-plan";
|
||||
import { drawWindowSky, type SkyScene } from "./sky";
|
||||
import { drawWeather, drawWindowSky, type SkyScene, type Weather } from "./sky";
|
||||
import { BACK_WALL_H, depthOf, drawBox, setGroundTransform, setSouthFaceTransform, type BoxColors, type IsoFrame } from "./iso";
|
||||
import { drawBasin, drawCoffeeMachine, drawMonitorScreen, drawToilet, drawWallClock } from "./props";
|
||||
import type { Season } from "../../shared/palette-clock";
|
||||
|
||||
/**
|
||||
* Draws the static office world in a 3/4 top-down pixel style: wood floor,
|
||||
* room interiors, wall faces with windows, furniture, and door signage.
|
||||
* Everything here is a pure function of the floor plan and the visible rect.
|
||||
*/
|
||||
/** One thing in the scene that people can stand in front of or behind; drawn in depth order with them. */
|
||||
export interface Drawable {
|
||||
depth: number;
|
||||
draw: (ctx: CanvasRenderingContext2D) => void;
|
||||
}
|
||||
|
||||
/** Height of the visible north-wall face inside each room. */
|
||||
export const WALL_FACE_H = 48;
|
||||
/** A piece of the scene and the plan footprint it sorts by. */
|
||||
export interface SceneDrawable extends Drawable {
|
||||
foot: Rect;
|
||||
}
|
||||
|
||||
/** Interior walls are cut away to this height so rooms stay visible. */
|
||||
const INNER_WALL_H = 14;
|
||||
/** Longest side of a block that sorts as one piece. */
|
||||
const PIECE = 32;
|
||||
|
||||
const PALETTE = {
|
||||
wood: "#b08a62",
|
||||
woodSeam: "#9c7852",
|
||||
corridor: "#a8815c",
|
||||
wallFill: "#4c4239",
|
||||
wallEdge: "#3b332c",
|
||||
wallFace: "#6b5f52",
|
||||
wallFaceShadow: "#5d5246",
|
||||
wall: "#6b5f52",
|
||||
wallTop: "#4c4239",
|
||||
baseboard: "#4f463c",
|
||||
ceoCarpet: "#5c6a94",
|
||||
ceoCarpetEdge: "#505d85",
|
||||
@@ -28,50 +37,42 @@ const PALETTE = {
|
||||
snackTileB: "#cbb891",
|
||||
restTileA: "#adbfd2",
|
||||
restTileB: "#9db0c5",
|
||||
deskWood: "#8a6d4c",
|
||||
deskWoodDark: "#75593b",
|
||||
deskLeg: "#5f4832",
|
||||
screenOff: "#20242c",
|
||||
monitorShell: "#4b5058",
|
||||
desk: "#8a6d4c",
|
||||
deskExec: "#6a5238",
|
||||
monitor: "#4b5058",
|
||||
chair: "#3d4148",
|
||||
chairDark: "#33373d",
|
||||
frame: "#3f3831",
|
||||
signPlate: "#2f2a25",
|
||||
signText: "#d8cfc2",
|
||||
panelSeam: "#5d5246",
|
||||
} as const;
|
||||
|
||||
export function drawWorld(ctx: CanvasRenderingContext2D, plan: FloorPlan, view: Rect, sky: SkyScene): void {
|
||||
drawFloor(ctx, plan, view);
|
||||
for (const room of plan.rooms) drawRoomFloor(ctx, room);
|
||||
drawStructure(ctx, plan, sky);
|
||||
for (const room of plan.rooms) drawRoomFurniture(ctx, plan, room);
|
||||
drawCorridorPlants(ctx, plan);
|
||||
for (const desk of plan.desks) {
|
||||
if (rectsTouch(view, expand(desk.bounds, 40))) drawDesk(ctx, desk.bounds, false);
|
||||
}
|
||||
for (const room of plan.rooms) drawDoorSign(ctx, room);
|
||||
drawEntrance(ctx, plan);
|
||||
const LEAVES: Record<Season, { leaf: string; light: string }> = {
|
||||
spring: { leaf: "#5f9a52", light: "#e9a3c2" },
|
||||
summer: { leaf: "#3f7f3a", light: "#6fb25c" },
|
||||
autumn: { leaf: "#b5652a", light: "#e0a23a" },
|
||||
winter: { leaf: "#5a7466", light: "#e8eef2" },
|
||||
};
|
||||
|
||||
/** Top, south and east faces of a block from one base colour: lit from above, the east side darkest. */
|
||||
export function faces(hex: string): BoxColors {
|
||||
return { top: hex, south: shade(hex, 0.82), east: shade(hex, 0.66) };
|
||||
}
|
||||
|
||||
/** The monitor screen glass for a desk; the activity glow overlay reuses it. */
|
||||
export function deskScreenRect(desk: Rect): Rect {
|
||||
return { x: desk.x + desk.w / 2 - 13, y: desk.y - 15, w: 26, h: 15 };
|
||||
}
|
||||
|
||||
function drawFloor(ctx: CanvasRenderingContext2D, plan: FloorPlan, view: Rect): void {
|
||||
/** Floor, rugs and tiles, flat on the ground plane. */
|
||||
export function drawGround(ctx: CanvasRenderingContext2D, frame: IsoFrame, plan: FloorPlan): void {
|
||||
ctx.save();
|
||||
setGroundTransform(ctx, frame);
|
||||
const { w, h } = plan.world;
|
||||
ctx.fillStyle = PALETTE.wood;
|
||||
ctx.fillRect(0, 0, w, h);
|
||||
ctx.fillStyle = PALETTE.woodSeam;
|
||||
const top = Math.max(0, Math.floor(view.y / 16) * 16);
|
||||
const bottom = Math.min(h, view.y + view.h);
|
||||
for (let y = top; y < bottom; y += 16) {
|
||||
for (let y = 0; y < h; y += 16) {
|
||||
ctx.fillRect(0, y, w, 1);
|
||||
const offset = (y / 16) % 2 === 0 ? 0 : 48;
|
||||
for (let x = offset; x < w; x += 96) ctx.fillRect(x, y, 1, 16);
|
||||
for (let x = (y / 16) % 2 === 0 ? 0 : 48; x < w; x += 96) ctx.fillRect(x, y, 1, 16);
|
||||
}
|
||||
ctx.fillStyle = PALETTE.corridor;
|
||||
ctx.fillRect(WALL, 288, plan.world.w - 2 * WALL, 64);
|
||||
ctx.fillRect(WALL, 288, w - 2 * WALL, 64);
|
||||
for (const room of plan.rooms) drawRoomFloor(ctx, room);
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
function drawRoomFloor(ctx: CanvasRenderingContext2D, room: RoomSpec): void {
|
||||
@@ -84,9 +85,7 @@ function drawRoomFloor(ctx: CanvasRenderingContext2D, room: RoomSpec): void {
|
||||
ctx.strokeRect(b.x + 6, b.y + 6, b.w - 12, b.h - 12);
|
||||
return;
|
||||
}
|
||||
const [tileA, tileB] = room.kind === "snack"
|
||||
? [PALETTE.snackTileA, PALETTE.snackTileB]
|
||||
: [PALETTE.restTileA, PALETTE.restTileB];
|
||||
const [tileA, tileB] = room.kind === "snack" ? [PALETTE.snackTileA, PALETTE.snackTileB] : [PALETTE.restTileA, PALETTE.restTileB];
|
||||
for (let ty = 0; ty < b.h; ty += 16) {
|
||||
for (let tx = 0; tx < b.w; tx += 16) {
|
||||
ctx.fillStyle = ((tx + ty) / 16) % 2 === 0 ? tileA : tileB;
|
||||
@@ -95,280 +94,203 @@ function drawRoomFloor(ctx: CanvasRenderingContext2D, room: RoomSpec): void {
|
||||
}
|
||||
}
|
||||
|
||||
function drawStructure(ctx: CanvasRenderingContext2D, plan: FloorPlan, sky: SkyScene): void {
|
||||
/** What the back walls show: the sky and weather outside, and the time for the wall clock. */
|
||||
export interface Outside {
|
||||
sky: SkyScene;
|
||||
weather: Weather;
|
||||
clock: Date;
|
||||
timeMs: number;
|
||||
}
|
||||
|
||||
/** The tall north and west walls, which everything stands in front of, with panels, windows, a clock and wall art on the north face. */
|
||||
export function drawBackWalls(ctx: CanvasRenderingContext2D, frame: IsoFrame, plan: FloorPlan, outside: Outside): void {
|
||||
const { w, h } = plan.world;
|
||||
ctx.fillStyle = PALETTE.wallFill;
|
||||
ctx.fillRect(0, 0, w, WALL);
|
||||
ctx.fillRect(0, h - WALL, w, WALL);
|
||||
ctx.fillRect(0, WALL, WALL, 280);
|
||||
ctx.fillRect(0, 344, WALL, h - 344 - WALL);
|
||||
ctx.fillRect(w - WALL, WALL, WALL, h - 2 * WALL);
|
||||
|
||||
for (const room of plan.rooms) {
|
||||
const b = room.bounds;
|
||||
ctx.fillStyle = PALETTE.wallFace;
|
||||
ctx.fillRect(b.x, b.y, b.w, WALL_FACE_H);
|
||||
ctx.fillStyle = PALETTE.wallFaceShadow;
|
||||
ctx.fillRect(b.x, b.y + WALL_FACE_H - 6, b.w, 6);
|
||||
ctx.fillStyle = PALETTE.baseboard;
|
||||
ctx.fillRect(b.x, b.y + WALL_FACE_H, b.w, 2);
|
||||
drawRoomWindows(ctx, room, sky);
|
||||
}
|
||||
|
||||
ctx.fillStyle = PALETTE.wallFill;
|
||||
ctx.fillRect(304, WALL, WALL, 272);
|
||||
ctx.fillRect(624, WALL, WALL, 272);
|
||||
ctx.fillRect(896, WALL, WALL, 272);
|
||||
for (const room of plan.rooms) drawSouthWall(ctx, room);
|
||||
ctx.fillStyle = PALETTE.wallEdge;
|
||||
const wall = faces(PALETTE.wall);
|
||||
drawBox(ctx, frame, { x: 0, y: WALL, w: WALL, h: 280 }, 0, BACK_WALL_H, wall);
|
||||
drawBox(ctx, frame, { x: 0, y: 344, w: WALL, h: h - 344 - WALL }, 0, BACK_WALL_H, wall);
|
||||
drawBox(ctx, frame, { x: 0, y: 0, w, h: WALL }, 0, BACK_WALL_H, { ...wall, top: PALETTE.wallTop });
|
||||
ctx.save();
|
||||
setSouthFaceTransform(ctx, frame, WALL, BACK_WALL_H);
|
||||
ctx.fillStyle = PALETTE.wallTop;
|
||||
ctx.fillRect(0, 0, w, 2);
|
||||
}
|
||||
|
||||
function drawSouthWall(ctx: CanvasRenderingContext2D, room: RoomSpec): void {
|
||||
const b = room.bounds;
|
||||
const y = b.y + b.h;
|
||||
const gapL = room.doorCx - 24;
|
||||
const gapR = room.doorCx + 24;
|
||||
ctx.fillStyle = PALETTE.wallFill;
|
||||
ctx.fillRect(b.x - WALL, y, gapL - b.x + WALL, WALL);
|
||||
ctx.fillRect(gapR, y, b.x + b.w - gapR + WALL, WALL);
|
||||
ctx.fillStyle = PALETTE.wallEdge;
|
||||
ctx.fillRect(b.x - WALL, y + WALL - 2, gapL - b.x + WALL, 2);
|
||||
ctx.fillRect(gapR, y + WALL - 2, b.x + b.w - gapR + WALL, 2);
|
||||
ctx.fillStyle = PALETTE.frame;
|
||||
ctx.fillRect(gapL - 3, y, 3, WALL);
|
||||
ctx.fillRect(gapR, y, 3, WALL);
|
||||
}
|
||||
|
||||
function drawRoomWindows(ctx: CanvasRenderingContext2D, room: RoomSpec, sky: SkyScene): void {
|
||||
const rects = windowRects(room);
|
||||
for (let i = 0; i < rects.length; i++) {
|
||||
drawWindowFrame(ctx, rects[i], sky, Math.round(room.bounds.x) + i * 53);
|
||||
ctx.fillStyle = PALETTE.panelSeam;
|
||||
for (let x = 32; x < w; x += 32) ctx.fillRect(x, 2, 1, BACK_WALL_H - 5);
|
||||
ctx.fillStyle = PALETTE.baseboard;
|
||||
ctx.fillRect(0, BACK_WALL_H - 3, w, 3);
|
||||
for (const room of plan.rooms) {
|
||||
windowRects(room).forEach((rect, index) => {
|
||||
const seed = Math.round(room.bounds.x) + index * 53;
|
||||
ctx.fillStyle = PALETTE.frame;
|
||||
ctx.fillRect(rect.x - 2, rect.y - 2, rect.w + 4, rect.h + 4);
|
||||
drawWindowSky(ctx, rect, outside.sky, seed);
|
||||
drawWeather(ctx, rect, outside.weather, outside.timeMs, seed);
|
||||
ctx.fillStyle = PALETTE.frame;
|
||||
ctx.fillRect(rect.x + rect.w / 2 - 1, rect.y, 2, rect.h);
|
||||
});
|
||||
}
|
||||
drawWallArt(ctx);
|
||||
drawWallClock(ctx, 664, 10, outside.clock);
|
||||
ctx.restore();
|
||||
}
|
||||
|
||||
/** Window glass rects on each room's north wall face (world coordinates). */
|
||||
/** Window glass on each room's stretch of the north wall face: x along the wall, y down from its top. */
|
||||
export function windowRects(room: RoomSpec): Rect[] {
|
||||
const b = room.bounds;
|
||||
const y = b.y + 8;
|
||||
const h = WALL_FACE_H - 20;
|
||||
if (room.kind === "restroom") {
|
||||
return [{ x: b.x + b.w - 190, y: y + 6, w: 44, h: h - 10 }];
|
||||
if (room.kind === "restroom") return [{ x: b.x + b.w - 190, y: 12, w: 44, h: 18 }];
|
||||
if (room.kind === "snack") return [{ x: b.x + 104, y: 8, w: 72, h: 24 }];
|
||||
return [{ x: b.x + 28, y: 8, w: 72, h: 24 }, { x: b.x + b.w - 100, y: 8, w: 72, h: 24 }];
|
||||
}
|
||||
|
||||
function drawWallArt(ctx: CanvasRenderingContext2D): void {
|
||||
// CEO office wall screen and meeting-room whiteboard, between their windows.
|
||||
ctx.fillStyle = PALETTE.frame;
|
||||
ctx.fillRect(143, 8, 34, 22);
|
||||
ctx.fillStyle = "#7f96b8";
|
||||
ctx.fillRect(145, 10, 30, 18);
|
||||
ctx.fillStyle = "#f2efe8";
|
||||
ctx.fillRect(424, 6, 96, 28);
|
||||
ctx.fillStyle = "#b3543f";
|
||||
ctx.fillRect(432, 12, 26, 3);
|
||||
ctx.fillStyle = "#4f7fae";
|
||||
ctx.fillRect(432, 19, 40, 3);
|
||||
ctx.fillStyle = "#6d9c6b";
|
||||
ctx.fillRect(432, 26, 33, 3);
|
||||
// Restroom mirror over the sinks.
|
||||
ctx.fillStyle = PALETTE.frame;
|
||||
ctx.fillRect(934, 8, 84, 22);
|
||||
ctx.fillStyle = "#b9d3e6";
|
||||
ctx.fillRect(936, 10, 80, 18);
|
||||
ctx.fillStyle = "#e3f0f8";
|
||||
ctx.fillRect(944, 12, 2, 12);
|
||||
ctx.fillRect(948, 12, 1, 8);
|
||||
}
|
||||
|
||||
/** A block sorted by its footprint centre; one resting on `support` touches exactly one piece of it (overhanging its outer edge is fine) and sorts just after that piece. */
|
||||
export function blockDrawable(frame: IsoFrame, foot: Rect, height: number, colors: BoxColors, z = 0, support?: Rect): SceneDrawable {
|
||||
return { foot, depth: support ? restingDepth(foot, support) : centerDepth(foot), draw: (ctx) => drawBox(ctx, frame, foot, z, height, colors) };
|
||||
}
|
||||
|
||||
function restingDepth(foot: Rect, support: Rect): number {
|
||||
const under = split(support).filter((piece) => overlaps(piece, foot));
|
||||
if (under.length !== 1) throw new Error("A resting block must touch exactly one piece of its support.");
|
||||
return centerDepth(under[0]!) + 0.25;
|
||||
}
|
||||
|
||||
function centerDepth(rect: Rect): number {
|
||||
return depthOf({ x: rect.x + rect.w / 2, y: rect.y + rect.h / 2 });
|
||||
}
|
||||
|
||||
/** Interior walls, furniture and desks as blocks, each sorted by depth against the people; `screens` gives each desk's screen its agent's state, and `timeMs` animates screens and steam. */
|
||||
export function sceneDrawables(frame: IsoFrame, plan: FloorPlan, season: Season, screens: Map<Rect, OfficeState>, timeMs: number): SceneDrawable[] {
|
||||
const items: SceneDrawable[] = [];
|
||||
// Long blocks go in pieces so each sorts against nearby people on its own.
|
||||
const block = (foot: Rect, height: number, colors: BoxColors, z = 0, support?: Rect) => {
|
||||
for (const piece of support ? [foot] : split(foot)) items.push(blockDrawable(frame, piece, height, colors, z, support));
|
||||
};
|
||||
for (const wall of innerWalls(plan)) block(wall, INNER_WALL_H, faces(PALETTE.wall));
|
||||
const leaves = LEAVES[season];
|
||||
const plant = (cx: number, cy: number) => {
|
||||
const pot = { x: cx - 6, y: cy - 6, w: 12, h: 12 };
|
||||
block(pot, 8, faces("#8a5a3b"));
|
||||
block({ x: cx - 8, y: cy - 8, w: 16, h: 16 }, 12, faces(leaves.leaf), 8, pot);
|
||||
block({ x: cx - 4, y: cy - 4, w: 8, h: 8 }, 6, faces(leaves.light), 20, pot);
|
||||
};
|
||||
// CEO office: rug, executive desk, sofa, plant.
|
||||
block({ x: 32, y: 96, w: 24, h: 72 }, 10, faces("#7a4a41"));
|
||||
plant(280, 40);
|
||||
deskBlocks(plan.ceoDesk, true, screens.get(plan.ceoDesk) ?? "idle", timeMs).forEach((item) => items.push(item(frame)));
|
||||
// Meeting room: table and chairs.
|
||||
block({ x: 392, y: 120, w: 160, h: 64 }, 12, faces("#75593b"));
|
||||
for (let i = 0; i < 3; i++) {
|
||||
block({ x: 414 + i * 52, y: 100, w: 14, h: 12 }, 8, faces(PALETTE.chair));
|
||||
block({ x: 414 + i * 52, y: 192, w: 14, h: 12 }, 8, faces(PALETTE.chair));
|
||||
}
|
||||
if (room.kind === "snack") {
|
||||
return [{ x: b.x + 24, y, w: 72, h }];
|
||||
// Snack bar: counter, fridge, coffee machine, table and stools.
|
||||
const counter = { x: 656, y: 40, w: 224, h: 28 };
|
||||
block(counter, 16, faces("#8f8578"));
|
||||
block({ x: 700, y: 20, w: 24, h: 20 }, 22, faces("#d5dade"));
|
||||
const machine = { x: 726, y: 44, w: 14, h: 14 };
|
||||
items.push({ foot: machine, depth: restingDepth(machine, counter), draw: (ctx) => drawCoffeeMachine(ctx, frame, machine, 16, timeMs) });
|
||||
block({ x: 792, y: 46, w: 12, h: 10 }, 8, faces("#c9a86a"), 16, counter);
|
||||
block({ x: 826, y: 46, w: 12, h: 10 }, 10, faces("#b3543f"), 16, counter);
|
||||
block({ x: 748, y: 170, w: 40, h: 40 }, 12, faces("#94897b"));
|
||||
block({ x: 728, y: 182, w: 12, h: 12 }, 7, faces("#6d5334"));
|
||||
block({ x: 796, y: 182, w: 12, h: 12 }, 7, faces("#6d5334"));
|
||||
// Restroom: three open stalls with toilets between partitions, and a sink counter.
|
||||
for (let i = 0; i < 3; i++) {
|
||||
const cx = 1084 + i * 40;
|
||||
const toilet = { x: cx - 6, y: WALL + 2, w: 12, h: 16 };
|
||||
items.push({ foot: toilet, depth: centerDepth(toilet), draw: (ctx) => drawToilet(ctx, frame, cx, WALL + 2) });
|
||||
}
|
||||
const w = 72;
|
||||
for (let i = 0; i <= 3; i++) block({ x: 1063 + i * 40, y: WALL, w: 2, h: 48 }, INNER_WALL_H, faces("#7d8a99"));
|
||||
const sinks = { x: 928, y: 32, w: 96, h: 32 };
|
||||
block(sinks, 14, { top: "#c6d2de", south: "#a7b4c2", east: "#909eae" });
|
||||
for (let i = 0; i < 2; i++) {
|
||||
const basin = { x: sinks.x + 2 + i * 64, y: sinks.y + 8, w: 28, h: 16 };
|
||||
items.push({ foot: basin, depth: restingDepth(basin, sinks), draw: (ctx) => drawBasin(ctx, frame, basin, 14) });
|
||||
}
|
||||
for (const [cx, cy] of [[312, 300], [632, 300], [904, 300]] as const) plant(cx, cy);
|
||||
for (const desk of plan.desks) deskBlocks(desk.bounds, false, screens.get(desk.bounds) ?? "idle", timeMs).forEach((item) => items.push(item(frame)));
|
||||
return items;
|
||||
}
|
||||
|
||||
/** A desk, its monitor and its chair, each a separate block so a seated person sorts between them. */
|
||||
function deskBlocks(desk: Rect, executive: boolean, screen: OfficeState, timeMs: number): Array<(frame: IsoFrame) => SceneDrawable> {
|
||||
const monitor = deskMonitor(desk);
|
||||
return [
|
||||
{ x: b.x + 28, y, w, h },
|
||||
{ x: b.x + b.w - 28 - w, y, w, h },
|
||||
...split(desk).map((piece) => (frame: IsoFrame) => blockDrawable(frame, piece, 14, faces(executive ? PALETTE.deskExec : PALETTE.desk))),
|
||||
(frame) => {
|
||||
const shell = blockDrawable(frame, monitor, 12, { top: PALETTE.monitor, south: PALETTE.monitor, east: shade(PALETTE.monitor, 0.7) }, 14, desk);
|
||||
return { foot: monitor, depth: shell.depth, draw: (ctx) => {
|
||||
shell.draw(ctx);
|
||||
drawMonitorScreen(ctx, frame, monitor, 14, 12, screen, timeMs, Math.round(desk.x + desk.y));
|
||||
} };
|
||||
},
|
||||
(frame) => blockDrawable(frame, { x: desk.x + desk.w / 2 - 8, y: desk.y + desk.h + 6, w: 16, h: 12 }, 9, faces(PALETTE.chair)),
|
||||
];
|
||||
}
|
||||
|
||||
function drawWindowFrame(ctx: CanvasRenderingContext2D, rect: Rect, sky: SkyScene, seed: number): void {
|
||||
ctx.fillStyle = PALETTE.frame;
|
||||
ctx.fillRect(rect.x - 3, rect.y - 3, rect.w + 6, rect.h + 6);
|
||||
drawWindowSky(ctx, rect, sky, seed);
|
||||
ctx.fillStyle = PALETTE.frame;
|
||||
ctx.fillRect(rect.x + rect.w / 2 - 1, rect.y, 2, rect.h);
|
||||
/** Footprint of a desk's monitor, at the back of the desktop with its screen facing south, inside the desk piece that holds the desk's centre. */
|
||||
function deskMonitor(desk: Rect): Rect {
|
||||
const piece = Math.floor(desk.w / 2 / PIECE) * PIECE;
|
||||
return { x: desk.x + piece + 3, y: desk.y + 4, w: 26, h: 6 };
|
||||
}
|
||||
|
||||
function drawRoomFurniture(ctx: CanvasRenderingContext2D, plan: FloorPlan, room: RoomSpec): void {
|
||||
if (room.kind === "ceo") drawCeoFurniture(ctx, plan);
|
||||
if (room.kind === "meeting") drawMeetingFurniture(ctx);
|
||||
if (room.kind === "snack") drawSnackFurniture(ctx);
|
||||
if (room.kind === "restroom") drawRestroomFurniture(ctx);
|
||||
}
|
||||
|
||||
function drawCeoFurniture(ctx: CanvasRenderingContext2D, plan: FloorPlan): void {
|
||||
const desk = plan.ceoDesk;
|
||||
ctx.fillStyle = "#414b6e";
|
||||
ctx.fillRect(desk.x - 16, desk.y - 8, desk.w + 32, desk.h + 40);
|
||||
drawDesk(ctx, desk, true);
|
||||
drawSofa(ctx, 32, 96);
|
||||
drawPlant(ctx, 280, 48);
|
||||
// Wall screen centered in the gap between the two windows (116..204).
|
||||
ctx.fillStyle = PALETTE.frame;
|
||||
ctx.fillRect(143, 24, 34, 22);
|
||||
ctx.fillStyle = "#7f96b8";
|
||||
ctx.fillRect(145, 26, 30, 18);
|
||||
ctx.fillStyle = "#5c7a9c";
|
||||
ctx.fillRect(145, 36, 30, 8);
|
||||
}
|
||||
|
||||
function drawMeetingFurniture(ctx: CanvasRenderingContext2D): void {
|
||||
const table: Rect = { x: 392, y: 120, w: 160, h: 64 };
|
||||
ctx.fillStyle = PALETTE.deskWoodDark;
|
||||
ctx.fillRect(table.x, table.y, table.w, table.h);
|
||||
ctx.fillStyle = PALETTE.deskWood;
|
||||
ctx.fillRect(table.x + 3, table.y + 3, table.w - 6, table.h - 9);
|
||||
for (let i = 0; i < 3; i++) {
|
||||
drawChair(ctx, table.x + 22 + i * 52, table.y - 16);
|
||||
drawChair(ctx, table.x + 22 + i * 52, table.y + table.h + 4);
|
||||
/** Partitions, room fronts (with door gaps) and the low outer east and south walls. */
|
||||
function innerWalls(plan: FloorPlan): Rect[] {
|
||||
const { w, h } = plan.world;
|
||||
const walls: Rect[] = [
|
||||
{ x: 304, y: WALL, w: WALL, h: 272 },
|
||||
{ x: 624, y: WALL, w: WALL, h: 272 },
|
||||
{ x: 896, y: WALL, w: WALL, h: 272 },
|
||||
{ x: w - WALL, y: WALL, w: WALL, h: h - 2 * WALL },
|
||||
{ x: 0, y: h - WALL, w, h: WALL },
|
||||
];
|
||||
for (const room of plan.rooms) {
|
||||
const b = room.bounds;
|
||||
const y = b.y + b.h;
|
||||
walls.push({ x: b.x - WALL, y, w: room.doorCx - 24 - b.x + WALL, h: WALL });
|
||||
walls.push({ x: room.doorCx + 24, y, w: b.x + b.w - room.doorCx - 24 + WALL, h: WALL });
|
||||
}
|
||||
// Whiteboard centered in the gap between the two windows (420..524).
|
||||
ctx.fillStyle = "#f2efe8";
|
||||
ctx.fillRect(424, 22, 96, 30);
|
||||
ctx.fillStyle = PALETTE.frame;
|
||||
ctx.strokeStyle = PALETTE.frame;
|
||||
ctx.lineWidth = 2;
|
||||
ctx.strokeRect(424, 22, 96, 30);
|
||||
ctx.fillStyle = "#b3543f";
|
||||
ctx.fillRect(432, 30, 26, 3);
|
||||
ctx.fillStyle = "#4f7fae";
|
||||
ctx.fillRect(432, 38, 40, 3);
|
||||
ctx.fillStyle = "#6d9c6b";
|
||||
ctx.fillRect(432, 44, 33, 3);
|
||||
return walls;
|
||||
}
|
||||
|
||||
function drawSnackFurniture(ctx: CanvasRenderingContext2D): void {
|
||||
ctx.fillStyle = "#8f8578";
|
||||
ctx.fillRect(656, 40, 224, 28);
|
||||
ctx.fillStyle = "#a99e8f";
|
||||
ctx.fillRect(656, 40, 224, 8);
|
||||
ctx.fillStyle = "#d5dade";
|
||||
ctx.fillRect(660, 8, 30, 48);
|
||||
ctx.fillStyle = "#b9c0c6";
|
||||
ctx.fillRect(660, 30, 30, 3);
|
||||
ctx.fillRect(682, 14, 4, 12);
|
||||
drawCoffeeMachine(ctx, 694, 26);
|
||||
ctx.fillStyle = "#c9a86a";
|
||||
ctx.fillRect(806, 30, 14, 12);
|
||||
ctx.fillStyle = "#b3543f";
|
||||
ctx.fillRect(826, 28, 12, 14);
|
||||
ctx.fillStyle = "#6d9c6b";
|
||||
ctx.fillRect(844, 30, 12, 12);
|
||||
ctx.fillStyle = "#94897b";
|
||||
ctx.fillRect(748, 170, 40, 40);
|
||||
ctx.fillStyle = "#a89d8e";
|
||||
ctx.fillRect(751, 173, 34, 34);
|
||||
drawStool(ctx, 738, 184);
|
||||
drawStool(ctx, 792, 184);
|
||||
}
|
||||
|
||||
function drawCoffeeMachine(ctx: CanvasRenderingContext2D, x: number, y: number): void {
|
||||
ctx.fillStyle = "#2e3238";
|
||||
ctx.fillRect(x, y, 22, 30);
|
||||
ctx.fillStyle = "#454b52";
|
||||
ctx.fillRect(x + 2, y + 2, 18, 8);
|
||||
ctx.fillStyle = "#c9553e";
|
||||
ctx.fillRect(x + 8, y + 12, 6, 4);
|
||||
ctx.fillStyle = "#d8d3c8";
|
||||
ctx.fillRect(x + 7, y + 20, 8, 7);
|
||||
}
|
||||
|
||||
function drawRestroomFurniture(ctx: CanvasRenderingContext2D): void {
|
||||
for (let i = 0; i < 3; i++) {
|
||||
const x = 1064 + i * 40;
|
||||
ctx.fillStyle = "#7d8a99";
|
||||
ctx.fillRect(x, 16, 40, 72);
|
||||
ctx.fillStyle = "#8f9dad";
|
||||
ctx.fillRect(x + 4, 28, 32, 58);
|
||||
ctx.fillStyle = "#6c7887";
|
||||
ctx.fillRect(x + 30, 54, 4, 8);
|
||||
function split(block: Rect): Rect[] {
|
||||
const pieces: Rect[] = [];
|
||||
for (let dy = 0; dy < block.h; dy += PIECE) {
|
||||
for (let dx = 0; dx < block.w; dx += PIECE) {
|
||||
pieces.push({ x: block.x + dx, y: block.y + dy, w: Math.min(PIECE, block.w - dx), h: Math.min(PIECE, block.h - dy) });
|
||||
}
|
||||
}
|
||||
ctx.fillStyle = "#c6d2de";
|
||||
ctx.fillRect(928, 32, 96, 32);
|
||||
ctx.fillStyle = "#e4ebf2";
|
||||
for (let i = 0; i < 2; i++) ctx.fillRect(940 + i * 44, 38, 28, 14);
|
||||
ctx.fillStyle = "#aab8c6";
|
||||
ctx.fillRect(936, 18, 80, 10);
|
||||
return pieces;
|
||||
}
|
||||
|
||||
function drawCorridorPlants(ctx: CanvasRenderingContext2D, plan: FloorPlan): void {
|
||||
void plan;
|
||||
drawPlant(ctx, 312, 300);
|
||||
drawPlant(ctx, 632, 300);
|
||||
drawPlant(ctx, 904, 300);
|
||||
}
|
||||
|
||||
function drawPlant(ctx: CanvasRenderingContext2D, cx: number, cy: number): void {
|
||||
ctx.fillStyle = "#8a5a3b";
|
||||
ctx.fillRect(cx - 7, cy, 14, 10);
|
||||
ctx.fillStyle = "#4e7a46";
|
||||
ctx.fillRect(cx - 9, cy - 12, 18, 12);
|
||||
ctx.fillStyle = "#659a58";
|
||||
ctx.fillRect(cx - 5, cy - 18, 10, 8);
|
||||
}
|
||||
|
||||
function drawSofa(ctx: CanvasRenderingContext2D, x: number, y: number): void {
|
||||
ctx.fillStyle = "#7a4a41";
|
||||
ctx.fillRect(x, y, 24, 72);
|
||||
ctx.fillStyle = "#94594e";
|
||||
ctx.fillRect(x + 8, y + 4, 16, 64);
|
||||
}
|
||||
|
||||
function drawChair(ctx: CanvasRenderingContext2D, x: number, y: number): void {
|
||||
ctx.fillStyle = PALETTE.chairDark;
|
||||
ctx.fillRect(x, y, 16, 12);
|
||||
ctx.fillStyle = PALETTE.chair;
|
||||
ctx.fillRect(x + 2, y + 2, 12, 8);
|
||||
}
|
||||
|
||||
function drawStool(ctx: CanvasRenderingContext2D, x: number, y: number): void {
|
||||
ctx.fillStyle = "#6d5334";
|
||||
ctx.fillRect(x, y, 10, 10);
|
||||
}
|
||||
|
||||
function drawDesk(ctx: CanvasRenderingContext2D, desk: Rect, executive: boolean): void {
|
||||
ctx.fillStyle = PALETTE.deskLeg;
|
||||
ctx.fillRect(desk.x + 4, desk.y + desk.h - 6, 5, 10);
|
||||
ctx.fillRect(desk.x + desk.w - 9, desk.y + desk.h - 6, 5, 10);
|
||||
ctx.fillStyle = executive ? "#5f4a33" : PALETTE.deskWoodDark;
|
||||
ctx.fillRect(desk.x, desk.y, desk.w, desk.h);
|
||||
ctx.fillStyle = executive ? "#75593b" : PALETTE.deskWood;
|
||||
ctx.fillRect(desk.x + 2, desk.y + 2, desk.w - 4, desk.h - 7);
|
||||
|
||||
const screen = deskScreenRect(desk);
|
||||
ctx.fillStyle = PALETTE.monitorShell;
|
||||
ctx.fillRect(screen.x - 2, screen.y - 2, screen.w + 4, screen.h + 4);
|
||||
ctx.fillStyle = PALETTE.screenOff;
|
||||
ctx.fillRect(screen.x, screen.y, screen.w, screen.h);
|
||||
ctx.fillStyle = PALETTE.monitorShell;
|
||||
ctx.fillRect(screen.x + screen.w / 2 - 3, screen.y + screen.h + 2, 6, 3);
|
||||
if (executive) {
|
||||
ctx.fillStyle = "#d8d3c8";
|
||||
ctx.fillRect(desk.x + desk.w - 22, desk.y + 8, 12, 8);
|
||||
ctx.fillStyle = "#4e7a46";
|
||||
ctx.fillRect(desk.x + 8, desk.y + 6, 8, 10);
|
||||
}
|
||||
ctx.fillStyle = "#23262b";
|
||||
ctx.fillRect(desk.x + desk.w / 2 - 8, desk.y + desk.h - 12, 16, 5);
|
||||
drawChair(ctx, desk.x + desk.w / 2 - 8, desk.y + desk.h + 4);
|
||||
}
|
||||
|
||||
function drawDoorSign(ctx: CanvasRenderingContext2D, room: RoomSpec): void {
|
||||
const label = room.label;
|
||||
ctx.font = "bold 8px monospace";
|
||||
const width = ctx.measureText(label).width + 10;
|
||||
const x = room.doorCx - width / 2;
|
||||
const y = room.bounds.y + room.bounds.h - 13;
|
||||
ctx.fillStyle = PALETTE.signPlate;
|
||||
ctx.fillRect(x, y, width, 12);
|
||||
ctx.fillStyle = PALETTE.signText;
|
||||
ctx.textAlign = "center";
|
||||
ctx.textBaseline = "middle";
|
||||
ctx.fillText(label, room.doorCx, y + 7);
|
||||
ctx.textAlign = "start";
|
||||
ctx.textBaseline = "alphabetic";
|
||||
}
|
||||
|
||||
function drawEntrance(ctx: CanvasRenderingContext2D, plan: FloorPlan): void {
|
||||
void plan;
|
||||
ctx.fillStyle = PALETTE.frame;
|
||||
ctx.fillRect(0, 292, 4, 56);
|
||||
ctx.fillStyle = "#7fb3d9";
|
||||
ctx.fillRect(4, 296, 4, 48);
|
||||
ctx.fillStyle = "#8d6a45";
|
||||
ctx.fillRect(20, 300, 26, 40);
|
||||
ctx.fillStyle = "#9c7852";
|
||||
ctx.fillRect(22, 302, 22, 36);
|
||||
}
|
||||
|
||||
function rectsTouch(a: Rect, b: Rect): boolean {
|
||||
function overlaps(a: Rect, b: Rect): boolean {
|
||||
return a.x < b.x + b.w && a.x + a.w > b.x && a.y < b.y + b.h && a.y + a.h > b.y;
|
||||
}
|
||||
|
||||
function expand(rect: Rect, margin: number): Rect {
|
||||
return { x: rect.x - margin, y: rect.y - margin, w: rect.w + margin * 2, h: rect.h + margin * 2 };
|
||||
function shade(hex: string, factor: number): string {
|
||||
const value = Number.parseInt(hex.slice(1), 16);
|
||||
const channel = (shift: number) => Math.round(((value >> shift) & 0xff) * factor);
|
||||
return `rgb(${channel(16)}, ${channel(8)}, ${channel(0)})`;
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
import { buildFloorPlan, findPath } from "./floor-plan";
|
||||
import type { AmenitySpot, Camera, FloorPlan, OfficeAgentInput, Rect, Vec } from "./office-types";
|
||||
import { appearanceFor, type Carrying, type Facing, type SpriteAppearance } from "./sprites";
|
||||
import { ceoIdOf } from "./roster";
|
||||
|
||||
export type AgentBehavior =
|
||||
| { kind: "seated" }
|
||||
@@ -116,7 +117,7 @@ export class OfficeSimulation {
|
||||
switch (agent.behavior.kind) {
|
||||
case "seated": {
|
||||
agent.settledMs += dt;
|
||||
if (agent.input.activity === "idle" && agent.settledMs >= SETTLE_MS && this.random() < dt / MEAN_TRIP_INTERVAL_MS) {
|
||||
if (agent.input.status.state === "idle" && agent.settledMs >= SETTLE_MS && this.random() < dt / MEAN_TRIP_INTERVAL_MS) {
|
||||
agent.settledMs = 0;
|
||||
this.startTrip(agent);
|
||||
}
|
||||
@@ -160,7 +161,7 @@ export class OfficeSimulation {
|
||||
conveneMeeting(): number {
|
||||
const spots = this.plan.amenities.filter((spot) => spot.kind === "meeting");
|
||||
const candidates = this.agents.filter(
|
||||
(agent) => agent.input.activity === "idle" && agent.behavior.kind === "seated" && agent.settledMs >= SETTLE_MS,
|
||||
(agent) => agent.input.status.state === "idle" && agent.behavior.kind === "seated" && agent.settledMs >= SETTLE_MS,
|
||||
);
|
||||
if (candidates.length < 2 || spots.length < 2) return 0;
|
||||
const size = Math.min(spots.length, candidates.length, 2 + Math.floor(this.random() * 3));
|
||||
@@ -244,22 +245,6 @@ export class OfficeSimulation {
|
||||
agent.behavior = { kind: "seated" };
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the agent whose drawn body contains the world point, preferring
|
||||
* the visually frontmost (largest y). Tests against the same positions the
|
||||
* renderer draws, so clicks always match what is on screen.
|
||||
*/
|
||||
hitTest(point: Vec): AgentSim | null {
|
||||
let hit: AgentSim | null = null;
|
||||
for (const agent of this.agents) {
|
||||
const inBody =
|
||||
point.x >= agent.x - 10 && point.x <= agent.x + 10 &&
|
||||
point.y >= agent.y - 36 && point.y <= agent.y + 4;
|
||||
if (inBody && (hit === null || agent.y > hit.y)) hit = agent;
|
||||
}
|
||||
return hit;
|
||||
}
|
||||
|
||||
private stepPlayer(player: PlayerSim, dt: number, input: MoveInput): void {
|
||||
let dx = (input.right ? 1 : 0) - (input.left ? 1 : 0);
|
||||
let dy = (input.down ? 1 : 0) - (input.up ? 1 : 0);
|
||||
@@ -294,7 +279,7 @@ export class OfficeSimulation {
|
||||
* else takes open-floor desks in order.
|
||||
*/
|
||||
sync(inputs: OfficeAgentInput[]): void {
|
||||
const ceoId = inputs.find((input) => input.roleLevel === "c_suite")?.id ?? null;
|
||||
const ceoId = ceoIdOf(inputs);
|
||||
const openCount = inputs.filter((input) => input.id !== ceoId).length;
|
||||
const planRebuilt = openCount !== this.openDeskDemand;
|
||||
if (planRebuilt) {
|
||||
@@ -325,7 +310,7 @@ export class OfficeSimulation {
|
||||
settledMs: prev?.settledMs ?? 0,
|
||||
};
|
||||
const onBreak = agent.behavior.kind === "dwelling" || (agent.behavior.kind === "walking" && agent.behavior.destination === "amenity");
|
||||
const workStarted = input.activity !== "idle" && onBreak;
|
||||
const workStarted = input.status.state !== "idle" && onBreak;
|
||||
if (workStarted || (planRebuilt && prev && (agent.x !== seat.x || agent.y !== seat.y))) {
|
||||
this.sendHome(agent);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import type { Rect } from "./office-types";
|
||||
import { season } from "../../shared/palette-clock";
|
||||
|
||||
/**
|
||||
* The world outside the office windows, driven by real local time: night
|
||||
@@ -155,6 +156,34 @@ function drawSkyline(ctx: CanvasRenderingContext2D, glass: Rect, scene: SkyScene
|
||||
}
|
||||
}
|
||||
|
||||
export type Weather = "clear" | "rain" | "snow" | "leaves";
|
||||
|
||||
/** Decoration for the view outside, from the season and a per-day roll; never a forecast. */
|
||||
export function weatherFor(date: Date): Weather {
|
||||
const dayKey = date.getFullYear() * 400 + date.getMonth() * 32 + date.getDate();
|
||||
const roll = Math.abs(Math.imul(dayKey ^ 0x5bd1e995, 2654435761) >> 7) % 100;
|
||||
switch (season(date)) {
|
||||
case "winter": return roll < 60 ? "snow" : "clear";
|
||||
case "spring": return roll < 40 ? "rain" : "clear";
|
||||
case "summer": return roll < 15 ? "rain" : "clear";
|
||||
case "autumn": return roll < 45 ? "leaves" : roll < 65 ? "rain" : "clear";
|
||||
}
|
||||
}
|
||||
|
||||
/** Falling rain, snow or leaves inside a window, moving with time; each pane gets its own scatter. */
|
||||
export function drawWeather(ctx: CanvasRenderingContext2D, glass: Rect, weather: Weather, timeMs: number, seed: number): void {
|
||||
if (weather === "clear") return;
|
||||
const style = { rain: { color: "rgba(200,220,255,0.75)", w: 1, h: 3, speed: 0.06, drift: 0.01 }, snow: { color: "#f4f6fb", w: 1, h: 1, speed: 0.008, drift: 0.004 }, leaves: { color: "#d9822b", w: 2, h: 1, speed: 0.012, drift: 0.01 } }[weather];
|
||||
ctx.fillStyle = style.color;
|
||||
const count = Math.max(3, Math.floor(glass.w / 6));
|
||||
for (let i = 0; i < count; i++) {
|
||||
const offset = (seed * 37 + i * 53) % 1000;
|
||||
const fall = (offset + timeMs * style.speed) % glass.h;
|
||||
const sway = (offset * 7 + timeMs * style.drift) % glass.w;
|
||||
ctx.fillRect(Math.floor(glass.x + sway), Math.floor(glass.y + fall), style.w, Math.min(style.h, glass.y + glass.h - Math.floor(glass.y + fall)));
|
||||
}
|
||||
}
|
||||
|
||||
function rgb(r: number, g: number, b: number): Rgb {
|
||||
return { r, g, b };
|
||||
}
|
||||
|
||||
@@ -19,9 +19,9 @@ export function RunRequestList({ loaded }: { loaded: LoadedRequests | null }) {
|
||||
return (
|
||||
<div style={{ marginBottom: 20 }}>
|
||||
<div className="section-label" style={{ marginBottom: 8 }}>{t("Model calls ({count})", { count: String(requests.length) })}</div>
|
||||
{requests.length === 0 && <div style={{ fontSize: 13, color: "var(--text-3)" }}>{t("This run made no model call.")}</div>}
|
||||
{requests.length === 0 && <div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{t("This run made no model call.")}</div>}
|
||||
{requests.map((request, index) => (
|
||||
<div key={request.id} className="row" style={{ gap: 10, fontSize: 13, padding: "6px 0", borderBottom: "1px solid var(--border-soft)" }}>
|
||||
<div key={request.id} className="row" style={{ gap: 10, fontSize: "var(--fs-body)", padding: "6px 0", borderBottom: "1px solid var(--border-soft)" }}>
|
||||
<span className="mono" style={{ color: "var(--text-3)", width: 24 }}>{index + 1}</span>
|
||||
<span style={{ width: 96 }}>{purposeLabel(request.purpose)}</span>
|
||||
<span className="mono" style={{ flex: 1, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis" }}>{request.model}</span>
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
import { XpBar } from "../../shared/XpBar";
|
||||
import { Avatar, Pill } from "../../shared/ui";
|
||||
import type { AgentRecord, HiringPolicyRecord, ProviderRecord } from "../../../../shared/domain";
|
||||
import { money } from "../types";
|
||||
@@ -42,7 +43,7 @@ export function BillingPanel({
|
||||
<div style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 12, marginBottom: 20 }}>
|
||||
<div className="card" style={{ padding: 14 }}>
|
||||
<div className="card-label" style={{ marginBottom: 8 }}>{t("Token usage (30d)")}</div>
|
||||
<div style={{ display: "grid", gridTemplateColumns: "100px 1fr", gap: "6px 14px", fontSize: 12 }}>
|
||||
<div style={{ display: "grid", gridTemplateColumns: "100px 1fr", gap: "6px 14px", fontSize: "var(--fs-body)" }}>
|
||||
<span style={{ color: "var(--text-3)" }}>{t("Input")}</span><span className="num">{inputTokens.toLocaleString()}</span>
|
||||
<span style={{ color: "var(--text-3)" }}>{t("of which cached")}</span><span className="num">{cachedTokens.toLocaleString()}</span>
|
||||
<span style={{ color: "var(--text-3)" }}>{t("Output")}</span><span className="num">{outputTokens.toLocaleString()}</span>
|
||||
@@ -52,14 +53,12 @@ export function BillingPanel({
|
||||
</div>
|
||||
<div className="card" style={{ padding: 14 }}>
|
||||
<div className="card-label" style={{ marginBottom: 8 }}>{t("Spent this month")}</div>
|
||||
<div style={{ height: 6, background: "var(--panel-3)", borderRadius: 3, overflow: "hidden", marginBottom: 8 }}>
|
||||
<div style={{ width: `${totalBudget > 0 ? Math.min(100, Math.round((spentCents / totalBudget) * 100)) : 0}%`, height: "100%", background: "var(--accent)" }} />
|
||||
</div>
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)" }}>
|
||||
<div style={{ marginBottom: 8 }}><XpBar percent={totalBudget > 0 ? (spentCents / totalBudget) * 100 : 0} label={t("Spent this month")} /></div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>
|
||||
{t("${spent} of ${allocated} allocated to agents", { spent: (spentCents / 100).toFixed(2), allocated: (totalBudget / 100).toFixed(2) })}
|
||||
{unpricedCalls > 0 && <> · {t("{count} calls not priced", { count: unpricedCalls })}</>}
|
||||
</div>
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)", marginTop: 4 }}>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", marginTop: 4 }}>
|
||||
{totalCap > 0 ? t("Allocations use {percent}% of department caps", { percent: Math.round((totalBudget / totalCap) * 100) }) : t("No budget cap set")}
|
||||
</div>
|
||||
</div>
|
||||
@@ -74,12 +73,12 @@ export function BillingPanel({
|
||||
<div key={row.agent.id} className="table-row" style={{ gridTemplateColumns: "minmax(0, 2fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr)", borderBottom: i === agentSpend.length - 1 ? "none" : "1px solid var(--border-soft)" }}>
|
||||
<div className="row" style={{ gap: 8 }}>
|
||||
<Avatar name={row.agent.name} size="sm" bot />
|
||||
<span style={{ fontWeight: 480 }}>{row.agent.name}</span>
|
||||
<span>{row.agent.name}</span>
|
||||
</div>
|
||||
<div className="num mono">{money(row.agent.budgetCents)}</div>
|
||||
<div className="num mono">{row.requestCount}</div>
|
||||
<div className="num mono" style={{ fontSize: 12 }}>{row.tokens.toLocaleString()}</div>
|
||||
<div className="num mono" style={{ fontSize: 12 }}>${(row.spentCents / 100).toFixed(2)}</div>
|
||||
<div className="num mono" style={{ fontSize: "var(--fs-body)" }}>{row.tokens.toLocaleString()}</div>
|
||||
<div className="num mono" style={{ fontSize: "var(--fs-body)" }}>${(row.spentCents / 100).toFixed(2)}</div>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -96,8 +95,8 @@ export function BillingPanel({
|
||||
return (
|
||||
<div key={provider.id} className="table-row" style={{ gridTemplateColumns: "minmax(0, 1.6fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr)", borderBottom: index === providers.length - 1 ? "none" : "1px solid var(--border-soft)" }}>
|
||||
<div style={{ minWidth: 0 }}>
|
||||
<div style={{ fontWeight: 540 }}>{provider.label}</div>
|
||||
{provider.model && <div style={{ fontSize: 12, color: "var(--text-3)" }}>{provider.model}</div>}
|
||||
<div>{provider.label}</div>
|
||||
{provider.model && <div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{provider.model}</div>}
|
||||
</div>
|
||||
<div className="num mono">{activity?.requests ?? 0}</div>
|
||||
<div>{errors > 0 ? <Pill tone="amber">{errors}</Pill> : <span className="num mono" style={{ color: "var(--text-3)" }}>0</span>}</div>
|
||||
@@ -114,7 +113,7 @@ function StatTile({ label, value, tone }: { label: string; value: string; tone?:
|
||||
return (
|
||||
<div className="card" style={{ padding: 14 }}>
|
||||
<div className="card-label" style={{ marginBottom: 6 }}>{label}</div>
|
||||
<div className="num" style={{ fontSize: 18, fontWeight: 600, color: tone === "red" ? "var(--red)" : "var(--text-1)" }}>{value}</div>
|
||||
<div className="num" style={{ fontSize: "var(--fs-display)", color: tone === "red" ? "var(--red)" : "var(--text-1)" }}>{value}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -44,10 +44,10 @@ export function CompanyDialog({ organization, open, actions, onClose }: { organi
|
||||
<option value="zh">{WORK_LANGUAGE_NAMES.zh}</option>
|
||||
</select>
|
||||
</Field>
|
||||
<p style={{ fontSize: 12, color: "var(--text-3)", margin: 0 }}>{t("Agents write messages, tasks, documents and deliverables in it. The display language does not change it, and a task can set its own.")}</p>
|
||||
<p style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", margin: 0 }}>{t("Agents write messages, tasks, documents and deliverables in it. The display language does not change it, and a task can set its own.")}</p>
|
||||
<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>
|
||||
<div style={{ fontSize: "var(--fs-body)", 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>
|
||||
);
|
||||
|
||||
@@ -48,7 +48,7 @@ export function DisconnectProviderDialog({ orgId, provider, revokesRemotely, act
|
||||
) : impact === null ? (
|
||||
state.kind !== "error" && <p style={{ margin: 0, color: "var(--text-3)" }}>{t("Checking what this affects…")}</p>
|
||||
) : (
|
||||
<ul style={{ margin: 0, paddingLeft: 18, lineHeight: 1.6, fontSize: 13 }}>
|
||||
<ul style={{ margin: 0, paddingLeft: 18, lineHeight: 1.6, fontSize: "var(--fs-body)" }}>
|
||||
<li>{impact.agents.length
|
||||
? t("Agents on this provider stop working until it is reconnected or they move to another provider: {names}.", { names: impact.agents.join(", ") })
|
||||
: t("No agent uses this provider.")}</li>
|
||||
|
||||
@@ -20,11 +20,11 @@ export function GoalAuditPanel({ organization, providers, actions }: { organizat
|
||||
return (
|
||||
<section>
|
||||
<div className="section-label" style={{ marginBottom: 6 }}>{t("Goal audit")}</div>
|
||||
<p style={{ color: "var(--text-2)", fontSize: 13, margin: "0 0 12px" }}>
|
||||
<p style={{ color: "var(--text-2)", fontSize: "var(--fs-body)", margin: "0 0 12px" }}>
|
||||
{t("An independent model checks every goal before it closes. Pick one your agents do not use, ideally from another provider.")}
|
||||
</p>
|
||||
{!organization.auditModelId && (
|
||||
<p style={{ color: "var(--red)", fontSize: 13, margin: "0 0 12px" }}>{t("No auditor is set, so goals cannot be closed yet.")}</p>
|
||||
<p style={{ color: "var(--red)", fontSize: "var(--fs-body)", margin: "0 0 12px" }}>{t("No auditor is set, so goals cannot be closed yet.")}</p>
|
||||
)}
|
||||
<form className="row" style={{ gap: 10, alignItems: "flex-end" }} onSubmit={save}>
|
||||
<Field label={t("Provider")}>
|
||||
@@ -38,7 +38,7 @@ export function GoalAuditPanel({ organization, providers, actions }: { organizat
|
||||
</Field>
|
||||
<Button type="submit">{t("Save")}</Button>
|
||||
</form>
|
||||
{error && <p style={{ color: "var(--red)", fontSize: 13, margin: "8px 0 0" }}>{error}</p>}
|
||||
{error && <p style={{ color: "var(--red)", fontSize: "var(--fs-body)", margin: "8px 0 0" }}>{error}</p>}
|
||||
</section>
|
||||
);
|
||||
}
|
||||
@@ -20,7 +20,7 @@ export function LanguageField({ uiPreferences, actions }: { uiPreferences: UiPre
|
||||
<option value="en">{NAMES.en}</option>
|
||||
<option value="zh">{NAMES.zh}</option>
|
||||
</select>
|
||||
<span style={{ fontSize: 12, color: "var(--text-3)" }}>{t("Changes only what you see; agents keep the company's working language.")}</span>
|
||||
<span style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{t("Changes only what you see; agents keep the company's working language.")}</span>
|
||||
<RestartForLanguage language={uiPreferences.language} />
|
||||
</Field>
|
||||
);
|
||||
@@ -47,12 +47,12 @@ export function RestartForLanguage({ language }: { language: UiLanguage }) {
|
||||
};
|
||||
return (
|
||||
<>
|
||||
<span className="row" style={{ gap: 8, fontSize: 12 }} role="status">
|
||||
<span className="row" style={{ gap: 8, fontSize: "var(--fs-body)" }} role="status">
|
||||
{t("{language} applies after a restart.", { language: NAMES[language] })}
|
||||
<Button size="small" onClick={confirm}>{t("Restart now")}</Button>
|
||||
</span>
|
||||
<Dialog title={t("Restart to switch language?")} open={confirming} submitLabel={t("Restart now")} onClose={() => setConfirming(false)} onSubmit={(event) => { event.preventDefault(); restart(); }}>
|
||||
<ul style={{ margin: 0, paddingLeft: 18, lineHeight: 1.6, fontSize: 13 }}>
|
||||
<ul style={{ margin: 0, paddingLeft: 18, lineHeight: 1.6, fontSize: "var(--fs-body)" }}>
|
||||
<li>{t("Text you typed but have not sent or saved is lost.")}</li>
|
||||
<li>{running === null
|
||||
? t("Counting running agent sessions…")
|
||||
|
||||
@@ -44,7 +44,7 @@ export function ProviderConnectFields({
|
||||
if (entry.authType === "api_key") {
|
||||
return (
|
||||
<>
|
||||
<p style={{ fontSize: 12, color: "var(--text-3)", lineHeight: 1.5, margin: 0 }}>{entry.credentialHelp}</p>
|
||||
<p style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", lineHeight: 1.5, margin: 0 }}>{entry.credentialHelp}</p>
|
||||
<Field label={t("API key")}><input className="input" name="secret" type="password" required autoFocus /></Field>
|
||||
<ModelPicker entry={entry} provider={provider} />
|
||||
</>
|
||||
@@ -56,7 +56,7 @@ export function ProviderConnectFields({
|
||||
function SavedEndpointForm({ provider, entry }: { provider: ProviderRecord; entry: ProviderCatalogEntry }) {
|
||||
const { endpoint, error } = useSavedEndpoint(provider, entry);
|
||||
if (error) return <div className="form-error" role="alert">{t("The saved settings could not be read: {error}", { error })}</div>;
|
||||
if (endpoint === undefined) return <p style={{ fontSize: 12, color: "var(--text-3)", margin: 0 }}>{t("Loading saved settings…")}</p>;
|
||||
if (endpoint === undefined) return <p style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", margin: 0 }}>{t("Loading saved settings…")}</p>;
|
||||
return entry.customEndpoint
|
||||
? <CompatFieldsForm entry={entry} provider={provider} saved={endpoint} />
|
||||
: <CloudFieldsForm entry={entry} provider={provider} saved={endpoint} />;
|
||||
@@ -78,7 +78,7 @@ export function ProviderOAuthFields({
|
||||
const [model, setModel] = useState(provider.model ?? entry.defaultModel ?? entry.models[0]?.id ?? "");
|
||||
return (
|
||||
<>
|
||||
<p style={{ fontSize: 12, color: "var(--text-3)", lineHeight: 1.5, margin: 0 }}>{entry.credentialHelp}</p>
|
||||
<p style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", lineHeight: 1.5, margin: 0 }}>{entry.credentialHelp}</p>
|
||||
<Field label={t("Default model")}>
|
||||
{entry.models.length ? (
|
||||
<select className="input" value={model} onChange={(event) => setModel(event.target.value)}>
|
||||
@@ -105,7 +105,7 @@ function CompatFieldsForm({ entry, provider, saved }: { entry: ProviderCatalogEn
|
||||
const [baseUrl, setBaseUrl] = useState(saved?.baseUrl ?? "");
|
||||
return (
|
||||
<>
|
||||
<p style={{ fontSize: 12, color: "var(--text-3)", lineHeight: 1.5, margin: 0 }}>{entry.credentialHelp}</p>
|
||||
<p style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", lineHeight: 1.5, margin: 0 }}>{entry.credentialHelp}</p>
|
||||
<Field label={t("Base URL")}>
|
||||
<input
|
||||
className="input"
|
||||
@@ -178,9 +178,9 @@ export function ModelPicker({ entry, provider }: { entry: ProviderCatalogEntry;
|
||||
{check === "running" ? t("Checking...") : t("Check for agent work")}
|
||||
</button>
|
||||
)}
|
||||
{typeof check === "object" && check.passed && <div style={{ color: "var(--green)", fontSize: 12, marginTop: 4 }}>{t("This model follows instructions and calls tools.")}</div>}
|
||||
{typeof check === "object" && !check.passed && <div style={{ color: "var(--red)", fontSize: 12, marginTop: 4 }}>{t("This model cannot do agent work here: {detail}", { detail: check.detail })}</div>}
|
||||
{error && <div style={{ color: "var(--red)", fontSize: 12, marginTop: 4 }}>{error}</div>}
|
||||
{typeof check === "object" && check.passed && <div style={{ color: "var(--green)", fontSize: "var(--fs-body)", marginTop: 4 }}>{t("This model follows instructions and calls tools.")}</div>}
|
||||
{typeof check === "object" && !check.passed && <div style={{ color: "var(--red)", fontSize: "var(--fs-body)", marginTop: 4 }}>{t("This model cannot do agent work here: {detail}", { detail: check.detail })}</div>}
|
||||
{error && <div style={{ color: "var(--red)", fontSize: "var(--fs-body)", marginTop: 4 }}>{error}</div>}
|
||||
</Field>
|
||||
);
|
||||
}
|
||||
@@ -190,7 +190,7 @@ function CloudFieldsForm({ entry, provider, saved }: { entry: ProviderCatalogEnt
|
||||
const update = (patch: Partial<ProviderEndpoint>) => setState((current) => ({ ...current, ...patch }));
|
||||
return (
|
||||
<>
|
||||
<p style={{ fontSize: 12, color: "var(--text-3)", lineHeight: 1.5, margin: 0 }}>{entry.credentialHelp}</p>
|
||||
<p style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", lineHeight: 1.5, margin: 0 }}>{entry.credentialHelp}</p>
|
||||
<Field label={t("Base URL")}>
|
||||
<input className="input" name="cloudBaseUrl" value={state.baseUrl} onChange={(event) => update({ baseUrl: event.target.value })} />
|
||||
</Field>
|
||||
|
||||
@@ -23,20 +23,18 @@ export function ProviderPolicyTable({
|
||||
return (
|
||||
<>
|
||||
<div className="section-label" style={{ marginBottom: 6 }}>{t("Runtime policy")}</div>
|
||||
{/* What each column governs, so a change is made knowing what it reaches. */}
|
||||
<ul style={{ fontSize: 12, color: "var(--text-3)", lineHeight: 1.6, margin: "0 0 10px", paddingLeft: 18 }}>
|
||||
<li>{t("Scope: “Workspace” refuses every call that is not made for a workspace, including agent sessions on tasks without one.")}</li>
|
||||
<li>{t("Data policy: zero data retention refuses background requests, so it also switches background off.")}</li>
|
||||
<li>{t("Background: lets requests from the request console run in the provider's background mode.")}</li>
|
||||
<li>{t("Monthly limit: counts every model call this company makes through the provider in the calendar month (UTC); at the limit, calls are refused and agent work waits until the month resets.")}</li>
|
||||
<li>{t("Context window: the size new sessions fit prompts, skills, history and tool results into; sessions already running keep theirs.")}</li>
|
||||
</ul>
|
||||
<div className="card" style={{ padding: 0, overflowX: "auto", marginBottom: 28 }}>
|
||||
<div
|
||||
className="table-row head"
|
||||
style={{ gridTemplateColumns: POLICY_GRID, minWidth: 940 }}
|
||||
>
|
||||
<div>{t("Provider")}</div><div>{t("Scope")}</div><div>{t("Data policy")}</div><div>{t("Background")}</div><div>{t("Monthly limit")}</div><div>{t("Context window (tokens)")}</div><div>{t("Usage")}</div>
|
||||
<div>{t("Provider")}</div>
|
||||
<div title={t("Scope: “Workspace” refuses every call that is not made for a workspace, including agent sessions on tasks without one.")}>{t("Scope")}</div>
|
||||
<div title={t("Data policy: zero data retention refuses background requests, so it also switches background off.")}>{t("Data policy")}</div>
|
||||
<div title={t("Background: lets requests from the request console run in the provider's background mode.")}>{t("Background")}</div>
|
||||
<div title={t("Monthly limit: counts every model call this company makes through the provider in the calendar month (UTC); at the limit, calls are refused and agent work waits until the month resets.")}>{t("Monthly limit")}</div>
|
||||
<div title={t("Context window: the size new sessions fit prompts, skills, history and tool results into; sessions already running keep theirs.")}>{t("Context window (tokens)")}</div>
|
||||
<div>{t("Usage")}</div>
|
||||
</div>
|
||||
{providers.map((provider, index) => (
|
||||
<ProviderPolicyRow
|
||||
@@ -123,8 +121,8 @@ function ProviderPolicyRow({
|
||||
}}
|
||||
>
|
||||
<div style={{ minWidth: 0 }}>
|
||||
<div style={{ fontWeight: 540, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{provider.label}</div>
|
||||
{linkedNote && <div style={{ fontSize: 12, color: "var(--text-3)" }}>{linkedNote}</div>}
|
||||
<div style={{ overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{provider.label}</div>
|
||||
{linkedNote && <div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{linkedNote}</div>}
|
||||
</div>
|
||||
<select
|
||||
className="input"
|
||||
@@ -144,7 +142,7 @@ function ProviderPolicyRow({
|
||||
<option value={PROVIDER_DATA_POLICY.STANDARD}>{t("Standard retention")}</option>
|
||||
<option value={PROVIDER_DATA_POLICY.ZERO_DATA_RETENTION}>{t("Zero data retention")}</option>
|
||||
</select>
|
||||
<label className="row" style={{ gap: 8, fontSize: 12, color: "var(--text-2)" }}>
|
||||
<label className="row" style={{ gap: 8, fontSize: "var(--fs-body)", color: "var(--text-2)" }}>
|
||||
<input
|
||||
aria-label={t("{label} background execution", { label: provider.label })}
|
||||
type="checkbox"
|
||||
@@ -174,7 +172,7 @@ function ProviderPolicyRow({
|
||||
/>
|
||||
<div>
|
||||
<div className="num mono">{rateLimit.requestCount} / {rateLimit.monthlyRequestLimit}</div>
|
||||
<div style={{ fontSize: 11, color: "var(--text-3)" }}>{t("Resets {date} (UTC)", { date: rateLimit.windowEnd.slice(0, 10) })}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{t("Resets {date} (UTC)", { date: rateLimit.windowEnd.slice(0, 10) })}</div>
|
||||
<div className="row" style={{ gap: 6, marginTop: 4 }}>
|
||||
<button type="button" className="button small" aria-label={t("Save {label} policy", { label: provider.label })} onClick={savePolicy} disabled={!dirty || status?.kind === "saving"}>
|
||||
{t("Save")}
|
||||
|
||||
@@ -108,7 +108,7 @@ export function ProviderRequestPanel({
|
||||
</div>
|
||||
<Button type="submit" tone="primary">
|
||||
<span className="row" style={{ gap: 6 }}>
|
||||
<Icon name="send" size={16} />
|
||||
<Icon name="send" />
|
||||
{t("Run")}
|
||||
</span>
|
||||
</Button>
|
||||
@@ -171,8 +171,8 @@ function ProviderRequestRow({
|
||||
}}
|
||||
>
|
||||
<div style={{ minWidth: 0 }}>
|
||||
<div style={{ fontWeight: 540, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{provider.label}</div>
|
||||
<div className="mono" style={{ fontSize: 12, color: "var(--text-3)" }}>{request.model}</div>
|
||||
<div style={{ overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{provider.label}</div>
|
||||
<div className="mono" style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{request.model}</div>
|
||||
</div>
|
||||
<div className="mono" style={{ color: "var(--text-2)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{workspace?.name ?? t("Organization")}</div>
|
||||
<div className="mono" style={{ color: "var(--text-2)" }}>{request.executionMode}</div>
|
||||
@@ -180,7 +180,7 @@ function ProviderRequestRow({
|
||||
<div className="mono" style={{ color: "var(--text-2)" }}>{t("{count} chars", { count: request.outputCharCount })}</div>
|
||||
<Button size="small" tone="ghost" onClick={cancel} disabled={!canCancel}>
|
||||
<span className="row" style={{ gap: 5 }}>
|
||||
<Icon name="x" size={12} />
|
||||
<Icon name="x" />
|
||||
{t("Cancel")}
|
||||
</span>
|
||||
</Button>
|
||||
|
||||
@@ -140,7 +140,7 @@ export function ProvidersPanel({ orgId, companyName, employeeId, providers, auth
|
||||
)
|
||||
)}
|
||||
{active && (
|
||||
<p style={{ fontSize: 12, color: "var(--text-3)", margin: 0 }}>
|
||||
<p style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", margin: 0 }}>
|
||||
{t("The default model reaches {following} agents without their own model; {own} keep their own. Sessions already started keep the model they began with.", { following: defaultModelReach(agents, active.id).following, own: defaultModelReach(agents, active.id).ownModel })}
|
||||
</p>
|
||||
)}
|
||||
@@ -170,7 +170,7 @@ export function ProvidersPanel({ orgId, companyName, employeeId, providers, auth
|
||||
<>
|
||||
<ModelPicker entry={modelForEntry} provider={modelFor} />
|
||||
{modelError && <div className="form-error" role="alert">{modelError}</div>}
|
||||
<p style={{ fontSize: 12, color: "var(--text-3)", margin: 0 }}>
|
||||
<p style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", margin: 0 }}>
|
||||
{t("The default model reaches {following} agents without their own model; {own} keep their own. Sessions already started keep the model they began with.", { following: defaultModelReach(agents, modelFor.id).following, own: defaultModelReach(agents, modelFor.id).ownModel })}
|
||||
</p>
|
||||
</>
|
||||
@@ -215,7 +215,7 @@ function ProviderPricesRow({ orgId, provider, actions }: { orgId: string; provid
|
||||
);
|
||||
return (
|
||||
<div className="table-row" style={{ gridTemplateColumns: PRICE_GRID, minWidth: 640 }}>
|
||||
<div style={{ fontWeight: 540 }}>{provider.label}{provider.inputCentsPerMtok === null && <div style={{ fontSize: 12, color: "var(--text-3)" }}>{t("Unpriced: spend is not counted")}</div>}</div>
|
||||
<div>{provider.label}{provider.inputCentsPerMtok === null && <div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{t("Unpriced: spend is not counted")}</div>}</div>
|
||||
{field(t("input"), input, setInput)}
|
||||
{field(t("cached input"), cached, setCached)}
|
||||
{field(t("output"), output, setOutput)}
|
||||
@@ -259,18 +259,17 @@ function ProviderRow({
|
||||
padding: 14,
|
||||
background: "var(--panel)",
|
||||
border: "1px solid var(--border)",
|
||||
borderRadius: 10,
|
||||
}}
|
||||
>
|
||||
<ProviderLogo providerKey={provider.providerKey} label={provider.label} />
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ fontSize: 13.5, fontWeight: 540, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{provider.label}</div>
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
<div style={{ fontSize: "var(--fs-body)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{provider.label}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
{provider.model ? `${provider.model} · ` : ""}{readableAuth(provider.authType)}{authProfile ? ` · ${credentialSourceLabel(authProfile.sourceType)}` : ""}
|
||||
</div>
|
||||
</div>
|
||||
<ProviderHealth provider={provider} />
|
||||
<div className="num mono" style={{ fontSize: 13, minWidth: 72, textAlign: "right" }}>
|
||||
<div className="num mono" style={{ fontSize: "var(--fs-body)", minWidth: 72, textAlign: "right" }}>
|
||||
{boundCount === 1 ? t("{count} agent", { count: boundCount }) : t("{count} agents", { count: boundCount })}
|
||||
</div>
|
||||
<span className="reveal row" style={{ gap: 6 }}>
|
||||
@@ -308,14 +307,13 @@ function ProviderCard({ provider, onConnect }: { provider: ProviderRecord; onCon
|
||||
padding: 14,
|
||||
background: "var(--panel)",
|
||||
border: "1px solid var(--border)",
|
||||
borderRadius: 10,
|
||||
minWidth: 0,
|
||||
}}
|
||||
>
|
||||
<ProviderLogo providerKey={provider.providerKey} label={provider.label} />
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ fontSize: 13.5, fontWeight: 540, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{provider.label}</div>
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
<div style={{ fontSize: "var(--fs-body)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{provider.label}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
{readableAuth(provider.authType)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -10,5 +10,5 @@ export function ScopeNote({ scope, company }: { scope: SettingScope; company: st
|
||||
: scope === "company_folders"
|
||||
? t("Applies to {company} only; the folders are on this computer.", { company })
|
||||
: t("Applies to {company} only.", { company });
|
||||
return <div role="note" className="scope-note" style={{ fontSize: 12, color: "var(--text-3)", margin: "4px 0 10px" }}>{text}</div>;
|
||||
return <div role="note" className="scope-note" style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", margin: "4px 0 10px" }}>{text}</div>;
|
||||
}
|
||||
@@ -67,7 +67,7 @@ export function WorkspacePanel({
|
||||
<div className="page">
|
||||
<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>
|
||||
<span style={{ marginLeft: "auto" }}><Button onClick={() => setEditOpen(true)}><Icon name="edit" /> {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)} />
|
||||
@@ -100,6 +100,7 @@ export function WorkspacePanel({
|
||||
<option value="system">{t("System")}</option>
|
||||
<option value="light">{t("Light")}</option>
|
||||
<option value="dark">{t("Dark")}</option>
|
||||
<option value="clock">{t("Follow the clock")}</option>
|
||||
</select>
|
||||
</Field>
|
||||
<LanguageField uiPreferences={uiPreferences} actions={actions} />
|
||||
@@ -108,7 +109,7 @@ export function WorkspacePanel({
|
||||
<div className="row reveal-row" style={{ marginBottom: 8 }}>
|
||||
<div className="section-label">{t("Workspaces")}</div>
|
||||
<span className="reveal" style={{ marginLeft: "auto" }}>
|
||||
<Button tone="ghost" onClick={() => setCreateOpen(true)}><Icon name="plus" size={16} /> {t("Add")}</Button>
|
||||
<Button tone="ghost" onClick={() => setCreateOpen(true)}><Icon name="plus" /> {t("Add")}</Button>
|
||||
</span>
|
||||
</div>
|
||||
<ScopeNote scope="company_folders" company={organization.name} />
|
||||
@@ -125,7 +126,7 @@ export function WorkspacePanel({
|
||||
const form = document.querySelector<HTMLFormElement>("form:has([name='localPath'])");
|
||||
if (form) void chooseDirectory(form);
|
||||
}}>
|
||||
<Icon name="folder" size={16} /> {t("Browse")}
|
||||
<Icon name="folder" /> {t("Browse")}
|
||||
</Button>
|
||||
</div>
|
||||
</Field>
|
||||
@@ -143,7 +144,7 @@ export function WorkspacePanel({
|
||||
function KeyValue({ label, value }: { label: string; value: string }) {
|
||||
return (
|
||||
<div className="row" style={{ padding: "6px 0", borderBottom: "1px solid var(--border-soft)" }}>
|
||||
<span style={{ color: "var(--text-3)", width: 120, flexShrink: 0, fontSize: 12 }}>{label}</span>
|
||||
<span style={{ color: "var(--text-3)", width: 120, flexShrink: 0, fontSize: "var(--fs-body)" }}>{label}</span>
|
||||
<span style={{ flex: 1, color: "var(--text-1)", overflow: "hidden", textOverflow: "ellipsis" }}>{value}</span>
|
||||
</div>
|
||||
);
|
||||
|
||||
@@ -33,8 +33,8 @@ export function WorkspaceRow({ workspace, projects, focused, actions }: { worksp
|
||||
<div role="group" aria-label={workspace.name} aria-current={focused ? "true" : undefined} style={{ padding: "8px 0", borderBottom: "1px solid var(--border-soft)", background: focused ? "var(--accent-soft)" : undefined }}>
|
||||
<div className="row" style={{ gap: 8 }}>
|
||||
<div style={{ minWidth: 0, flex: 1 }}>
|
||||
<div style={{ fontWeight: 540 }}>{workspace.name}</div>
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{workspace.localPath}</div>
|
||||
<div>{workspace.name}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{workspace.localPath}</div>
|
||||
</div>
|
||||
{workspace.isPrimary
|
||||
? <Pill tone="violet">{t("Primary")}</Pill>
|
||||
@@ -44,7 +44,7 @@ export function WorkspaceRow({ workspace, projects, focused, actions }: { worksp
|
||||
</div>
|
||||
{confirmRemove && (
|
||||
<div className="row" role="alertdialog" aria-label={t("Remove this workspace?")} style={{ gap: 8, marginTop: 6 }}>
|
||||
<span style={{ fontSize: 13 }}>{t("Remove this workspace? Its folder stays on disk.")}</span>
|
||||
<span style={{ fontSize: "var(--fs-body)" }}>{t("Remove this workspace? Its folder stays on disk.")}</span>
|
||||
<Button size="small" tone="primary" onClick={() => act(() => actions.run(() => window.agentCompany.deleteWorkspace({ orgId, workspaceId: workspace.id })))}>{t("Remove")}</Button>
|
||||
<Button size="small" tone="ghost" onClick={() => { setConfirmRemove(false); setError(null); }}>{t("Cancel")}</Button>
|
||||
</div>
|
||||
@@ -55,7 +55,7 @@ export function WorkspaceRow({ workspace, projects, focused, actions }: { worksp
|
||||
<Field label={t("Local path")}>
|
||||
<div className="row" style={{ gap: 6 }}>
|
||||
<input className="input" name="localPath" data-workspace-path={workspace.id} defaultValue={workspace.localPath} required style={{ flex: 1 }} />
|
||||
<Button tone="ghost" onClick={browse}><Icon name="folder" size={16} /> {t("Browse")}</Button>
|
||||
<Button tone="ghost" onClick={browse}><Icon name="folder" /> {t("Browse")}</Button>
|
||||
</div>
|
||||
</Field>
|
||||
<Field label={t("Project")}>
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
||||
import { Avatar } from "../../shared/ui";
|
||||
import { PixelAvatar } from "../office/PixelAvatar";
|
||||
import { ceoIdOf, officeRoster } from "../office/roster";
|
||||
import type { AgentRecord, EmployeeRecord } from "../../../../shared/domain";
|
||||
import { t } from "../../i18n/i18n";
|
||||
|
||||
const NODE_W = 208;
|
||||
const NODE_W = 232;
|
||||
const NODE_H = 64;
|
||||
const H_GAP = 24;
|
||||
const V_GAP = 44;
|
||||
@@ -47,6 +48,7 @@ export function OrgChartTree({
|
||||
onSelectAgent: (agentId: string) => void;
|
||||
}) {
|
||||
const layout = useMemo(() => buildLayout(boardChair, agents), [boardChair, agents]);
|
||||
const ceoId = useMemo(() => ceoIdOf(officeRoster(agents)), [agents]);
|
||||
const scrollRef = useRef<HTMLDivElement>(null);
|
||||
const scaleRef = useRef(1);
|
||||
const pendingCenter = useRef<{ cx: number; cy: number } | null>(null);
|
||||
@@ -126,7 +128,7 @@ export function OrgChartTree({
|
||||
onClick={() => { if (node.agentId) onSelectAgent(node.agentId); }}
|
||||
disabled={!node.agentId}
|
||||
>
|
||||
<Avatar name={node.name} bot={!node.human} size="sm" />
|
||||
{node.id !== "__org__" && <PixelAvatar id={node.id} isCeo={node.id === ceoId} />}
|
||||
<span className="org-node-text">
|
||||
<span className="org-node-name">{node.name}</span>
|
||||
<span className="org-node-role">{node.role}</span>
|
||||
|
||||
@@ -43,8 +43,8 @@ export function ListView({
|
||||
style={{ gridTemplateColumns: GRID, borderBottom: last ? "none" : "1px solid var(--border-soft)" }}
|
||||
>
|
||||
<div className="row" style={{ gap: 8, minWidth: 0, overflow: "hidden" }}>
|
||||
{task.risk === "high" && <span style={{ width: 3, height: 12, background: "var(--red)", borderRadius: 2, flexShrink: 0 }} />}
|
||||
<span style={{ fontWeight: 480, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
{task.risk === "high" && <span style={{ width: 3, height: 12, background: "var(--red)", flexShrink: 0 }} />}
|
||||
<span style={{ minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>
|
||||
{task.title}
|
||||
</span>
|
||||
{project && <span style={{ flexShrink: 0 }}><Pill>{truncate(project.name, 24)}</Pill></span>}
|
||||
|
||||
@@ -19,7 +19,7 @@ export function ProgressView({ tasks, goals, projects }: { tasks: TaskRecord[];
|
||||
return (
|
||||
<section key={goal.id} className="card" style={{ padding: 18 }}>
|
||||
<div className="row" style={{ gap: 12 }}>
|
||||
<span style={{ fontWeight: 560, fontSize: 14, minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", flex: 1 }}>
|
||||
<span style={{ fontSize: "var(--fs-body)", minWidth: 0, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", flex: 1 }}>
|
||||
{goal.title}
|
||||
</span>
|
||||
<CompletionReadout tasks={linked} />
|
||||
@@ -34,7 +34,7 @@ export function ProgressView({ tasks, goals, projects }: { tasks: TaskRecord[];
|
||||
<div key={project.id} className="row" style={{ gap: 12 }}>
|
||||
<span
|
||||
style={{
|
||||
fontSize: 13,
|
||||
fontSize: "var(--fs-body)",
|
||||
color: "var(--text-2)",
|
||||
minWidth: 0,
|
||||
overflow: "hidden",
|
||||
@@ -59,7 +59,7 @@ export function ProgressView({ tasks, goals, projects }: { tasks: TaskRecord[];
|
||||
{unlinked.length > 0 && (
|
||||
<section className="card" style={{ padding: 18 }}>
|
||||
<div className="row" style={{ gap: 12 }}>
|
||||
<span style={{ fontWeight: 560, fontSize: 14, color: "var(--text-2)", flex: 1 }}>{t("Unlinked tasks")}</span>
|
||||
<span style={{ fontSize: "var(--fs-body)", color: "var(--text-2)", flex: 1 }}>{t("Unlinked tasks")}</span>
|
||||
<CompletionReadout tasks={unlinked} />
|
||||
</div>
|
||||
<StatusBar tasks={unlinked} height={6} style={{ marginTop: 12 }} />
|
||||
@@ -80,7 +80,7 @@ function counts(tasks: TaskRecord[]): Map<TaskStatus, number> {
|
||||
function StatusBar({ tasks, height, style }: { tasks: TaskRecord[]; height: number; style?: React.CSSProperties }) {
|
||||
const byStatus = counts(tasks);
|
||||
if (tasks.length === 0) {
|
||||
return <div style={{ height, borderRadius: height, background: "var(--panel-3)", ...style }} />;
|
||||
return <div style={{ height, background: "var(--panel-3)", ...style }} />;
|
||||
}
|
||||
return (
|
||||
<div style={{ display: "flex", gap: 2, height, ...style }}>
|
||||
@@ -93,7 +93,6 @@ function StatusBar({ tasks, height, style }: { tasks: TaskRecord[]; height: numb
|
||||
style={{
|
||||
flex: count,
|
||||
background: segment.tone,
|
||||
borderRadius: height,
|
||||
minWidth: height,
|
||||
}}
|
||||
/>
|
||||
@@ -108,8 +107,8 @@ function Legend({ tasks }: { tasks: TaskRecord[] }) {
|
||||
return (
|
||||
<div className="row" style={{ gap: 14, marginTop: 10, flexWrap: "wrap" }}>
|
||||
{SEGMENTS.map((segment) => (
|
||||
<span key={segment.id} className="row" style={{ gap: 6, fontSize: 12, color: "var(--text-3)" }}>
|
||||
<span style={{ width: 8, height: 8, borderRadius: 2, background: segment.tone, flexShrink: 0 }} />
|
||||
<span key={segment.id} className="row" style={{ gap: 6, fontSize: "var(--fs-body)", color: "var(--text-3)" }}>
|
||||
<span style={{ width: 8, height: 8, background: segment.tone, flexShrink: 0 }} />
|
||||
<span className="num">{byStatus.get(segment.id) ?? 0}</span>
|
||||
{segment.label}
|
||||
</span>
|
||||
@@ -121,7 +120,7 @@ function Legend({ tasks }: { tasks: TaskRecord[] }) {
|
||||
function CompletionReadout({ tasks }: { tasks: TaskRecord[] }) {
|
||||
const done = tasks.filter((task) => task.status === TASK_STATUS.DONE).length;
|
||||
return (
|
||||
<span className="num" style={{ color: "var(--text-3)", fontSize: 13, flexShrink: 0 }}>
|
||||
<span className="num" style={{ color: "var(--text-3)", fontSize: "var(--fs-body)", flexShrink: 0 }}>
|
||||
{done} / {tasks.length}
|
||||
</span>
|
||||
);
|
||||
|
||||
@@ -53,7 +53,7 @@ function ProjectCard({
|
||||
<article className="card" style={{ padding: 14, minWidth: 0 }}>
|
||||
<div className="row" style={{ alignItems: "flex-start", gap: 10 }}>
|
||||
<div style={{ minWidth: 0, flex: 1 }}>
|
||||
<div style={{ fontWeight: 560, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{project.name}</div>
|
||||
<div style={{ overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{project.name}</div>
|
||||
<div className="row" style={{ marginTop: 8, gap: 6, flexWrap: "wrap" }}>
|
||||
<Pill>{project.status.replace(/_/g, " ")}</Pill>
|
||||
<Pill>{t("{done} / {total} tasks", { done, total: tasks.length })}</Pill>
|
||||
@@ -64,7 +64,7 @@ function ProjectCard({
|
||||
{lead && (
|
||||
<div className="row" style={{ gap: 6, flexShrink: 0 }}>
|
||||
<Avatar name={lead.name} size="sm" bot />
|
||||
<span style={{ fontSize: 12, color: "var(--text-2)" }}>{lead.name}</span>
|
||||
<span style={{ fontSize: "var(--fs-body)", color: "var(--text-2)" }}>{lead.name}</span>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
@@ -147,7 +147,7 @@ export function TaskDetailDialog({
|
||||
<div className="modal" style={{ maxWidth: 560 }}>
|
||||
{confirmClose && <DiscardConfirm onKeep={() => setConfirmClose(false)} onDiscard={onClose} />}
|
||||
<div className="row" style={{ alignItems: "flex-start", gap: 10, marginBottom: 8 }}>
|
||||
{task.priority === "high" && <span style={{ width: 3, height: 18, background: "var(--red)", borderRadius: 2, marginTop: 2, flexShrink: 0 }} />}
|
||||
{task.priority === "high" && <span style={{ width: 3, height: 18, background: "var(--red)", marginTop: 2, flexShrink: 0 }} />}
|
||||
<h2 className="modal-title" style={{ margin: 0, flex: 1 }}>{task.title}</h2>
|
||||
<IconButton icon="edit" label={t("Edit")} onClick={() => { setEditError(null); setEditing(true); }} />
|
||||
<IconButton icon="x" label={t("Close")} onClick={requestClose} />
|
||||
@@ -203,15 +203,15 @@ export function TaskDetailDialog({
|
||||
)}
|
||||
{actionError && <div className="form-error" role="alert" style={{ marginTop: 8 }}>{actionError}</div>}
|
||||
<div className="modal-actions">
|
||||
<Button tone="ghost" onClick={askDelete} disabled={deleteImpact !== null}><Icon name="x" size={16} /> {t("Delete")}</Button>
|
||||
<Button tone="ghost" onClick={askDelete} disabled={deleteImpact !== null}><Icon name="x" /> {t("Delete")}</Button>
|
||||
{task.blockedReason
|
||||
? <Button onClick={() => act(() => onBlock(task, null))}>{t("Unblock")}</Button>
|
||||
: task.status !== TASK_STATUS.DONE && !blocking && <Button onClick={() => setBlocking(true)}>{t("Block")}</Button>}
|
||||
{task.status === TASK_STATUS.REVIEW && <Button onClick={() => act(() => onMove(task, TASK_STATUS.IN_PROGRESS))}>{t("Send back")}</Button>}
|
||||
{task.status === TASK_STATUS.DONE && <Button onClick={() => act(() => onMove(task, TASK_STATUS.IN_PROGRESS))}>{t("Reopen")}</Button>}
|
||||
{task.status === TASK_STATUS.IN_PROGRESS && <Button onClick={() => act(() => onMove(task, TASK_STATUS.BACKLOG))}>{t("Back to backlog")}</Button>}
|
||||
{assignee && <Button onClick={() => onRun(task)} disabled={runBlocker(task, provider, taskRuns) !== null}><Icon name="send" size={16} /> {t("Run")}</Button>}
|
||||
{advanceTo && <Button tone="primary" onClick={() => onAdvance(task)}><Icon name="check" size={16} /> {prettyStatus(advanceTo)}</Button>}
|
||||
{assignee && <Button onClick={() => onRun(task)} disabled={runBlocker(task, provider, taskRuns) !== null}><Icon name="send" /> {t("Run")}</Button>}
|
||||
{advanceTo && <Button tone="primary" onClick={() => onAdvance(task)}><Icon name="check" /> {prettyStatus(advanceTo)}</Button>}
|
||||
</div>
|
||||
|
||||
{editing && (
|
||||
@@ -244,9 +244,9 @@ function OverviewTab({ task, assignee, project, goal, workspace, provider, runs,
|
||||
<>
|
||||
{task.hold && <TaskHoldNotice hold={task.hold} />}
|
||||
{task.description && (
|
||||
<p style={{ margin: "0 0 14px", color: "var(--text-2)", fontSize: 14, lineHeight: 1.55, whiteSpace: "pre-wrap" }}>{task.description}</p>
|
||||
<p style={{ margin: "0 0 14px", color: "var(--text-2)", fontSize: "var(--fs-body)", lineHeight: 1.55, whiteSpace: "pre-wrap" }}>{task.description}</p>
|
||||
)}
|
||||
<div style={{ display: "grid", gridTemplateColumns: "100px 1fr", gap: "8px 14px", fontSize: 12 }}>
|
||||
<div style={{ display: "grid", gridTemplateColumns: "100px 1fr", gap: "8px 14px", fontSize: "var(--fs-body)" }}>
|
||||
<MetaLabel>{t("Assignee")}</MetaLabel>
|
||||
<div className="row" style={{ gap: 8 }}>
|
||||
{assignee ? (<><Avatar name={assignee.name} size="sm" bot /><span>{assignee.name}</span>{provider && <span style={{ color: "var(--text-3)" }}>({provider.label})</span>}</>) : <span style={{ color: "var(--text-4)" }}>{t("Unassigned")}</span>}
|
||||
@@ -266,14 +266,14 @@ function OverviewTab({ task, assignee, project, goal, workspace, provider, runs,
|
||||
<button type="button" className="link-button" aria-label={t("Open run {id}", { id: run.id })} onClick={() => navigate("runs", { kind: "run", id: run.id })}>
|
||||
<Pill tone={runTone(run.state)}>{prettyRunState(run.state)}</Pill>
|
||||
</button>
|
||||
<span style={{ color: "var(--text-3)", fontSize: 12 }}>{runTriggerLabel(run.trigger)}</span>
|
||||
<span className="num" style={{ marginLeft: "auto", color: "var(--text-3)", fontSize: 12 }}>{formatRelative(run.createdAt)}</span>
|
||||
<span style={{ color: "var(--text-3)", fontSize: "var(--fs-body)" }}>{runTriggerLabel(run.trigger)}</span>
|
||||
<span className="num" style={{ marginLeft: "auto", color: "var(--text-3)", fontSize: "var(--fs-body)" }}>{formatRelative(run.createdAt)}</span>
|
||||
</div>
|
||||
{run.state === "failed" && run.errorMessage && (
|
||||
<span style={{ color: "var(--red)", fontSize: 12, paddingLeft: 4 }}>{run.errorMessage}</span>
|
||||
<span style={{ color: "var(--red)", fontSize: "var(--fs-body)", paddingLeft: 4 }}>{run.errorMessage}</span>
|
||||
)}
|
||||
{run.capabilityWarnings && (
|
||||
<span style={{ color: "var(--amber)", fontSize: 12, paddingLeft: 4, whiteSpace: "pre-wrap" }}>{t("Missing this run")}: {run.capabilityWarnings}</span>
|
||||
<span style={{ color: "var(--amber)", fontSize: "var(--fs-body)", paddingLeft: 4, whiteSpace: "pre-wrap" }}>{t("Missing this run")}: {run.capabilityWarnings}</span>
|
||||
)}
|
||||
</div>
|
||||
))}
|
||||
@@ -287,13 +287,13 @@ function OverviewTab({ task, assignee, project, goal, workspace, provider, runs,
|
||||
function SubtasksTab({ subtasks, agents, onOpenTask }: { subtasks: TaskRecord[]; agents: AgentRecord[]; onOpenTask: (taskId: string) => void }) {
|
||||
return (
|
||||
<div style={{ minHeight: 60 }}>
|
||||
{subtasks.length === 0 && <div style={{ fontSize: 14, color: "var(--text-3)" }}>{t("No subtasks")}</div>}
|
||||
{subtasks.length === 0 && <div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{t("No subtasks")}</div>}
|
||||
{subtasks.map((st) => {
|
||||
const owner = agents.find((a) => a.id === st.assigneeAgentId);
|
||||
return (
|
||||
<div key={st.id} className="row" style={{ gap: 10, padding: "8px 0", borderBottom: "1px solid var(--border-soft)" }}>
|
||||
<Icon name={st.status === TASK_STATUS.DONE ? "check" : "work"} size={16} color={st.status === TASK_STATUS.DONE ? "var(--green)" : "var(--text-3)"} />
|
||||
<button type="button" className="link-button" aria-label={t("Open task {title}", { title: st.title })} onClick={() => onOpenTask(st.id)} style={{ flex: 1, fontSize: 14, fontWeight: 480, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", textAlign: "left" }}>{st.title}</button>
|
||||
<Icon name={st.status === TASK_STATUS.DONE ? "check" : "work"} color={st.status === TASK_STATUS.DONE ? "var(--green)" : "var(--text-3)"} />
|
||||
<button type="button" className="link-button" aria-label={t("Open task {title}", { title: st.title })} onClick={() => onOpenTask(st.id)} style={{ flex: 1, fontSize: "var(--fs-body)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap", textAlign: "left" }}>{st.title}</button>
|
||||
<Pill>{prettyStatus(st.status)}</Pill>
|
||||
{owner && <Avatar name={owner.name} size="sm" bot />}
|
||||
</div>
|
||||
@@ -312,18 +312,18 @@ function ActivityTab({ audit, approvals, onOpenApproval }: { audit: AuditEventRe
|
||||
{approvals.map((a) => (
|
||||
<div key={a.id} className="row" style={{ gap: 8, padding: "6px 0" }}>
|
||||
<Pill tone={a.state === "approved" ? "green" : a.state === "pending" ? "amber" : "red"}>{approvalStateLabel(a.state)}</Pill>
|
||||
<button type="button" className="link-button" style={{ fontSize: 12 }} aria-label={t("Open approval {title}", { title: a.title })} onClick={() => onOpenApproval(a.id)}>{a.title}</button>
|
||||
<span className="mono" style={{ marginLeft: "auto", fontSize: 12, color: "var(--text-3)" }}>{formatRelative(a.createdAt)}</span>
|
||||
<button type="button" className="link-button" style={{ fontSize: "var(--fs-body)" }} aria-label={t("Open approval {title}", { title: a.title })} onClick={() => onOpenApproval(a.id)}>{a.title}</button>
|
||||
<span className="mono" style={{ marginLeft: "auto", fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{formatRelative(a.createdAt)}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
)}
|
||||
<div className="section-label">{t("Events")}</div>
|
||||
{audit.length === 0 && <div style={{ fontSize: 14, color: "var(--text-3)" }}>{t("No events")}</div>}
|
||||
{audit.length === 0 && <div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{t("No events")}</div>}
|
||||
{audit.map((e) => (
|
||||
<div key={e.id} className="row" style={{ gap: 8, padding: "5px 0" }}>
|
||||
<span className="mono" style={{ fontSize: 12, color: "var(--text-3)", flexShrink: 0 }}>{formatRelative(e.createdAt)}</span>
|
||||
<span style={{ fontSize: 12, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{taskEventLabel(e.action)}</span>
|
||||
<span className="mono" style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", flexShrink: 0 }}>{formatRelative(e.createdAt)}</span>
|
||||
<span style={{ fontSize: "var(--fs-body)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{taskEventLabel(e.action)}</span>
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
@@ -339,9 +339,9 @@ function EditOverlay({ onEdited, task, companyLanguage, agents, allTasks, projec
|
||||
const beneath = descendantIds(task.id, allTasks);
|
||||
const otherTasks = allTasks.filter((t) => t.id !== task.id && t.orgId === task.orgId && !beneath.has(t.id));
|
||||
return (
|
||||
<div style={{ position: "absolute", inset: 0, background: "var(--bg)", borderRadius: 14, padding: 24, overflow: "auto", zIndex: 2 }}>
|
||||
<div style={{ position: "absolute", inset: 0, background: "var(--bg)", padding: 24, overflow: "auto", zIndex: 2 }}>
|
||||
<form onSubmit={submit} onInput={onEdited} onChange={onEdited} aria-busy={busy}>
|
||||
<h3 style={{ margin: "0 0 14px", fontSize: 15, fontWeight: 600 }}>{t("Edit task")}</h3>
|
||||
<h3 style={{ margin: "0 0 14px", fontSize: "var(--fs-body)" }}>{t("Edit task")}</h3>
|
||||
<Field label={t("Title")}><input className="input" name="title" defaultValue={task.title} required /></Field>
|
||||
<Field label={t("Description")}><textarea className="input" name="description" rows={4} defaultValue={task.description} /></Field>
|
||||
<Field label={t("Assignee")}>
|
||||
@@ -423,10 +423,10 @@ function DeleteConfirm({ impact, onConfirm, onCancel }: { impact: TaskDeleteImpa
|
||||
impact.pendingApprovals > 0 && t("{n} pending approvals for it stay pending.", { n: impact.pendingApprovals }),
|
||||
].filter((line): line is string => typeof line === "string");
|
||||
return (
|
||||
<div role="alertdialog" aria-label={t("Delete this task?")} style={{ marginTop: 12, padding: 12, border: "1px solid var(--red)", borderRadius: 10 }}>
|
||||
<div style={{ fontWeight: 600, marginBottom: 6 }}>{t("Delete this task?")}</div>
|
||||
{lines.length === 0 && <div style={{ fontSize: 13, color: "var(--text-2)" }}>{t("Nothing else is affected.")}</div>}
|
||||
{lines.map((line) => <div key={line} style={{ fontSize: 13, color: "var(--text-2)" }}>{line}</div>)}
|
||||
<div role="alertdialog" aria-label={t("Delete this task?")} style={{ marginTop: 12, padding: 12, border: "1px solid var(--red)" }}>
|
||||
<div style={{ marginBottom: 6 }}>{t("Delete this task?")}</div>
|
||||
{lines.length === 0 && <div style={{ fontSize: "var(--fs-body)", color: "var(--text-2)" }}>{t("Nothing else is affected.")}</div>}
|
||||
{lines.map((line) => <div key={line} style={{ fontSize: "var(--fs-body)", color: "var(--text-2)" }}>{line}</div>)}
|
||||
{impact.running > 0 && <div className="form-error" role="alert">{t("A session is running; stop it or wait for it before deleting.")}</div>}
|
||||
<div className="row" style={{ gap: 8, marginTop: 10 }}>
|
||||
<Button tone="primary" size="small" onClick={onConfirm} disabled={impact.running > 0}>{t("Delete task")}</Button>
|
||||
|
||||
@@ -14,9 +14,9 @@ export function TaskHoldNotice({ hold }: { hold: TaskHold }) {
|
||||
: t("Waiting on you.");
|
||||
const color = hold.waitingOn === "operator" ? "var(--red)" : "var(--amber)";
|
||||
return (
|
||||
<div role="status" style={{ marginBottom: 12, fontSize: 13, color, lineHeight: 1.5 }}>
|
||||
<div role="status" style={{ marginBottom: 12, fontSize: "var(--fs-body)", color, lineHeight: 1.5 }}>
|
||||
<div>{hold.reason}</div>
|
||||
<div style={{ fontWeight: 600 }}>{next}</div>
|
||||
<div>{next}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -7,7 +7,7 @@ export function DiscardConfirm({ onKeep, onDiscard }: { onKeep: () => void; onDi
|
||||
return (
|
||||
<Modal label={t("Discard your changes?")} role="alertdialog" onEscape={onKeep} onBackdrop={onKeep}>
|
||||
<div className="modal" style={{ maxWidth: 360 }}>
|
||||
<p style={{ margin: "0 0 12px", fontSize: 14 }}>{t("Discard your changes?")}</p>
|
||||
<p style={{ margin: "0 0 12px", fontSize: "var(--fs-body)" }}>{t("Discard your changes?")}</p>
|
||||
<div className="modal-actions">
|
||||
<Button tone="ghost" onClick={onKeep}>{t("Keep editing")}</Button>
|
||||
<Button tone="primary" onClick={onDiscard}>{t("Discard")}</Button>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Component, type ErrorInfo, type ReactNode } from "react";
|
||||
import { Button } from "./ui";
|
||||
import { GameOver } from "./GameOver";
|
||||
import { t } from "../i18n/i18n";
|
||||
|
||||
/** Contains a render error to the part of the app that threw, says what failed, and offers a way back; the error is logged with its component stack. */
|
||||
@@ -19,17 +19,13 @@ export class ErrorBoundary extends Component<{ scope: "page" | "app"; children:
|
||||
if (!error) return this.props.children;
|
||||
const page = this.props.scope === "page";
|
||||
return (
|
||||
<div role="alert" style={{ padding: 24, display: "grid", gap: 10, maxWidth: 560 }}>
|
||||
<strong>{page ? t("This page could not be shown.") : t("AgentCompany hit an error it could not recover from here.")}</strong>
|
||||
<div className="mono" style={{ fontSize: 12, color: "var(--text-2)", wordBreak: "break-word" }}>{error.message}</div>
|
||||
<div style={{ fontSize: 13, color: "var(--text-3)" }}>
|
||||
{page ? t("The rest of the app still works; go to another page or try this one again.") : t("Reloading the window starts it again; your data is kept.")}
|
||||
</div>
|
||||
<div>
|
||||
{page
|
||||
? <Button onClick={() => this.setState({ error: null })}>{t("Try again")}</Button>
|
||||
: <Button onClick={() => window.location.reload()}>{t("Reload")}</Button>}
|
||||
</div>
|
||||
<div style={{ padding: 24 }}>
|
||||
<GameOver
|
||||
title={page ? t("This page could not be shown.") : t("AgentCompany hit an error it could not recover from here.")}
|
||||
error={error.message}
|
||||
note={page ? t("The rest of the app still works; Continue tries this page again.") : t("Continue reloads the window; your data is kept.")}
|
||||
onContinue={page ? () => this.setState({ error: null }) : () => window.location.reload()}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ export function ErrorText({ message, action }: { message: string; action?: { lab
|
||||
});
|
||||
};
|
||||
return (
|
||||
<div role="alert" className="row" style={{ gap: 10, alignItems: "flex-start", fontSize: 13, color: "var(--red)", marginBottom: 14 }}>
|
||||
<div role="alert" className="row" style={{ gap: 10, alignItems: "flex-start", fontSize: "var(--fs-body)", color: "var(--red)", marginBottom: 14 }}>
|
||||
<span style={{ flex: 1, minWidth: 0, whiteSpace: "pre-wrap", wordBreak: "break-word", userSelect: "text" }}>{message}</span>
|
||||
<Button size="small" onClick={copyMessage}>{copy === "copied" ? t("Copied") : copy === "failed" ? t("Copy failed") : t("Copy")}</Button>
|
||||
{action && <Button size="small" onClick={action.onClick}>{action.label}</Button>}
|
||||
|
||||
@@ -29,7 +29,7 @@ export function FailureToasts() {
|
||||
<div style={{ position: "fixed", right: 16, bottom: 16, zIndex: 1000, display: "grid", gap: 8, maxWidth: 420 }}>
|
||||
{failures.map((failure) => (
|
||||
<div key={failure.id} role="alert" className="card" style={{ display: "flex", gap: 8, alignItems: "flex-start", borderColor: "var(--red)", padding: 12 }}>
|
||||
<div style={{ flex: 1, minWidth: 0, fontSize: 13 }}>
|
||||
<div style={{ flex: 1, minWidth: 0, fontSize: "var(--fs-body)" }}>
|
||||
<strong style={{ display: "block", marginBottom: 2 }}>{t("That did not work")}</strong>
|
||||
<span style={{ color: "var(--text-2)", wordBreak: "break-word" }}>{failure.message}</span>
|
||||
</div>
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { Button } from "./ui";
|
||||
import { t } from "../i18n/i18n";
|
||||
|
||||
/** A failure as a game-over screen: what failed, the error itself, what happens next, and Continue to try again. */
|
||||
export function GameOver({ title, error, note, onContinue }: { title: string; error: string; note: ReactNode; onContinue: () => void }) {
|
||||
return (
|
||||
<div role="alert" className="game-over modal">
|
||||
<div className="game-over-banner" aria-hidden="true">{t("GAME OVER")}</div>
|
||||
<strong>{title}</strong>
|
||||
<div className="mono game-over-error">{error}</div>
|
||||
<div className="game-over-note">{note}</div>
|
||||
<div><Button tone="primary" onClick={onContinue}>{t("Continue")}</Button></div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,79 +1,28 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { PIXEL_ICONS } from "./pixel-icons";
|
||||
|
||||
const PATHS: Record<string, ReactNode> = {
|
||||
home: <><path d="M3 12 12 3l9 9" /><path d="M5 10v10h14V10" /></>,
|
||||
inbox: <><path d="M22 12h-6l-2 3h-4l-2-3H2" /><path d="M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11Z" /></>,
|
||||
team: <><circle cx="9" cy="8" r="3.2" /><path d="M3 20c0-3.3 2.7-6 6-6s6 2.7 6 6" /><circle cx="17" cy="9" r="2.6" /><path d="M21 18.5c0-2.5-2-4.5-4.5-4.5" /></>,
|
||||
work: <><rect x="3" y="4" width="18" height="16" rx="2" /><path d="M8 4v16M16 4v16" /></>,
|
||||
chat: <path d="M21 12a8 8 0 0 1-11.6 7.15L4 20l1-4.4A8 8 0 1 1 21 12Z" />,
|
||||
docs: <><path d="M14 3H7a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h10a2 2 0 0 0 2-2V8z" /><path d="M14 3v5h5" /></>,
|
||||
approve: <><path d="M9 12l2 2 4-4" /><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z" /></>,
|
||||
social: <><path d="M4 11a8 8 0 0 1 8-8" /><path d="M4 11v4a4 4 0 0 0 4 4h1" /><circle cx="18" cy="6" r="2" /><circle cx="6" cy="18" r="2" /><circle cx="18" cy="18" r="2" /><path d="M8 17l8-9M18 8v8" /></>,
|
||||
settings: <><circle cx="12" cy="12" r="3" /><path d="M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1Z" /></>,
|
||||
search: <><circle cx="11" cy="11" r="7" /><path d="m20 20-3-3" /></>,
|
||||
plus: <path d="M12 5v14M5 12h14" />,
|
||||
minus: <path d="M5 12h14" />,
|
||||
chevron: <path d="m9 18 6-6-6-6" />,
|
||||
chevronDown: <path d="m6 9 6 6 6-6" />,
|
||||
chevronLeft: <path d="m15 18-6-6 6-6" />,
|
||||
more: <><circle cx="5" cy="12" r="1" /><circle cx="12" cy="12" r="1" /><circle cx="19" cy="12" r="1" /></>,
|
||||
edit: <><path d="M12 20h9" /><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z" /></>,
|
||||
filter: <path d="M3 5h18M6 12h12M10 19h4" />,
|
||||
file: <><path d="M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z" /><path d="M14 3v6h6" /></>,
|
||||
folder: <path d="M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2Z" />,
|
||||
grid: <><rect x="3" y="3" width="7" height="7" rx="1" /><rect x="14" y="3" width="7" height="7" rx="1" /><rect x="3" y="14" width="7" height="7" rx="1" /><rect x="14" y="14" width="7" height="7" rx="1" /></>,
|
||||
list: <path d="M8 6h13M8 12h13M8 18h13M4 6h.01M4 12h.01M4 18h.01" />,
|
||||
upload: <><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4" /><path d="m17 8-5-5-5 5M12 3v12" /></>,
|
||||
arrowRight: <path d="M5 12h14M13 5l7 7-7 7" />,
|
||||
arrowUpRight: <path d="M7 17 17 7M7 7h10v10" />,
|
||||
sparkle: <path d="M12 3v3M12 18v3M3 12h3M18 12h3M5.6 5.6l2.1 2.1M16.3 16.3l2.1 2.1M5.6 18.4l2.1-2.1M16.3 7.7l2.1-2.1" />,
|
||||
bot: <><rect x="4" y="7" width="16" height="12" rx="3" /><circle cx="9" cy="13" r="1" /><circle cx="15" cy="13" r="1" /><path d="M12 3v4M8 19v2M16 19v2" /></>,
|
||||
user: <><circle cx="12" cy="8" r="4" /><path d="M4 21c0-4.4 3.6-8 8-8s8 3.6 8 8" /></>,
|
||||
check: <path d="M5 12.5 10 17l9-10" />,
|
||||
x: <path d="M18 6 6 18M6 6l12 12" />,
|
||||
pin: <><path d="m12 17 .01 5M9.2 12.8 5 17M19 8c-1.3 0-3.5.3-4.7 1.5l-2 2c-.4.5-.4 1.1 0 1.5L14.7 15c.4.4 1 .4 1.5 0l2-2C19.4 11.6 20 9.5 20 8.2c0-.1-.1-.2-.2-.2" /></>,
|
||||
attach: <path d="m21 11.5-9.6 9.6a5.5 5.5 0 0 1-7.8-7.8l9.6-9.6a3.7 3.7 0 0 1 5.2 5.2L8.8 18.4a1.8 1.8 0 0 1-2.6-2.6L15 7" />,
|
||||
send: <><path d="m22 2-7 20-4-9-9-4Z" /><path d="M22 2 11 13" /></>,
|
||||
hash: <path d="M4 9h16M4 15h16M10 3 8 21M16 3l-2 18" />,
|
||||
lock: <><rect x="4" y="11" width="16" height="10" rx="2" /><path d="M8 11V7a4 4 0 0 1 8 0v4" /></>,
|
||||
bell: <><path d="M6 8a6 6 0 1 1 12 0c0 7 3 9 3 9H3s3-2 3-9" /><path d="M10 21a2 2 0 0 0 4 0" /></>,
|
||||
cmd: <path d="M15 15h3a3 3 0 0 0 0-6h-3v6Zm0 0v-6h-6m6 6v3a3 3 0 0 1-6 0v-3m0 0H6a3 3 0 0 1 0-6h3m0 6v-6m0 0V6a3 3 0 1 0-3 3h3Z" />,
|
||||
refresh: <><path d="M21 12a9 9 0 1 1-3-6.7" /><path d="M21 3v6h-6" /></>,
|
||||
pause: <><rect x="6" y="5" width="4" height="14" rx="1" /><rect x="14" y="5" width="4" height="14" rx="1" /></>,
|
||||
shield: <path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10Z" />,
|
||||
calendar: <><rect x="3" y="4.5" width="18" height="16" rx="2" /><path d="M3 9h18M8 2.5v4M16 2.5v4" /></>,
|
||||
target: <><circle cx="12" cy="12" r="8" /><circle cx="12" cy="12" r="3.6" /></>,
|
||||
};
|
||||
export type IconName = keyof typeof PIXEL_ICONS;
|
||||
|
||||
export type IconName = keyof typeof PATHS | (string & {});
|
||||
/** Each row's lit runs as one path, so an icon is a single crisp shape. */
|
||||
function bitmapPath(bitmap: string): string {
|
||||
return bitmap.split(" ").flatMap((row, y) =>
|
||||
[...row.matchAll(/#+/g)].map((run) => `M${run.index} ${y}h${run[0].length}v1h-${run[0].length}z`),
|
||||
).join("");
|
||||
}
|
||||
|
||||
export function Icon({
|
||||
name,
|
||||
size = 18,
|
||||
color = "currentColor",
|
||||
strokeWidth = 1.5,
|
||||
}: {
|
||||
name: IconName;
|
||||
size?: number;
|
||||
color?: string;
|
||||
strokeWidth?: number;
|
||||
}) {
|
||||
const node = PATHS[name];
|
||||
if (!node) throw new Error(`Unknown icon: ${name}`);
|
||||
const PATHS = Object.fromEntries(Object.entries(PIXEL_ICONS).map(([name, bitmap]) => [name, bitmapPath(bitmap)])) as Record<IconName, string>;
|
||||
|
||||
/** A 12-pixel icon drawn on the same whole-screen-pixel grid as the pixel font. */
|
||||
export function Icon({ name, color = "currentColor" }: { name: IconName; color?: string }) {
|
||||
return (
|
||||
<svg
|
||||
width={size}
|
||||
height={size}
|
||||
viewBox="0 0 24 24"
|
||||
fill="none"
|
||||
stroke={color}
|
||||
strokeWidth={strokeWidth}
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
viewBox="0 0 12 12"
|
||||
className="pixel-icon"
|
||||
fill={color}
|
||||
shapeRendering="crispEdges"
|
||||
aria-hidden="true"
|
||||
focusable="false"
|
||||
>
|
||||
{node}
|
||||
<path d={PATHS[name]} />
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
@@ -1,34 +1,21 @@
|
||||
import {
|
||||
BookOpen,
|
||||
Briefcase,
|
||||
Buildings2,
|
||||
ChatRoundDots,
|
||||
Folder,
|
||||
Gear,
|
||||
Home,
|
||||
Plug2,
|
||||
Send,
|
||||
ShieldCheck,
|
||||
Users,
|
||||
} from "reicon-react";
|
||||
import { Icon, type IconName } from "./Icon";
|
||||
import type { RouteId } from "./Shell";
|
||||
|
||||
/** One glyph per navigation surface, from the Reicon set. */
|
||||
const NAV_ICONS: Record<RouteId, typeof Home> = {
|
||||
home: Home,
|
||||
work: Briefcase,
|
||||
team: Users,
|
||||
chat: ChatRoundDots,
|
||||
runs: Send,
|
||||
files: Folder,
|
||||
library: BookOpen,
|
||||
approvals: ShieldCheck,
|
||||
connectors: Plug2,
|
||||
office: Buildings2,
|
||||
settings: Gear,
|
||||
/** One pixel glyph per navigation surface. */
|
||||
const NAV_ICONS: Record<RouteId, IconName> = {
|
||||
home: "home",
|
||||
work: "work",
|
||||
team: "team",
|
||||
chat: "chat",
|
||||
runs: "send",
|
||||
files: "folder",
|
||||
library: "book",
|
||||
approvals: "approve",
|
||||
connectors: "plug",
|
||||
office: "building",
|
||||
settings: "settings",
|
||||
};
|
||||
|
||||
export function NavIcon({ route, size = 18 }: { route: RouteId; size?: number }) {
|
||||
const Glyph = NAV_ICONS[route];
|
||||
return <Glyph size={size} />;
|
||||
export function NavIcon({ route }: { route: RouteId }) {
|
||||
return <Icon name={NAV_ICONS[route]} />;
|
||||
}
|
||||
@@ -62,7 +62,7 @@ export function OrgSwitcher({ snapshot, activeOrgId, onSelect, onNew, onDelete }
|
||||
>
|
||||
<span className="brand-mark">{orgInitial(active.name)}</span>
|
||||
<span className="brand-name">{active.name}</span>
|
||||
<Icon name="chevronDown" size={14} color="var(--text-3)" />
|
||||
<Icon name="chevronDown" color="var(--text-3)" />
|
||||
</button>
|
||||
{open && (confirmingOrg ? (
|
||||
<div role="menu" className="org-menu">
|
||||
@@ -100,8 +100,8 @@ export function OrgSwitcher({ snapshot, activeOrgId, onSelect, onNew, onDelete }
|
||||
>
|
||||
<span className="brand-mark sm">{orgInitial(org.name)}</span>
|
||||
<span className="org-menu-name">{org.name}</span>
|
||||
{org.id === activeOrgId && <Icon name="check" size={14} color="var(--text-1)" />}
|
||||
<span className="org-menu-chevron"><Icon name="chevron" size={14} /></span>
|
||||
{org.id === activeOrgId && <Icon name="check" color="var(--text-1)" />}
|
||||
<span className="org-menu-chevron"><Icon name="chevron" /></span>
|
||||
</button>
|
||||
</CascadeRow>
|
||||
))}
|
||||
@@ -112,7 +112,7 @@ export function OrgSwitcher({ snapshot, activeOrgId, onSelect, onNew, onDelete }
|
||||
className="org-menu-action"
|
||||
onClick={() => { setOpen(false); setConfirmingDelete(null); onNew(); }}
|
||||
>
|
||||
<span className="icon-box" style={{ width: 18, height: 18 }}><Icon name="plus" size={16} color="var(--text-2)" /></span>
|
||||
<span className="icon-box" style={{ width: 18, height: 18 }}><Icon name="plus" color="var(--text-2)" /></span>
|
||||
<span>{t("New organization")}</span>
|
||||
</button>
|
||||
</CascadeMenu>
|
||||
@@ -137,12 +137,12 @@ function OrgActions({
|
||||
<div className="org-menu-section-label">{org.name}</div>
|
||||
{!isActive && (
|
||||
<button type="button" role="menuitem" className="org-menu-action" onClick={onSwitch}>
|
||||
<span className="icon-box" style={{ width: 18, height: 18 }}><Icon name="arrowRight" size={16} color="var(--text-2)" /></span>
|
||||
<span className="icon-box" style={{ width: 18, height: 18 }}><Icon name="arrowRight" color="var(--text-2)" /></span>
|
||||
<span>{t("Switch to this org")}</span>
|
||||
</button>
|
||||
)}
|
||||
<button type="button" role="menuitem" className="org-menu-action danger" onClick={onDelete}>
|
||||
<span className="icon-box" style={{ width: 18, height: 18 }}><Icon name="x" size={16} color="var(--red)" /></span>
|
||||
<span className="icon-box" style={{ width: 18, height: 18 }}><Icon name="x" color="var(--red)" /></span>
|
||||
<span>{t("Delete organization")}</span>
|
||||
</button>
|
||||
</>
|
||||
|
||||
@@ -51,7 +51,7 @@ export function ProviderLogo({ providerKey, label, size = 30 }: { providerKey: s
|
||||
alt=""
|
||||
width={size}
|
||||
height={size}
|
||||
style={{ width: size, height: size, borderRadius: 7, objectFit: "cover", background: "#fff", flexShrink: 0 }}
|
||||
style={{ width: size, height: size, objectFit: "cover", background: "#fff", flexShrink: 0 }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@@ -60,13 +60,11 @@ export function ProviderLogo({ providerKey, label, size = 30 }: { providerKey: s
|
||||
style={{
|
||||
width: size,
|
||||
height: size,
|
||||
borderRadius: 7,
|
||||
background: "#a1a1aa",
|
||||
color: "#fff",
|
||||
display: "grid",
|
||||
placeItems: "center",
|
||||
fontSize: Math.round(size * 0.42),
|
||||
fontWeight: 600,
|
||||
fontSize: "var(--fs-body)",
|
||||
flexShrink: 0,
|
||||
}}
|
||||
>
|
||||
|
||||
@@ -73,7 +73,7 @@ export function ProviderOAuthConnect({
|
||||
if (phase === "done") {
|
||||
return (
|
||||
<div className="oauth-connect-row done">
|
||||
<Icon name="check" size={14} color="var(--green)" />
|
||||
<Icon name="check" color="var(--green)" />
|
||||
<span>{t("Signed in to {label}", { label })}</span>
|
||||
<button type="button" className="link-button" onClick={run}>{t("Sign in again")}</button>
|
||||
</div>
|
||||
|
||||
@@ -118,51 +118,51 @@ export function SearchDialog({
|
||||
|
||||
return (
|
||||
<Modal label={t("Search")} onEscape={onClose} onBackdrop={onClose} backdropStyle={overlayStyle}>
|
||||
<form onSubmit={submit} style={panelStyle}>
|
||||
<div className="row" style={{ padding: "10px 12px", borderBottom: "1px solid var(--border-soft)" }}>
|
||||
<Icon name="search" size={14} color="var(--text-3)" />
|
||||
<form onSubmit={submit} className="modal search-panel">
|
||||
<div className="row search-query">
|
||||
<Icon name="search" color="var(--text-3)" />
|
||||
<input
|
||||
autoFocus
|
||||
aria-label={t("Search query")}
|
||||
value={query}
|
||||
onChange={(event) => setQuery(event.target.value)}
|
||||
style={inputStyle}
|
||||
className="search-query-input"
|
||||
/>
|
||||
<select
|
||||
aria-label={t("Search filter")}
|
||||
className="input"
|
||||
value={filter}
|
||||
onChange={(event) => setFilter(event.target.value as SearchFilter)}
|
||||
style={{ width: 150, height: 28, padding: "2px 8px", fontSize: 12 }}
|
||||
style={{ width: 150, height: 28, padding: "2px 8px", fontSize: "var(--fs-body)" }}
|
||||
>
|
||||
<option value="all">{t("All")}</option>
|
||||
{SEARCH_ENTITY_TYPES.map((type) => <option key={type} value={type}>{LABELS[type]}</option>)}
|
||||
</select>
|
||||
<Button size="small" onClick={onClose}>{t("Close")}</Button>
|
||||
</div>
|
||||
<div style={{ maxHeight: 420, overflow: "auto", padding: 8 }} aria-busy={searching}>
|
||||
{searching && <div role="status" style={{ padding: 8, fontSize: 13, color: "var(--text-3)" }}>{t("Searching…")}</div>}
|
||||
<div className="search-results" aria-busy={searching}>
|
||||
{searching && <div role="status" style={{ padding: 8, fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{t("Searching…")}</div>}
|
||||
{current?.error && <div className="form-error" role="alert">{t("Search failed: {reason}", { reason: current.error })}</div>}
|
||||
{visibleResults.map((result) => (
|
||||
<button
|
||||
key={`${result.entityType}:${result.entityId}`}
|
||||
type="button"
|
||||
onClick={() => openResult(result)}
|
||||
style={rowStyle}
|
||||
className="search-row"
|
||||
>
|
||||
<Pill>{LABELS[result.entityType]}</Pill>
|
||||
<div style={{ flex: 1, minWidth: 0 }}>
|
||||
<div style={{ fontSize: 14, fontWeight: 540, overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{result.title}</div>
|
||||
<div style={{ fontSize: 12, color: "var(--text-3)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{result.preview}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{result.title}</div>
|
||||
<div style={{ fontSize: "var(--fs-body)", color: "var(--text-3)", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }}>{result.preview}</div>
|
||||
</div>
|
||||
<span style={{ fontSize: 12, color: "var(--text-3)" }}>{result.facets.type}</span>
|
||||
<span style={{ fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{result.facets.type}</span>
|
||||
</button>
|
||||
))}
|
||||
{current && !current.error && current.total === 0 && (
|
||||
<div role="status" style={{ padding: 8, fontSize: 13, color: "var(--text-3)" }}>{t("Nothing matches “{words}”.", { words: trimmed })}</div>
|
||||
<div role="status" style={{ padding: 8, fontSize: "var(--fs-body)", color: "var(--text-3)" }}>{t("Nothing matches “{words}”.", { words: trimmed })}</div>
|
||||
)}
|
||||
{current && current.total > 0 && (
|
||||
<div className="row" style={{ padding: "6px 8px", fontSize: 12, color: "var(--text-3)" }}>
|
||||
<div className="row" style={{ padding: "6px 8px", fontSize: "var(--fs-body)", color: "var(--text-3)" }}>
|
||||
<span role="status">{t("Showing {shown} of {total}", { shown: current.results.length, total: current.total })}</span>
|
||||
{current.results.length < current.total && (
|
||||
<span style={{ marginLeft: "auto" }}><Button size="small" onClick={showMore} disabled={loadingMore}>{loadingMore ? t("Loading…") : t("Show more")}</Button></span>
|
||||
@@ -210,33 +210,3 @@ const overlayStyle = {
|
||||
placeItems: "start center",
|
||||
paddingTop: "12vh",
|
||||
} satisfies CSSProperties;
|
||||
|
||||
const panelStyle = {
|
||||
width: "min(680px, calc(100vw - 32px))",
|
||||
border: "1px solid var(--border)",
|
||||
borderRadius: 12,
|
||||
background: "var(--panel)",
|
||||
boxShadow: "var(--shadow-md)",
|
||||
overflow: "hidden",
|
||||
} satisfies CSSProperties;
|
||||
|
||||
const inputStyle = {
|
||||
flex: 1,
|
||||
minWidth: 0,
|
||||
border: 0,
|
||||
outline: "none",
|
||||
background: "transparent",
|
||||
fontSize: 14,
|
||||
} satisfies CSSProperties;
|
||||
|
||||
const rowStyle = {
|
||||
width: "100%",
|
||||
border: 0,
|
||||
borderRadius: 8,
|
||||
background: "transparent",
|
||||
display: "flex",
|
||||
alignItems: "center",
|
||||
gap: 10,
|
||||
padding: "9px 10px",
|
||||
textAlign: "left",
|
||||
} satisfies CSSProperties;
|
||||
@@ -93,7 +93,7 @@ export function Shell({
|
||||
onDelete={onDeleteOrg}
|
||||
/>
|
||||
<button type="button" className="search-bar" aria-label={t("Search")} onClick={() => setSearchOpen(true)}>
|
||||
<Icon name="search" size={13} />
|
||||
<Icon name="search" />
|
||||
<span>{t("Search")}</span>
|
||||
<span className="search-kbd">{shortcutLabel("K")}</span>
|
||||
</button>
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
/** An XP-style bar: a framed track filled in pixel blocks, announced as a progress value. */
|
||||
export function XpBar({ percent, label }: { percent: number; label: string }) {
|
||||
const filled = Math.max(0, Math.min(100, Math.round(percent)));
|
||||
return (
|
||||
<div className="xp-bar" role="progressbar" aria-label={label} aria-valuemin={0} aria-valuemax={100} aria-valuenow={filled}>
|
||||
<div className="xp-fill" style={{ width: `${filled}%` }} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
import { useEffect, useState } from "react";
|
||||
import type { UiTheme } from "../../../shared/snapshot-domain";
|
||||
|
||||
export type DayPart = "dawn" | "day" | "dusk" | "night";
|
||||
export type Season = "spring" | "summer" | "autumn" | "winter";
|
||||
|
||||
/** Local-hour bands the palette rotates through. */
|
||||
export function dayPart(now: Date): DayPart {
|
||||
const hour = now.getHours();
|
||||
if (hour >= 5 && hour < 8) return "dawn";
|
||||
if (hour >= 8 && hour < 17) return "day";
|
||||
if (hour >= 17 && hour < 20) return "dusk";
|
||||
return "night";
|
||||
}
|
||||
|
||||
/** Meteorological seasons by month, northern hemisphere. */
|
||||
export function season(now: Date): Season {
|
||||
const month = now.getMonth();
|
||||
if (month >= 2 && month <= 4) return "spring";
|
||||
if (month >= 5 && month <= 7) return "summer";
|
||||
if (month >= 8 && month <= 10) return "autumn";
|
||||
return "winter";
|
||||
}
|
||||
|
||||
export function resolveTheme(theme: UiTheme, prefersDark: boolean, now: Date): "light" | "dark" {
|
||||
if (theme === "system") return prefersDark ? "dark" : "light";
|
||||
if (theme === "clock") return dayPart(now) === "night" ? "dark" : "light";
|
||||
return theme;
|
||||
}
|
||||
|
||||
const TICK_MS = 60_000;
|
||||
|
||||
/** Applies the theme, day part and season to the document root, rechecked every minute and whenever the OS scheme changes. */
|
||||
export function usePaletteClock(theme: UiTheme): void {
|
||||
const [now, setNow] = useState(() => new Date());
|
||||
const [prefersDark, setPrefersDark] = useState(() => window.matchMedia("(prefers-color-scheme: dark)").matches);
|
||||
useEffect(() => {
|
||||
const timer = window.setInterval(() => setNow(new Date()), TICK_MS);
|
||||
const media = window.matchMedia("(prefers-color-scheme: dark)");
|
||||
const onScheme = () => setPrefersDark(media.matches);
|
||||
media.addEventListener("change", onScheme);
|
||||
return () => {
|
||||
window.clearInterval(timer);
|
||||
media.removeEventListener("change", onScheme);
|
||||
};
|
||||
}, []);
|
||||
const resolved = resolveTheme(theme, prefersDark, now);
|
||||
const part = dayPart(now);
|
||||
const time = season(now);
|
||||
useEffect(() => {
|
||||
Object.assign(document.documentElement.dataset, { theme: resolved, daypart: part, season: time });
|
||||
}, [resolved, part, time]);
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
/** Hand-placed 12x12 pixel icons: rows separated by spaces, "#" is a lit pixel. */
|
||||
export const PIXEL_ICONS = {
|
||||
home: ".....##..... ....####.... ...##..##... ..##....##.. .##......##. ############ .#........#. .#..####..#. .#..#..#..#. .#..#..#..#. .#..#..#..#. .##########.",
|
||||
work: "............ ....####.... ....#..#.... ############ #..........# #..........# #####..##### #....##....# #..........# #..........# ############ ............",
|
||||
team: "............ ..##....##.. .####..####. .####..####. ..##....##.. ............ .####..####. ######.##### ######.##### ######.##### ............ ............",
|
||||
user: "............ ....####.... ...######... ...######... ...######... ....####.... ............ ..########.. .##########. .##########. .##########. ............",
|
||||
chat: "............ .##########. #..........# #..........# #.##.##.##.# #..........# #..........# .###.######. ...#.#...... ...##....... ...#........ ............",
|
||||
send: "..........## ........#### ......###.## ....###..##. ..###...##.. ####...##... ..###.##.... ....####.... .....###.... ......##.... ......#..... ............",
|
||||
folder: "............ ####........ #..#........ #..#######.. #........#.. ############ #..........# #..........# #..........# #..........# ############ ............",
|
||||
file: "#######..... #.....##.... #.....#.#... #.....####.. #........#.. #.#####..#.. #........#.. #.#####..#.. #........#.. #.####...#.. #........#.. ##########..",
|
||||
book: "............ .####..####. #....##....# #.##.##.##.# #....##....# #.##.##.##.# #....##....# #.##.##.##.# #....##....# .####..####. .....##..... ............",
|
||||
approve: ".....##..... ..########.. .#........#. .#........#. .#......#.#. .#.#...##.#. .#.##.##..#. .#..###...#. ..#..#...#.. ...#....#... ....#..#.... .....##.....",
|
||||
plug: "............ ...#....#... ...#....#... ..########.. ..#......#.. ..#......#.. ..#......#.. ...#....#... ....####.... .....##..... .....##..... .....##.....",
|
||||
building: "..########.. ..#......#.. ..#.##.#.#.. ..#......#.. ..#.##.#.#.. ..#......#.. ..#.##.#.#.. ..#......#.. ###.####.### #.#.#..#.#.# #.#.#..#.#.# ############",
|
||||
settings: ".....##..... ..#.####.#.. .##########. ..###..###.. .###....###. ####....#### ####....#### .###....###. ..###..###.. .##########. ..#.####.#.. .....##.....",
|
||||
search: "............ ..#####..... .#.....#.... #.......#... #.......#... #.......#... #.......#... .#.....#.... ..######.... .......###.. ........###. .........##.",
|
||||
plus: "............ ............ .....##..... .....##..... .....##..... ..########.. ..########.. .....##..... .....##..... .....##..... ............ ............",
|
||||
minus: "............ ............ ............ ............ ............ ..########.. ..########.. ............ ............ ............ ............ ............",
|
||||
chevron: "............ ............ ....##...... .....##..... ......##.... .......##... .......##... ......##.... .....##..... ....##...... ............ ............",
|
||||
chevronDown: "............ ............ ............ ............ ..##....##.. ...##..##... ....####.... .....##..... ............ ............ ............ ............",
|
||||
chevronLeft: "............ ............ ......##.... .....##..... ....##...... ...##....... ...##....... ....##...... .....##..... ......##.... ............ ............",
|
||||
more: "............ ............ ............ ............ ............ .##..##..##. .##..##..##. ............ ............ ............ ............ ............",
|
||||
edit: ".........##. ........#### .......####. ......####.. .....####... ....####.... ...####..... ..####...... .#.##....... .##......... .###........ ............",
|
||||
filter: "............ ############ .##########. ..########.. ...######... ....####.... ....####.... ....####.... ....####.... ....###..... ....##...... ............",
|
||||
grid: "............ .####..####. .####..####. .####..####. .####..####. ............ ............ .####..####. .####..####. .####..####. .####..####. ............",
|
||||
list: "............ ##..######## ##..######## ............ ............ ##..######## ##..######## ............ ............ ##..######## ##..######## ............",
|
||||
upload: ".....##..... ....####.... ...######... ..##.##.##.. .....##..... .....##..... .....##..... #....##....# #..........# #..........# ############ ............",
|
||||
arrowRight: "............ ............ .......#.... .......##... .......###.. ##########.. ##########.. .......###.. .......##... .......#.... ............ ............",
|
||||
arrowUpRight: "............ ....#######. .....######. ........###. .......####. ......###.#. .....###.... ....###..... ...###...... ..###....... .###........ ............",
|
||||
sparkle: ".....##..... .....##..... .....##..... ....####.... ..########.. ############ ..########.. ....####.... .....##..... .....##..... .....##..... ............",
|
||||
bot: ".....##..... .....##..... ..########.. .#........#. .#.##..##.#. .#.##..##.#. .#........#. .#..####..#. .#........#. ..########.. ...#....#... ...#....#...",
|
||||
check: "............ ............ ..........## .........##. ........##.. .......##... ##....##.... .##..##..... ..####...... ...##....... ............ ............",
|
||||
x: "............ .##......##. ..##....##.. ...##..##... ....####.... .....##..... ....####.... ...##..##... ..##....##.. .##......##. ............ ............",
|
||||
pin: "............ ....######.. .....####... .....####... .....####... ....######.. ...########. .......#.... .......#.... .......#.... .......#.... ............",
|
||||
attach: "....####.... ...#....#... ...#.##.#... ...#.#..#... ...#.#..#... ...#.#..#... ...#.#..#... ...#.#..#... ...#....#... ...#....#... ....####.... ............",
|
||||
hash: "............ ...#...#.... ...#...#.... .#########.. ...#...#.... ...#...#.... ..#...#..... #########... ..#...#..... ..#...#..... ............ ............",
|
||||
lock: "............ ....####.... ...#....#... ...#....#... ...#....#... ..########.. ..########.. ..###..###.. ..###..###.. ..########.. ..########.. ............",
|
||||
} as const;
|
||||
@@ -0,0 +1,20 @@
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
/** CSS px per font pixel so each one lands on a whole number of screen pixels: the device ratio rounded to the nearest integer (at least 1), over the ratio. */
|
||||
export function pixelScale(devicePixelRatio: number): number {
|
||||
return Math.max(1, Math.round(devicePixelRatio)) / devicePixelRatio;
|
||||
}
|
||||
|
||||
/** Keeps --px on the root in step with the display, including when the window moves to another screen. */
|
||||
export function usePixelScale(): void {
|
||||
const [ratio, setRatio] = useState(() => window.devicePixelRatio);
|
||||
useEffect(() => {
|
||||
const media = window.matchMedia(`(resolution: ${ratio}dppx)`);
|
||||
const onChange = () => setRatio(window.devicePixelRatio);
|
||||
media.addEventListener("change", onChange);
|
||||
return () => media.removeEventListener("change", onChange);
|
||||
}, [ratio]);
|
||||
useEffect(() => {
|
||||
document.documentElement.style.setProperty("--px", String(pixelScale(ratio)));
|
||||
}, [ratio]);
|
||||
}
|
||||
@@ -66,7 +66,6 @@ export function Avatar({
|
||||
const [hashedBg, hashedFg] = paletteFor(name);
|
||||
const bg = custom?.color || hashedBg;
|
||||
const fg = custom?.color ? "#fff" : hashedFg;
|
||||
const dim = size === "sm" ? 14 : size === "lg" ? 18 : size === "xl" ? 24 : 14;
|
||||
const emoji = custom?.emoji ?? null;
|
||||
const image = custom?.image ?? null;
|
||||
return (
|
||||
@@ -76,7 +75,7 @@ export function Avatar({
|
||||
) : emoji ? (
|
||||
<span aria-hidden>{emoji}</span>
|
||||
) : bot ? (
|
||||
<Icon name="bot" size={dim} />
|
||||
<Icon name="bot" />
|
||||
) : (
|
||||
initials(name)
|
||||
)}
|
||||
@@ -148,14 +147,12 @@ export function IconButton({
|
||||
onClick,
|
||||
label,
|
||||
variant = "ghost",
|
||||
size = 14,
|
||||
disabled = false,
|
||||
}: {
|
||||
icon: IconName;
|
||||
onClick?: () => void;
|
||||
label: string;
|
||||
variant?: "ghost" | "solid";
|
||||
size?: number;
|
||||
disabled?: boolean;
|
||||
}) {
|
||||
return (
|
||||
@@ -167,7 +164,7 @@ export function IconButton({
|
||||
onClick={onClick}
|
||||
disabled={disabled}
|
||||
>
|
||||
<Icon name={icon} size={size} />
|
||||
<Icon name={icon} />
|
||||
</button>
|
||||
);
|
||||
}
|
||||
|
||||
+113
-124
@@ -1,38 +1,35 @@
|
||||
/* Pixel design language: a Sweetie 16 based palette (GrafxKid), square corners, hard 2px shadows, and type at the pixel font's native 12px or 2x. */
|
||||
:root {
|
||||
/* Surfaces — pure-neutral gray ramp anchored on #181818 */
|
||||
--bg: #fafafa;
|
||||
--panel: #ffffff;
|
||||
--panel-2: #f6f6f6;
|
||||
--panel-3: #efefef;
|
||||
--hover: #f4f4f4;
|
||||
--border: #eaeaea;
|
||||
--border-strong: #e0e0e0;
|
||||
--border-soft: #f0f0f0;
|
||||
--bg: #dfe6ee;
|
||||
--panel: #f4f4f4;
|
||||
--panel-2: #e9eef3;
|
||||
--panel-3: #d5dde6;
|
||||
--hover: #e3e9ef;
|
||||
--border: #94b0c2;
|
||||
--border-strong: #333c57;
|
||||
--border-soft: #c9d5df;
|
||||
|
||||
/* Text — Primary #181818, Secondary #6A6A6A (+ derived muted/faint) */
|
||||
--text-1: #181818;
|
||||
--text-2: #6a6a6a;
|
||||
--text-3: #9a9a9a;
|
||||
--text-4: #c4c4c4;
|
||||
--text-1: #1a1c2c;
|
||||
--text-2: #333c57;
|
||||
--text-3: #566c86;
|
||||
--text-4: #94b0c2;
|
||||
|
||||
/* Accent + status */
|
||||
--accent: #5e6ad2;
|
||||
--accent-soft: #eef0ff;
|
||||
--green: #2f9e58;
|
||||
--green-soft: #e8f5ec;
|
||||
--amber: #c87d12;
|
||||
--amber-soft: #fbf3e2;
|
||||
--red: #d23b3b;
|
||||
--accent: #3b5dc9;
|
||||
--accent-soft: #c8d4f5;
|
||||
--green: #257a45;
|
||||
--green-soft: #d4f2dc;
|
||||
--amber: #a85a1d;
|
||||
--amber-soft: #fbe6c4;
|
||||
--red: #b13e53;
|
||||
--red-soft: #f6d5da;
|
||||
|
||||
/* Radius — 8 → 40 scale */
|
||||
--r-sm: 8px;
|
||||
--r-md: 12px;
|
||||
--r-lg: 16px;
|
||||
--r-xl: 20px;
|
||||
--r-2xl: 28px;
|
||||
--r-full: 999px;
|
||||
--r-sm: 0;
|
||||
--r-md: 0;
|
||||
--r-lg: 0;
|
||||
--r-xl: 0;
|
||||
--r-2xl: 0;
|
||||
--r-full: 0;
|
||||
|
||||
/* Spacing — strict 4px grid */
|
||||
--sp-1: 4px;
|
||||
--sp-2: 8px;
|
||||
--sp-3: 12px;
|
||||
@@ -43,63 +40,63 @@
|
||||
--sp-8: 32px;
|
||||
--sp-10: 40px;
|
||||
|
||||
/* Type scale — Geist; body 14/16, title 18, display 24 */
|
||||
--fs-caption: 12px;
|
||||
--fs-body: 14px;
|
||||
--fs-body-lg: 16px;
|
||||
--fs-title: 18px;
|
||||
--fs-display: 24px;
|
||||
/* The pixel font is drawn on a 12px grid: text is 1x, headings 2x; --px (shared/pixel-scale.ts) keeps each font pixel on whole screen pixels. */
|
||||
--px: 1;
|
||||
--fs-caption: calc(12px * var(--px));
|
||||
--fs-body: calc(12px * var(--px));
|
||||
--fs-body-lg: calc(12px * var(--px));
|
||||
--fs-title: calc(12px * var(--px));
|
||||
--fs-display: calc(24px * var(--px));
|
||||
|
||||
/* Icons — 18px glyph, 1.5 stroke, bound in a 24px box */
|
||||
--icon-box: 24px;
|
||||
|
||||
--shadow-sm: 0 1px 0 rgba(24, 24, 24, 0.03), 0 1px 2px rgba(24, 24, 24, 0.05);
|
||||
--shadow-md: 0 1px 3px rgba(24, 24, 24, 0.06), 0 6px 24px rgba(24, 24, 24, 0.05);
|
||||
--font-sans: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
|
||||
--shadow-sm: 2px 2px 0 0 var(--border-soft);
|
||||
--shadow-md: 4px 4px 0 0 rgba(26, 28, 44, 0.35);
|
||||
--font-sans: "Fusion Pixel", monospace;
|
||||
--font-mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
|
||||
--font-display: "Geist", -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui, sans-serif;
|
||||
--font-display: "Fusion Pixel", monospace;
|
||||
--motion-fast: 120ms;
|
||||
--motion-base: 200ms;
|
||||
--motion-slow: 280ms;
|
||||
--ease-out: cubic-bezier(0.25, 1, 0.5, 1);
|
||||
--ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
|
||||
--ease-out: steps(4, end);
|
||||
--ease-out-expo: steps(6, end);
|
||||
|
||||
/* Primary action — inverts against the theme */
|
||||
--btn-primary-bg: var(--text-1);
|
||||
--btn-primary-fg: #ffffff;
|
||||
--btn-primary-hover: #2c2c2c;
|
||||
--btn-primary-bg: var(--accent);
|
||||
--btn-primary-fg: #f4f4f4;
|
||||
--btn-primary-hover: #29366f;
|
||||
color-scheme: light;
|
||||
}
|
||||
|
||||
:root[data-theme="dark"] {
|
||||
--bg: #131313;
|
||||
--panel: #1b1b1b;
|
||||
--panel-2: #212121;
|
||||
--panel-3: #2a2a2a;
|
||||
--hover: #232323;
|
||||
--border: #2c2c2c;
|
||||
--border-strong: #3a3a3a;
|
||||
--border-soft: #242424;
|
||||
--bg: #1a1c2c;
|
||||
--panel: #262b44;
|
||||
--panel-2: #2c3352;
|
||||
--panel-3: #333c57;
|
||||
--hover: #2f3756;
|
||||
--border: #566c86;
|
||||
--border-strong: #94b0c2;
|
||||
--border-soft: #333c57;
|
||||
|
||||
--text-1: #ededed;
|
||||
--text-2: #a5a5a5;
|
||||
--text-3: #7c7c7c;
|
||||
--text-4: #4f4f4f;
|
||||
--text-1: #f4f4f4;
|
||||
--text-2: #c2d0dc;
|
||||
--text-3: #94b0c2;
|
||||
--text-4: #566c86;
|
||||
|
||||
--accent: #7c88e8;
|
||||
--accent-soft: #262a4a;
|
||||
--green: #45b06d;
|
||||
--green-soft: #16301f;
|
||||
--amber: #d99a3d;
|
||||
--amber-soft: #33270f;
|
||||
--red: #e05252;
|
||||
--accent: #41a6f6;
|
||||
--accent-soft: #29366f;
|
||||
--green: #a7f070;
|
||||
--green-soft: #1f3a2a;
|
||||
--amber: #ffcd75;
|
||||
--amber-soft: #3d3220;
|
||||
--red: #ef7d57;
|
||||
--red-soft: #3d1f26;
|
||||
|
||||
--shadow-sm: 0 1px 0 rgba(0, 0, 0, 0.25), 0 1px 2px rgba(0, 0, 0, 0.35);
|
||||
--shadow-md: 0 1px 3px rgba(0, 0, 0, 0.4), 0 6px 24px rgba(0, 0, 0, 0.35);
|
||||
--shadow-sm: 2px 2px 0 0 #10111c;
|
||||
--shadow-md: 4px 4px 0 0 rgba(0, 0, 0, 0.5);
|
||||
|
||||
--btn-primary-bg: #ededed;
|
||||
--btn-primary-fg: #131313;
|
||||
--btn-primary-hover: #ffffff;
|
||||
--btn-primary-bg: var(--accent);
|
||||
--btn-primary-fg: #1a1c2c;
|
||||
--btn-primary-hover: #73eff7;
|
||||
color-scheme: dark;
|
||||
}
|
||||
|
||||
@@ -107,14 +104,14 @@
|
||||
html, body, #root { width: 100%; height: 100%; margin: 0; }
|
||||
body {
|
||||
font-family: var(--font-sans);
|
||||
font-feature-settings: "cv01", "ss03";
|
||||
color: var(--text-1);
|
||||
background: var(--bg);
|
||||
font-size: var(--fs-body);
|
||||
line-height: 1.45;
|
||||
letter-spacing: -0.006em;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
text-rendering: optimizeLegibility;
|
||||
line-height: 1.5;
|
||||
font-synthesis: none;
|
||||
-webkit-font-smoothing: none;
|
||||
text-rendering: optimizeSpeed;
|
||||
image-rendering: pixelated;
|
||||
}
|
||||
.icon-box {
|
||||
width: var(--icon-box);
|
||||
@@ -141,7 +138,7 @@ a { color: inherit; }
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: var(--sp-4) var(--sp-3);
|
||||
border-right: 1px solid var(--border-soft);
|
||||
border-right: 2px solid var(--border-strong);
|
||||
background: var(--bg);
|
||||
}
|
||||
/* Clear the native macOS traffic lights that overlap the sidebar top. */
|
||||
@@ -176,18 +173,16 @@ a { color: inherit; }
|
||||
width: 22px;
|
||||
height: 22px;
|
||||
flex-shrink: 0;
|
||||
border-radius: 6px;
|
||||
border-radius: 0;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
color: #fff;
|
||||
background: linear-gradient(135deg, #1a1a1d 0%, #3a3a40 100%);
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
letter-spacing: -0.02em;
|
||||
color: var(--btn-primary-fg);
|
||||
background: var(--btn-primary-bg);
|
||||
box-shadow: 2px 2px 0 0 var(--border-strong);
|
||||
font-size: var(--fs-body);
|
||||
}
|
||||
.brand-name {
|
||||
flex: 1;
|
||||
font-weight: 560;
|
||||
font-size: var(--fs-body);
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
@@ -199,30 +194,33 @@ a { color: inherit; }
|
||||
align-items: center;
|
||||
gap: var(--sp-2);
|
||||
padding: var(--sp-2) var(--sp-3);
|
||||
border-radius: var(--r-sm);
|
||||
background: var(--panel-2);
|
||||
border-radius: 0;
|
||||
background: var(--panel);
|
||||
color: var(--text-3);
|
||||
margin-bottom: var(--sp-4);
|
||||
font-size: var(--fs-body);
|
||||
cursor: text;
|
||||
border: 0;
|
||||
border: 2px solid var(--border-strong);
|
||||
box-shadow: inset 2px 2px 0 0 var(--border-soft);
|
||||
width: 100%;
|
||||
transition: background var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
|
||||
}
|
||||
.search-bar:hover { background: var(--panel-3); color: var(--text-2); }
|
||||
.search-bar:hover { background: var(--hover); color: var(--text-2); }
|
||||
/* Shortcut as a key cap: a deeper bottom edge reads as a raised key. */
|
||||
.search-kbd {
|
||||
margin-left: auto;
|
||||
padding: 0 4px;
|
||||
font-size: var(--fs-caption);
|
||||
color: var(--text-3);
|
||||
font-family: var(--font-mono);
|
||||
color: var(--text-2);
|
||||
background: var(--panel-2);
|
||||
border: 2px solid var(--border);
|
||||
border-bottom-width: 4px;
|
||||
}
|
||||
.nav { display: flex; flex-direction: column; gap: 2px; }
|
||||
.nav-label {
|
||||
font-size: var(--fs-caption);
|
||||
color: var(--text-3);
|
||||
padding: var(--sp-3) var(--sp-2) var(--sp-2);
|
||||
font-weight: 540;
|
||||
letter-spacing: 0.01em;
|
||||
}
|
||||
.nav-item {
|
||||
display: flex;
|
||||
@@ -233,7 +231,6 @@ a { color: inherit; }
|
||||
border-radius: var(--r-sm);
|
||||
background: transparent;
|
||||
color: var(--text-2);
|
||||
font-weight: 500;
|
||||
font-size: var(--fs-body);
|
||||
text-align: left;
|
||||
width: 100%;
|
||||
@@ -241,17 +238,19 @@ a { color: inherit; }
|
||||
transition: background var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out), transform var(--motion-fast) var(--ease-out);
|
||||
}
|
||||
.nav-item:hover { background: var(--hover); color: var(--text-1); }
|
||||
.nav-item:active { transform: scale(0.985); }
|
||||
.nav-item.active { background: var(--panel-3); color: var(--text-1); font-weight: 560; }
|
||||
.nav-item.active svg { color: var(--text-1); }
|
||||
.nav-item.active { background: var(--btn-primary-bg); color: var(--btn-primary-fg); box-shadow: 2px 2px 0 0 var(--border-strong); }
|
||||
.nav-item.active svg { color: var(--btn-primary-fg); }
|
||||
.nav-item svg { color: var(--text-3); transition: color var(--motion-fast) var(--ease-out); }
|
||||
.nav-item .icon-box { color: var(--text-3); }
|
||||
.nav-item.active .icon-box { color: var(--text-1); }
|
||||
.nav-item.active .icon-box { color: var(--btn-primary-fg); }
|
||||
.nav-item span:not(.nav-badge):not(.icon-box) { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.nav-badge {
|
||||
margin-left: auto;
|
||||
padding: 0 4px;
|
||||
font-size: var(--fs-caption);
|
||||
color: var(--text-3);
|
||||
color: var(--accent);
|
||||
background: var(--accent-soft);
|
||||
clip-path: polygon(2px 0, calc(100% - 2px) 0, 100% 2px, 100% calc(100% - 2px), calc(100% - 2px) 100%, 2px 100%, 0 calc(100% - 2px), 0 2px);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
@@ -275,11 +274,10 @@ a { color: inherit; }
|
||||
.convo-item.active { background: var(--panel-3); color: var(--text-1); }
|
||||
.convo-ceo-badge {
|
||||
font-size: var(--fs-caption);
|
||||
font-weight: 560;
|
||||
color: var(--accent);
|
||||
background: var(--accent-soft);
|
||||
padding: 1px 6px;
|
||||
border-radius: 999px;
|
||||
border-radius: 0;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
@@ -327,8 +325,6 @@ a { color: inherit; }
|
||||
.org-menu-section-label {
|
||||
font-size: var(--fs-caption);
|
||||
color: var(--text-3);
|
||||
font-weight: 540;
|
||||
letter-spacing: 0.01em;
|
||||
padding: var(--sp-1) var(--sp-2);
|
||||
}
|
||||
.org-menu-row {
|
||||
@@ -346,14 +342,14 @@ a { color: inherit; }
|
||||
transition: background var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
|
||||
}
|
||||
.org-menu-row:hover { background: var(--hover); color: var(--text-1); }
|
||||
.org-menu-row.active { background: var(--panel-3); color: var(--text-1); font-weight: 540; }
|
||||
.org-menu-row.active { background: var(--panel-3); color: var(--text-1); }
|
||||
.org-menu-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
||||
.org-menu-delete {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 2px;
|
||||
border-radius: 4px;
|
||||
border-radius: 0;
|
||||
cursor: pointer;
|
||||
opacity: 0;
|
||||
transition: opacity var(--motion-fast) var(--ease-out), background var(--motion-fast) var(--ease-out);
|
||||
@@ -372,7 +368,6 @@ a { color: inherit; }
|
||||
}
|
||||
.org-menu-confirm-title {
|
||||
font-size: var(--fs-body);
|
||||
font-weight: 600;
|
||||
color: var(--text-1);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
@@ -393,7 +388,6 @@ a { color: inherit; }
|
||||
background: var(--red);
|
||||
color: #fff;
|
||||
font-size: var(--fs-caption);
|
||||
font-weight: 560;
|
||||
cursor: pointer;
|
||||
}
|
||||
.org-menu-confirm-no {
|
||||
@@ -428,15 +422,15 @@ a { color: inherit; }
|
||||
.brand-mark.sm {
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
font-size: 11px;
|
||||
border-radius: 6px;
|
||||
font-size: var(--fs-body);
|
||||
border-radius: 0;
|
||||
}
|
||||
|
||||
.sidebar-spacer { flex: 1; }
|
||||
.sidebar-foot {
|
||||
padding: var(--sp-3) var(--sp-2) var(--sp-1);
|
||||
margin-top: var(--sp-2);
|
||||
border-top: 1px solid var(--border-soft);
|
||||
border-top: 2px solid var(--border-soft);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--sp-2);
|
||||
@@ -464,14 +458,14 @@ a { color: inherit; }
|
||||
align-items: center;
|
||||
gap: var(--sp-3);
|
||||
padding: 0 var(--sp-5);
|
||||
border-bottom: 1px solid var(--border-soft);
|
||||
border-bottom: 2px solid var(--border-strong);
|
||||
-webkit-app-region: drag;
|
||||
}
|
||||
.topbar button,
|
||||
.topbar select,
|
||||
.topbar input,
|
||||
.topbar a { -webkit-app-region: no-drag; }
|
||||
.crumb { font-size: var(--fs-body); font-weight: 560; color: var(--text-1); }
|
||||
.crumb { font-size: var(--fs-body); color: var(--text-1); }
|
||||
.crumb-sub { font-size: var(--fs-body); color: var(--text-3); }
|
||||
.crumb-sep { color: var(--text-4); }
|
||||
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: var(--sp-2); }
|
||||
@@ -524,7 +518,7 @@ a { color: inherit; }
|
||||
bottom: -1px;
|
||||
width: 8px;
|
||||
height: 8px;
|
||||
border-radius: 50%;
|
||||
border-radius: 0;
|
||||
border: 1.5px solid var(--bg);
|
||||
}
|
||||
.page { max-width: 1100px; }
|
||||
@@ -553,9 +547,7 @@ a { color: inherit; }
|
||||
.page-h1 {
|
||||
margin: 0 0 var(--sp-1);
|
||||
font-family: var(--font-display);
|
||||
font-size: var(--fs-title);
|
||||
font-weight: 600;
|
||||
letter-spacing: -0.014em;
|
||||
font-size: var(--fs-display);
|
||||
}
|
||||
.page-sub {
|
||||
margin: 0 0 var(--sp-6);
|
||||
@@ -566,8 +558,6 @@ a { color: inherit; }
|
||||
margin-bottom: var(--sp-2);
|
||||
color: var(--text-3);
|
||||
font-size: var(--fs-caption);
|
||||
font-weight: 540;
|
||||
letter-spacing: 0.01em;
|
||||
}
|
||||
.row { display: flex; align-items: center; gap: var(--sp-2); min-width: 0; }
|
||||
.col { display: flex; flex-direction: column; min-width: 0; }
|
||||
@@ -606,10 +596,10 @@ a { color: inherit; }
|
||||
width: 26px;
|
||||
height: 24px;
|
||||
border: 0;
|
||||
border-radius: 4px;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
color: var(--text-2);
|
||||
font-size: 15px;
|
||||
font-size: var(--fs-body);
|
||||
line-height: 1;
|
||||
transition: background var(--motion-fast) var(--ease-out), color var(--motion-fast) var(--ease-out);
|
||||
}
|
||||
@@ -619,10 +609,10 @@ a { color: inherit; }
|
||||
min-width: 46px;
|
||||
height: 24px;
|
||||
border: 0;
|
||||
border-radius: 4px;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
color: var(--text-2);
|
||||
font-size: 12px;
|
||||
font-size: var(--fs-body);
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
.org-zoom-label:hover { background: var(--hover); color: var(--text-1); }
|
||||
@@ -645,12 +635,11 @@ a { color: inherit; }
|
||||
}
|
||||
.org-node-card:hover:not(:disabled) { border-color: var(--border-strong); box-shadow: var(--shadow-md); }
|
||||
.org-node-card:disabled { cursor: default; }
|
||||
.pixel-avatar { flex-shrink: 0; image-rendering: pixelated; }
|
||||
.org-node-card.human { border-color: var(--amber); background: var(--amber-soft); }
|
||||
.org-node-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
|
||||
.org-node-name {
|
||||
font-size: var(--fs-body);
|
||||
font-weight: 560;
|
||||
letter-spacing: -0.01em;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
@@ -675,4 +664,4 @@ a { color: inherit; }
|
||||
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
|
||||
|
||||
/* The object a link or search hit opened. */
|
||||
[data-revealed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
|
||||
[data-revealed="true"] { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 0; }
|
||||
Loaded 100 of 119 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user