Commit Graph
133 Commits
Author SHA1 Message Date
ZacharyZhang-NY 61aba41e77 refactor(renderer): rename EntityWorkspace to TwoPaneLayout for clarity 2026-04-16 23:33:55 -04:00
ZacharyZhang-NY 933fcf27d0 refactor(runs): extract useRunLogs hook from RunCenter
RunCenter had three useEffects juggling log-chunk loading, tailing, and
older-chunk fetches. Move the whole lifecycle into useRunLogs, which
uses a single effect + AbortController to scope every IPC call to the
current run and pauses polling while document.hidden.
2026-04-16 23:32:02 -04:00
ZacharyZhang-NY 0c9d8269c1 refactor(dashboard): consolidate BudgetAlertBanner dual source into helper 2026-04-16 23:31:58 -04:00
ZacharyZhang-NY c6935ff983 refactor(ui): move AttentionRow to ui and reuse in Inbox 2026-04-16 23:29:58 -04:00
ZacharyZhang-NY 736cff9371 refactor(titlebar): replace hand-drawn restored-window SVG with Phosphor Copy icon
P3-56 (renderer): the maximized-state button used a custom 3-rect SVG to
render the 'restored window' glyph while the minimize and close buttons
used Phosphor icons. Swap the SVG for Phosphor's Copy icon so all three
titlebar buttons share the same icon family and weight, and the visual
bundle no longer carries a one-off raster-like SVG block.
2026-04-16 23:29:04 -04:00
ZacharyZhang-NY 3edb2fc6c1 refactor(main): extract getOrCreateStore in RuntimeBridge
P3-56: three call sites repeated the same 'lookup → fall back to
new → set if missing' dance for session stores. The duplication hid the
fact that the fallback allocation in the second and third sites could
be wasted when the entry already existed. Extract a single
getOrCreateStore helper that does one map lookup, one conditional
construction, and always returns the cached instance.
2026-04-16 23:27:57 -04:00
ZacharyZhang-NY 326bfb3e38 refactor(communication): extract ComposerShell from MessageComposer and TaskDiscussionComposer 2026-04-16 23:27:41 -04:00
ZacharyZhang-NY aa1204babe refactor(organization): extract shared GoalForm and ProjectForm shells
Introduce goal-form/ and project-form/ directories each holding a
single shared shell that handles both create and edit modes via a
discriminated mode prop. The existing GoalCreator/GoalEditor and
ProjectCreator/ProjectEditor become thin wrappers that forward props
to the shared shell, eliminating duplicated state, JSX, and save/
delete handlers across the four files.
2026-04-16 23:27:40 -04:00
ZacharyZhang-NY 6809fa13af polish: reformat AutomationActivityLog JSX; InlineNotice alert role for actionable warns (P1-20, P3-63) 2026-04-16 23:12:57 -04:00
ZacharyZhang-NY a7ad4e5a8b polish: composite breadcrumb keys; pause run-log polling when tab hidden (P3-58, P3-59) 2026-04-16 23:11:25 -04:00
ZacharyZhang-NY 96ab72472c ConfirmDialog: accept confirmTone/confirmLabel/cancelLabel props (P3-57) 2026-04-16 23:10:48 -04:00
ZacharyZhang-NY 95c9deb778 refactor(useCompanyController): drop eslint-disable comments via getState() in callbacks (P2-24)
setters now read inline via useAppStore.getState() so exhaustive-deps
rule is satisfied without disables; 7 disable comments removed.
2026-04-16 23:10:36 -04:00
ZacharyZhang-NY ca9b94b5a6 titlebar: await windowMaximize promise instead of setTimeout race (P2-39) 2026-04-16 23:10:19 -04:00
ZacharyZhang-NY d8c2e10005 i18n(sidebar): localise company delete confirmation + Yes/No buttons (P3-48)
Delete-company confirmation text now uses sidebar.deleteCompanyConfirm key
with {name} placeholder; Yes/No buttons route through common.yes/no.
2026-04-16 23:09:15 -04:00
ZacharyZhang-NY 3a1f79324d toast: cap message max-height with scroll; assertive role for danger toasts (P2-38, P3-55) 2026-04-16 23:09:11 -04:00
ZacharyZhang-NY cd85419d1d oauth/inbox: use native ordered list; explicit severity fallback (P2-45, P2-48) 2026-04-16 23:08:44 -04:00
ZacharyZhang-NY e54aee8d8b style(App): localise console toggle labels, inline ease via tailwind class (P3-46, P3-47)
aria-label/title now use app.hideConsole/app.showConsole i18n keys; the
grid transition timing function moves from inline style into an
ease-[cubic-bezier(...)] utility.
2026-04-16 23:08:32 -04:00
ZacharyZhang-NY 7290338b11 composer: unify getAgentInitials; replace invalid focusRingColor with focus:ring-ring (P2-49, P2-32) 2026-04-16 23:07:40 -04:00
ZacharyZhang-NY 5da9945792 skills: replace hand-rolled primary button with ActionButton; use Input primitive (P2-33, P2-34) 2026-04-16 23:06:35 -04:00
ZacharyZhang-NY 7eba08cfb9 refactor(ExecutionSections): extract buildTaskEscalation policy from onClick (P2-38)
Move the blocked-vs-strategy approval-type decision out of JSX into a pure
buildTaskEscalation(task) helper so the escalation policy is testable and
not embedded in the click handler.
2026-04-16 23:05:58 -04:00
ZacharyZhang-NY 9e6aa61e09 feat(i18n): dev-mode warn on missing translation keys, default-locale fallback (P3-54)
Missing keys now log a console.warn in dev; at runtime the default-locale
dict is consulted before falling back to the raw key so zh users are not
shown literal keys when a zh translation is absent.
2026-04-16 23:05:20 -04:00
ZacharyZhang-NY dc368962f4 feat(desktop): preserve error.code via DesktopError class in unwrap (P3-52)
Callers can now catch DesktopError and inspect err.code to distinguish
auth/validation/unknown failures; plain Error fallback kept for message.
2026-04-16 23:05:00 -04:00
ZacharyZhang-NY 41fee50c55 EntityWorkspace: normalize typography to match Panel (20px/bold), use Eyebrow primitive (P1-10, P2-27) 2026-04-16 23:04:52 -04:00
ZacharyZhang-NY 84d11582a3 chore(store): use import.meta.env.DEV instead of process.env.NODE_ENV (P3-53)
Vite-native idiom; added vite/client triple-slash reference to env.d.ts
so TS knows about ImportMeta.env.
2026-04-16 23:04:36 -04:00
ZacharyZhang-NY b2eed3e75a fix(budget-policy-input): convert dollars to cents via string parsing (P2-35)
Avoid floating-point drift from parseFloat * 100 by parsing digits then
concatenating; dollarsToCents returns null for invalid input.
2026-04-16 23:02:37 -04:00
ZacharyZhang-NY 296c72eb3f composer/settings: use ActionButton iconOnly send; replace deprecated navigator.platform with lib/platform (P1-9, P2-46) 2026-04-16 23:02:29 -04:00
ZacharyZhang-NY b0b0cfa35b refactor(keyboard): extract shared nextIndexFor, drop duplicate handleKeyDown body (P2-28)
createRovingTabIndex and useRovingTabIndex now share one key-to-index
resolver; keeps both exports for test + React usage without drift risk.
2026-04-16 23:02:17 -04:00
ZacharyZhang-NY a063f5ed91 refactor(useCompanyData): extract filterByCompany helper, drop 14 inline filters (P2-34)
One filterByCompany<T>() helper replaces 14 nearly-identical snapshot.X
.filter((item) => !currentCompany || item.companyId === currentCompany.id)
expressions.
2026-04-16 23:01:34 -04:00
ZacharyZhang-NY f1dd9786e5 onboarding: remove AsciiAnimation decoration and 'by ELYDORA' signatures (P1-17, P1-18); move hero-drift keyframes to global CSS (P3-60) 2026-04-16 23:01:11 -04:00
ZacharyZhang-NY b58e64b555 refactor(ConsoleView): hoist Select options into useMemo, name shutdown sentinels, localise close label (P2-25, P2-26, P3-51)
Replace options IIFE with memoised runSelectOptions; extract magic-string
run-summary filters to SHUTDOWN_SUMMARY/WORKER_CRASH_SUMMARY constants;
localise Close console aria-label via console.close key.
2026-04-16 23:00:48 -04:00
ZacharyZhang-NY 1b11b53f84 onboarding: extract OnboardingStep shell (P1-11); eliminate 6 copies of motion+header chrome 2026-04-16 23:00:01 -04:00
ZacharyZhang-NY 17aa92d18d fix(formatters): use active locale for money/time/relative formatting (P2-29, P2-30)
Pull locale from useAppStore.getState() so zh users get zh-CN number/date
formatting and Chinese relative-time strings; drop en-US lock.
2026-04-16 22:59:41 -04:00
ZacharyZhang-NY 67035d1a8e fix(useDataLoader): cancel in-flight section fetches when company changes (P2-45)
Add currentCompanyId to effect deps so switching company aborts the
previous company's pending inbox/metrics/standup fetches before stale
results can overwrite new state.
2026-04-16 22:58:39 -04:00
ZacharyZhang-NY 8dbd0867b0 refactor(useCommandPaletteHotkeys): read selectedPaletteIndex from store, drop prop (P2-44)
Remove dual-source: option no longer takes selectedPaletteIndex; all reads
go through useAppStore.getState().selectedPaletteIndex inside the keydown
handler.
2026-04-16 22:58:12 -04:00
ZacharyZhang-NY 1b76a51894 perf(useUIController): hoist page/panel transition objects to module scope (P2-32)
Stable refs across renders eliminate unnecessary motion prop diffing.
2026-04-16 22:56:14 -04:00
ZacharyZhang-NY ca936aabe6 dashboard: extract AttentionRow, cap stagger at 8, limit pulse animation to first 2 rows (P1-15, P2-44, P2-47) 2026-04-16 22:56:09 -04:00
ZacharyZhang-NY 0845187672 refactor(sidebar): group nav into sidebarGroups instead of slice(0,3)+slice(3) (P2-27)
Move Core vs Collaborate grouping from implicit array index to explicit
sidebarGroups NavGroup[] structure surfaced from useUIController.
2026-04-16 22:55:58 -04:00
ZacharyZhang-NY b6e1756f1c refactor(CommandPaletteView): extract PaletteResultSection, closeAndReset (P1-23, P3-49, P3-50)
Five near-identical 25-line entity result blocks collapse into one
PaletteResultSection. Extract closeAndReset() callback used in 5 places.
Drop dead fallback: runs.find(...)?.id.slice(0,8) === run.id.slice(0,8).
2026-04-16 22:54:53 -04:00
ZacharyZhang-NY be0ff5a041 lib(renderer): add safeJson helper; migrate 6 JSON.parse try/catch call sites 2026-04-16 22:54:20 -04:00
ZacharyZhang-NY a07b42e493 refactor(App): extract Shell wrapper for locale+titlebar chrome (P1-20)
Collapse two near-identical LocaleContext/TranslationContext/TitleBar
wrapper blocks into a single Shell component.
2026-04-16 22:53:56 -04:00
ZacharyZhang-NY 4838750009 refactor(useDataLoader): drop 16 positional setters, use getState() (P1-22)
Function signature reduced from 16 args to 4; setters sourced from
useAppStore.getState() inside callbacks (stable refs, no deps needed).
useCompanyController no longer has to thread 14 setters through.
2026-04-16 22:53:08 -04:00
ZacharyZhang-NY 8dfa69cacf refactor(useUIController): group reads via useShallow, fetch setters from getState (P1-17)
Replace 11 individual useAppStore subscriptions with a single useShallow
selector; setters read once from useAppStore.getState() (stable refs).
2026-04-16 22:52:27 -04:00
ZacharyZhang-NY bea8aa9542 ui: add Card/Eyebrow/Spinner primitives, iconOnly ActionButton, drop ui.tsx barrel 2026-04-16 22:52:16 -04:00
ZacharyZhang-NY d42901b86d refactor(renderer): consolidate navigateTo into navigation slice (P1-11)
Delete the useUIController.navigateTo duplicate; augment slice version with
task-with-run lookup (via get().snapshot) so notification-click and command
palette share one codepath. App.tsx now reads navigateTo from the store.
2026-04-16 22:51:26 -04:00
ZacharyZhang-NY e2253b92fa refactor(renderer): dismantle useAppController 47-prop god-hook
Sections now subscribe directly to the Zustand store via useSectionContext
(shared data derivation) and useAppStore fine-grained selectors. Delete
useAppController, useExecutionController, useOrganizationController, and
useCommunicationController; the three domain forwarders held no logic
beyond re-exporting store slices.

