diff --git a/AgentCompany-New/src/renderer/src/app/App.tsx b/AgentCompany-New/src/renderer/src/app/App.tsx index 2cf6da73..8ff284e1 100644 --- a/AgentCompany-New/src/renderer/src/app/App.tsx +++ b/AgentCompany-New/src/renderer/src/app/App.tsx @@ -30,7 +30,7 @@ export function App() { ); } - const pageProps = { snapshot, actions }; + const pageProps = { snapshot, actions, navigate: setRoute }; const page = { home: , team: , diff --git a/AgentCompany-New/src/renderer/src/pages/HomePage.tsx b/AgentCompany-New/src/renderer/src/pages/HomePage.tsx index c056e996..cc3b75d1 100644 --- a/AgentCompany-New/src/renderer/src/pages/HomePage.tsx +++ b/AgentCompany-New/src/renderer/src/pages/HomePage.tsx @@ -13,7 +13,7 @@ import { NewTaskDialog } from "./NewTaskDialog"; import type { PageProps } from "./types"; import { activeOrgId, formatTime, money, requireActiveEmployee, requireActiveOrganization } from "./types"; -export function HomePage({ snapshot, actions }: PageProps) { +export function HomePage({ snapshot, actions, navigate }: PageProps) { const orgId = activeOrgId(snapshot); const organization = requireActiveOrganization(snapshot); const employee = requireActiveEmployee(snapshot); @@ -66,12 +66,13 @@ export function HomePage({ snapshot, actions }: PageProps) { state: "approved", decidedByEmployeeId: employee.id, }))} + onOpen={() => navigate("approvals")} />
- + navigate("work")} />
@@ -107,7 +108,9 @@ function TodayCard({ const owner = agents.find((agent) => agent.id === task.assigneeAgentId); const ownerName = owner?.name ?? employee.displayName; const time = agendaTime(task, date); - const requiresApproval = approvals.some((approval) => approval.title === task.title); + const requiresApproval = approvals.some( + (approval) => approval.sourceEntityType === "task" && approval.sourceEntityId === task.id, + ); return (
{time} @@ -129,11 +132,13 @@ function WaitingCard({ agents, employees, onApprove, + onOpen, }: { approvals: ApprovalRecord[]; agents: AgentRecord[]; employees: EmployeeRecord[]; onApprove: (approvalId: string) => void; + onOpen: () => void; }) { return (
@@ -152,7 +157,7 @@ function WaitingCard({
- +
); @@ -204,13 +209,20 @@ function SpendCard({ ); } -function InProgressCard({ tasks, agents }: { tasks: TaskRecord[]; agents: AgentRecord[] }) { +function InProgressCard({ tasks, agents, onViewAll }: { tasks: TaskRecord[]; agents: AgentRecord[]; onViewAll: () => void }) { const rows = tasks.slice(0, 4); return (
In progress - {tasks.length} active +
{rows.map((task, index) => { const owner = agents.find((agent) => agent.id === task.assigneeAgentId); diff --git a/AgentCompany-New/src/renderer/src/pages/types.ts b/AgentCompany-New/src/renderer/src/pages/types.ts index c2f8933b..19bde80a 100644 --- a/AgentCompany-New/src/renderer/src/pages/types.ts +++ b/AgentCompany-New/src/renderer/src/pages/types.ts @@ -4,10 +4,12 @@ import type { OrganizationRecord, } from "../../../shared/domain"; import type { SnapshotActions } from "../app/useSnapshot"; +import type { RouteId } from "../shared/Shell"; export interface PageProps { snapshot: AppSnapshot; actions: SnapshotActions; + navigate: (route: RouteId) => void; } export function activeOrgId(snapshot: AppSnapshot): string { diff --git a/AgentCompany-New/src/renderer/src/styles.css b/AgentCompany-New/src/renderer/src/styles.css index 13f4a4f3..55e63be0 100644 --- a/AgentCompany-New/src/renderer/src/styles.css +++ b/AgentCompany-New/src/renderer/src/styles.css @@ -520,6 +520,16 @@ textarea.input { min-height: 84px; resize: vertical; line-height: 1.5; } .table-row.clickable { cursor: pointer; } .table-row.clickable:hover { background: var(--hover); } +.link-button { + border: 0; + background: transparent; + padding: 0; + cursor: pointer; + font: inherit; + color: var(--text-3); +} +.link-button:hover { color: var(--text-1); } + .split-main { display: flex; flex-direction: row; min-height: 0; flex: 1; } .secondary-pane { width: 240px;