Commit Graph
112 Commits
Author SHA1 Message Date
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
ZacharyZhang-NY 69724f0188 refactor(social): use Modal for AddAccountDialog 2026-04-16 22:04:24 -04:00
ZacharyZhang-NY 8541836b26 refactor(automation): use Modal for WorkflowEditor 2026-04-16 22:03:57 -04:00
ZacharyZhang-NY 183f22e922 fix(onboarding): derive step counter from STEP_ORDER
All six step panels previously hard-coded "X / 5" or "X / 6" in their
header captions, which drifted out of sync with the 7-step STEP_ORDER in
OnboardingHero. Export STEP_ORDER / TOTAL_STEPS / getStepNumber from
OnboardingHero and consume them in every step so the counter is always
the single source of truth.
2026-04-16 22:03:57 -04:00
ZacharyZhang-NY 5a5587c2a1 refactor(automation): use Modal for RuleFormModal 2026-04-16 22:03:24 -04:00
ZacharyZhang-NY 8243f58ef7 refactor(automation): use Modal/ConfirmDialog for DeleteConfirmDialog 2026-04-16 22:02:29 -04:00
ZacharyZhang-NY 2ec77677cb fix(renderer): classify DesktopEvent types to stop full-refresh fallthrough (D-05)
All 14+ non-specially-handled events were pushing into the batcher with
entityKeyFromEvent returning null, which set hasDomainChanged = true and
triggered a full snapshot refresh on every agent-message, run-status, and
heartbeat-status -- defeating the granular patch machinery.

Per-type classification:
- run-status         -> granular run-updated (patchRun by runId)
- heartbeat-status   -> granular agent-updated (patchAgent by agentId)
- agent-message      -> granular task-updated (patchTask refetches comments)
- new-message, thread-wait-state-updated, domain-changed
                     -> full refresh, coalesced via 500ms batcher window
- automation-fired, recovery-needed
                     -> snapshot-irrelevant, skipped at event source

Widen batcher window from 50ms to 500ms so bursts coalesce into one reload.
Granular batches still flush at the same window cadence.
2026-04-16 21:58:32 -04:00
ZacharyZhang-NY 0123103f58 fix(renderer): subscribe ConsoleView to logRevision to trigger re-render (D-04)
logRevision was bumped on every run-log event but no component subscribed,
so ref mutations to logBufferRef never triggered a re-render -- the console
pre stayed stale until something else forced a render.

Subscribe to logRevision via useAppStore and depend on it in the useMemo
that reads logBufferRef, keeping the ref-based buffer (cheap writes) while
restoring re-renders.
2026-04-16 21:57:08 -04:00
ZacharyZhang-NY 0119872db6 fix(renderer): use snapshot.currentCompanyId as single source of truth (D-03)
CompanySlice's standalone currentCompanyId field + setCurrentCompanyId action
were never written by any caller, so useDesktopEvents.ts read null and fell
through to full refresh for every entity event -- the granular patch
machinery was dead code.

- Remove currentCompanyId field + setCurrentCompanyId from CompanySlice
- refreshBadges reads from snapshot.currentCompanyId
- useDesktopEvents reads companyId from snapshot.currentCompanyId
- Update store unit test to seed snapshot instead of calling removed action
2026-04-16 21:56:40 -04:00
ZacharyZhang-NY a612ea7bea fix(communication): set searchLoading=true in setSearchQuery
setSearchQuery only incremented searchRequestId without flipping
searchLoading, so the UI could not distinguish "searching" from "no
results". Now loading flips true on non-empty query and clears
(results + loading) on empty query. setSearchResults keeps the
existing id-match logic to flip loading false on arrival.
2026-04-16 21:36:37 -04:00
ZacharyZhang-NY 1b578c111a update 2026-04-16 14:48:51 -04:00
ZacharyZhang-NY 9145572422 update 2026-04-05 20:14:48 -04:00
ZacharyZhang-NY b8dda3c8d0 update 2026-04-04 17:01:26 -04:00
ZacharyZhang-NY 67c757f481 update 2026-04-04 12:03:50 -04:00
ZacharyZhang-NY aed312124b update 2026-03-30 16:24:29 -04:00
ZacharyZhang-NY 6f1de8047e update 2026-03-30 00:15:21 -04:00
ZacharyZhang-NY 65e85135c1 large update 2026-03-29 14:08:15 -04:00
ZacharyZhang-NY 6480b7f49f fix(11): repair broken color patterns from CSS variable migration
- ChannelSidebar: replace inline color-mix style with Tailwind classes for task discussion icons
- MessageItem: replace broken priority config (color-mix inline) with Tailwind utility classes
- MessageItem: replace broken department badge hex-alpha pattern with Tailwind classes
- automation-config: restore ACCENT/LINE as hex values (used in template literal alpha suffixes)
- desktop-shell-service: set nativeTheme.themeSource to sync Windows title bar with app theme
2026-03-27 22:44:14 -04:00
ZacharyZhang-NY 831acc3b06 fix: use tinted backgrounds for message priority badges
Priority badges had identical bg and text colors (both solid destructive
red for urgent), creating oversized solid-color blocks. Use 15% tinted
backgrounds so text remains readable and badges appear as subtle pills.
2026-03-27 22:36:35 -04:00
ZacharyZhang-NY c780fb7a1c fix: correct task discussion channel colors in sidebar
The task discussion avatar used solid var(--primary) background making a
dark square. Use 12% tinted primary instead (matching other channel icons).
Also change selected state from bg-muted to bg-accent for consistency
with regular channel items.
2026-03-27 22:36:19 -04:00
ZacharyZhang-NY 259c0a279d fix: hide cancel button on first-launch onboarding
Add isFirstLaunch check to cancel button visibility so it only shows
when user is creating additional companies, not during initial setup.
2026-03-27 22:34:52 -04:00
ZacharyZhang-NY 0a0b2fdce4 fix: prevent onboarding page scrollbar by constraining to viewport height
Change outer container from min-h-[100dvh] to h-[100dvh] and hero panel
from overflow-y-auto to overflow-hidden to prevent unwanted scrollbar
caused by ASCII animation background content.
2026-03-27 22:34:38 -04:00