SectionContentView becomes a 50-line layout dispatcher taking only
{section, error, pageTransition}; cross-domain run actions (startRun /
cancelRun) move into App.tsx and are exposed to sections through a new
AppActionsContext alongside refresh / setError / openPathWithFeedback.
App.tsx now calls useUIController + useCompanyController directly and
composes palette + navigation plumbing itself.
2026-04-16 22:12:51 -04:00
ZacharyZhang-NY de77f5f38e refactor(onboarding): replace 50-prop drilling with OnboardingContext
OnboardingStepPanel previously forwarded ~50 props to seven step
components, so adding a single wizard field meant touching four layers.
Introduce a renderer-local React Context (OnboardingProvider /
useOnboarding) that carries all wizard state and actions (connectors,
node status, company inputs, model selection, execution mode, mission,
launch summary, locale, t, error/loading). Step panels now receive only
their navigation callbacks (onContinue / onBack / onLaunch / onFinish)
and read everything else via useOnboarding(). CompanyOnboarding wraps
the step panel tree in OnboardingProvider with a memoised value.

Business logic is unchanged: each onContinueFrom* transition, the
bootstrap call, and the welcome-step branch remain exactly as before;
this refactor only moves the data-passing mechanism.
2026-04-16 22:11:45 -04:00
ZacharyZhang-NY f3816c6115 refactor(ui): unify success/danger/warning color tokens across Toast/StatusPill/InlineNotice 2026-04-16 22:10:43 -04:00
ZacharyZhang-NY a443312f1a refactor(automation): replace ACCENT/LINE constants with design tokens 2026-04-16 22:10:04 -04:00
ZacharyZhang-NY f177e6c877 refactor(settings): use Modal for OAuthPromptDialog 2026-04-16 22:06:59 -04:00
ZacharyZhang-NY 0f1b313272 refactor(execution): split ApprovalInspector 346-line god-component
Decompose monolithic src/renderer/components/execution/ApprovalInspector.tsx
into src/renderer/components/execution/approval-inspector/:
- ApprovalInspector.tsx (168 lines, orchestrator only)
- ApprovalSummary.tsx, ProposedHireCard.tsx, ApprovalDocumentsPanel.tsx
- DeliverableReviewPanel.tsx, SchedulePicker.tsx, DecisionForm.tsx
- TypeBadge.tsx, useApprovalPayload.ts, index.ts (barrel)

Hoist JSON.parse out of JSX IIFE into useApprovalPayload hook with typed
return. Replace roll-your-own role=radio spans with native
input[type=radio]. Extract getTypeBadgeClass switch into TypeBadge
component. Update execution.tsx barrel to re-export from new path.

Business logic preserved: approval decision flow, schedule validation,
deliverable review, document editing, delete confirmation.
2026-04-16 22:06:39 -04:00