Rebuild AgentCompany-New renderer to match design spec
- Port design tokens, sidebar, topbar, and icons to inline SVG set - Rewrite each page (Home/Team/Work/Chat/Files/Approvals/Social/Settings) to drive real snapshot data and match the bento, kanban, three-pane chat, file tree + pinned cards, approval queue, social schedule + calendar, and settings sub-nav layouts - Split Chat and Settings into per-concern subcomponents so every file stays under 500 lines - Add schema v4 for pinned files and scheduled posts plus IPC + service wiring; cover new behavior in unit tests - Update onboarding labels and Hire form to remove ambiguity for the expanded e2e suite (all settings tabs + 8 routes at 1280 and 980)
This commit is contained in:
1 parent
00736d5719
commit
74266566b7
47 files changed
+4609
-1552
No files matched your search
@@ -5,6 +5,7 @@ import { randomUUID } from "node:crypto";
|
||||
import { DatabaseSync } from "node:sqlite";
|
||||
import { describe, expect, test } from "vitest";
|
||||
import { DatabaseConnection } from "../../src/main/database/connection";
|
||||
import { FileService } from "../../src/main/services/file-service";
|
||||
import { OrganizationService } from "../../src/main/services/organization-service";
|
||||
import { SnapshotService } from "../../src/main/services/snapshot-service";
|
||||
import { SkillService } from "../../src/main/services/skill-service";
|
||||
@@ -244,6 +245,59 @@ describe("domain services", () => {
|
||||
connection.close();
|
||||
});
|
||||
|
||||
test("pins files and schedules social posts", () => {
|
||||
const connection = createConnection();
|
||||
const organization = new OrganizationService(connection.db);
|
||||
const social = new SocialService(connection.db);
|
||||
const files = new FileService(connection.db, join(tmpdir(), `artifacts-${randomUUID()}`));
|
||||
const snapshot = new SnapshotService(connection.db);
|
||||
let orgId = "";
|
||||
let socialAccountId = "";
|
||||
let fileId = "";
|
||||
let employeeId = "";
|
||||
|
||||
connection.transaction(() => {
|
||||
orgId = organization.createOrganization({
|
||||
organizationName: "Acme Operations",
|
||||
employeeName: "Dana Lee",
|
||||
mission: "Coordinate agents with auditable approvals.",
|
||||
goal: "Ship a verified control plane.",
|
||||
});
|
||||
employeeId = (connection.db.prepare("select id from employees where org_id = ?").get(orgId) as { id: string }).id;
|
||||
socialAccountId = social.createAccount({
|
||||
orgId,
|
||||
platform: SOCIAL_PLATFORM.X,
|
||||
handle: "@acme",
|
||||
displayName: "Acme",
|
||||
authorizedEmployeeId: employeeId,
|
||||
});
|
||||
fileId = createId("fil");
|
||||
connection.db.prepare(`
|
||||
insert into file_objects(
|
||||
id, org_id, name, kind, size_bytes, sha256, storage_path,
|
||||
owner_type, owner_id, space_id, pinned, created_at, updated_at
|
||||
)
|
||||
values (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
`).run(fileId, orgId, "launch-thread.md", "md", 256, "abc", "artifacts/launch-thread.md", "employee", employeeId, null, 0, new Date().toISOString(), new Date().toISOString());
|
||||
files.setPinned(orgId, fileId, true);
|
||||
social.createScheduledPost({
|
||||
orgId,
|
||||
socialAccountId,
|
||||
bodyMd: "Pilot starts Friday.",
|
||||
scheduledFor: new Date(Date.now() + 24 * 60 * 60 * 1000).toISOString(),
|
||||
state: "scheduled",
|
||||
createdByEmployeeId: employeeId,
|
||||
});
|
||||
});
|
||||
|
||||
const state = snapshot.load();
|
||||
expect(state.files[0]?.pinned).toBe(true);
|
||||
expect(state.scheduledPosts).toHaveLength(1);
|
||||
expect(state.scheduledPosts[0]?.state).toBe("scheduled");
|
||||
expect(state.scheduledPosts[0]?.socialAccountId).toBe(socialAccountId);
|
||||
connection.close();
|
||||
});
|
||||
|
||||
test("bootstraps the original onboarding chain with company, CEO, goal, project, task, and run", () => {
|
||||
const connection = createConnection();
|
||||
const onboarding = new OnboardingService({
|
||||
|
||||
Reference in new issue
Block a user