Commit Graph

179 Commits

Author SHA1 Message Date
Forgotten
dd0057baad fix(ui): add safe-area-inset-top for iPhone notch/dynamic island
Content was rendering behind the iPhone notch/dynamic island because
no top safe area inset was applied. Added pt-[env(safe-area-inset-top)]
to both the root Layout container and the mobile sidebar overlay.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 17:17:31 -06:00
Forgotten
25ad04eb10 fix(ui): improve issues page toolbar and rows for mobile
- Make Filter/Sort/Group buttons icon-only on small screens (< 640px)
- Make "New Issue" button icon-only on small screens
- Show filter count badge on mobile instead of full text
- Reduce gaps between toolbar items on mobile
- Hide date column and "Live" text on small screens for issue rows
- Add touch-action: manipulation to prevent double-tap zoom on mobile

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:51:17 -06:00
Forgotten
390e4dd839 feat: add board-claim flow for local_trusted -> authenticated migration
One-time high-entropy claim URL printed at startup when the only
instance admin is local-board. Signed-in user claims ownership,
gets promoted to instance_admin, and receives active memberships
across all existing companies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:25:31 -06:00
Forgotten
083ffaa71e fix(db): cast REPEAT count to integer in migration 0017
Prevents implicit type coercion error in some Postgres versions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:25:23 -06:00
Forgotten
4205007dc2 feat(ui): expand design guide with new component sections
Add Select, Dropdown Menu, Popover, Collapsible, Sheet, Scroll Area,
Command (CMDK), and Breadcrumb sections. Update status badge list and
keyboard shortcuts reference.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:08:31 -06:00
Forgotten
6c69247064 feat(ui): add mobile bottom navigation bar with scroll-hide
Five-tab bottom nav (Home, Issues, Create, Agents, Inbox) that hides
on scroll-down and reappears on scroll-up for more screen real estate.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:08:24 -06:00
Forgotten
7f58e783dd feat: add dev-runner script with tailscale-auth mode
Replace inline env vars in package.json dev scripts with a dedicated
node script that supports --tailscale-auth for private-network dev.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:08:17 -06:00
Forgotten
d2d927bd2f feat(db): enforce globally unique issue prefixes and identifiers
Derive issue_prefix from first 3 letters of company name with
deterministic suffixes on collision. Migration rebuilds existing
prefixes, reassigns issue numbers, and adds unique indexes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:08:10 -06:00
Forgotten
09e64b5b03 feat(ui): add 'All' quick filter to Issues list
Adds an 'All' option to the quick filter presets that shows issues
of all statuses without any status filtering applied.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 16:05:45 -06:00
Forgotten
31f8c0599d fix: prevent project name wrapping in properties pane
Add truncate with ellipsis to the project name in the properties pane
so long names stay on one line instead of wrapping.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 15:51:52 -06:00
Forgotten
7afabe789b fix: prevent chart date labels from being clipped on agent detail page
Remove overflow-hidden from DateLabels container divs so dates like
"2/10" and "2/23" are fully visible instead of truncated.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 15:23:30 -06:00
Forgotten
9f602f5c53 fix(ui): align Latest Run header and render summary as markdown
Move the "Latest Run" / "View details" header row outside the bordered
card so it aligns flush with other section headers (e.g. Recent Issues).
Render the run summary using MarkdownBody with max-height truncation
instead of plain text.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 15:23:08 -06:00
Forgotten
4b7fdaea01 fix: resolve image upload ERR_ACCESS_DENIED and dialog a11y warning
Eagerly read file data into memory via arrayBuffer() before constructing
FormData for the upload fetch. Clipboard-paste File objects from the MDX
editor reference transient browser data that may be discarded after the
paste event handler returns; streaming that stale reference in the fetch
body causes net::ERR_ACCESS_DENIED. Reading into an ArrayBuffer first
makes the FormData self-contained.

Also suppress the Radix UI "Missing Description" console warning on the
NewIssueDialog by setting aria-describedby={undefined}.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 15:21:04 -06:00
Forgotten
f800374f3a feat(ui): add "See All" link to agent detail Recent Issues section
Remove the issue count from the Recent Issues heading and add a
"See All →" link that navigates to /issues?assignee={agentId}.
The Issues page now reads the assignee query param and pre-filters
the list to show that agent's issues.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 15:13:59 -06:00
Forgotten
0db2795d1d fix: convert navigate() calls to Link components for cmd-click support
Replaced button/div onClick + navigate() patterns with React Router
<Link> components so that cmd-click (or ctrl-click) opens pages in a
new browser tab. Changes across:

- AgentDetail: RunListItem, "Issues Touched" items, "Manage" config
  link, "Back to runs" mobile button
- CompanySwitcher: "Company Settings" and "Manage Companies" items
- Approvals: pass detailLink prop instead of onOpen callback
- Org: OrgTree nodes now render as Links

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 14:50:20 -06:00
Forgotten
cf4b338cd4 feat(ui): remember last visited page per company on company switch
When switching companies via the sidebar rail, dropdown, or keyboard
shortcuts, the app now navigates to the last page visited for that
company instead of staying on the current (now irrelevant) page.
Falls back to /dashboard if no previous page exists.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 14:47:54 -06:00
Forgotten
b05ac91aa7 fix: re-sync company sidebar order from localStorage on data load
The orderedIds state was initialized at mount time when companies was
still an empty array (React Query hadn't resolved yet). When companies
data arrived, orderedIds remained empty so the sidebar fell back to
API-returned order, ignoring the user's saved drag order.

Add a useEffect that re-derives orderedIds from localStorage whenever
the companies array changes, ensuring the user's custom sort order
persists across data refetches and live update invalidations.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 14:43:35 -06:00
Forgotten
21c506dcae docs: add deployment modes documentation and update plans
Add DEPLOYMENT-MODES.md with canonical mode taxonomy. Update CLI.md,
DEVELOPING.md, PRODUCT.md, and SPEC-implementation.md with local_trusted/
authenticated nomenclature. Revise humans-and-permissions plan with Better
Auth choice, bootstrap flow, unified invite semantics, and expanded criteria.
Add implementation guide and additional plan documents for cursor cloud
adapter and deployment auth mode consolidation.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 14:41:35 -06:00
Forgotten
2ec45c49af feat(ui): add auth pages, company rail, inbox redesign, and page improvements
Add Auth sign-in/sign-up page and InviteLanding page for invite acceptance.
Add CloudAccessGate that checks deployment mode and redirects to /auth when
session is required. Add CompanyRail with drag-and-drop company switching.
Add MarkdownBody prose renderer. Redesign Inbox with category filters and
inline join-request approval. Refactor AgentDetail to overview/configure/runs
views with claude-login support. Replace navigate() anti-patterns with <Link>
components in Dashboard and MetricCard. Add live-run indicators in sidebar
agents. Fix LiveUpdatesProvider cache key resolution for issue identifiers.
Add auth, health, and access API clients.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 14:41:21 -06:00
Forgotten
5b983ca4d3 feat(cli): add deployment mode prompts, auth bootstrap-ceo command, and doctor check
Extend server setup prompts with deployment mode (local_trusted vs
authenticated), exposure (private vs public), bind host, and auth config.
Add auth bootstrap-ceo command that creates a one-time invite URL for the
initial instance admin. Add deployment-auth-check to doctor diagnostics.
Register the new command in the CLI entry point.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 14:40:59 -06:00
Forgotten
2ddf6213fd feat(adapter): detect claude-login-required errors and expose errorCode/errorMeta
Add detectClaudeLoginRequired and extractClaudeLoginUrl to parse module.
Extract buildClaudeRuntimeConfig for reuse by both execute and the new
runClaudeLogin helper. Include errorCode: "claude_auth_required" and
errorMeta: { loginUrl } in execution results when login is needed.
Export runClaudeLogin from the package index.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 14:40:44 -06:00
Forgotten
e1f2be7ecf feat(server): integrate Better Auth, access control, and deployment mode startup
Wire up Better Auth for session-based authentication. Add actor middleware
that resolves local_trusted mode to an implicit board actor and authenticated
mode to Better Auth sessions. Add access service with membership, permission,
invite, and join-request management. Register access routes for member/invite/
join-request CRUD. Update health endpoint to report deployment mode and
bootstrap status. Enforce tasks:assign and agents:create permissions in issue
and agent routes. Add deployment mode validation at startup with guardrails
(loopback-only for local_trusted, auth config required for authenticated).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 14:40:32 -06:00
Forgotten
60d6122271 feat: add auth/access foundation - deps, DB schema, shared types, and config
Add Better Auth, drizzle-orm, @dnd-kit, and remark-gfm dependencies.
Introduce DB schema for auth tables (user, session, account, verification),
company memberships, instance user roles, permission grants, invites, and
join requests. Add assigneeUserId to issues. Extend shared config schema
with deployment mode/exposure/auth settings, add access types and validators,
and wire up new API path constants.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 14:40:16 -06:00
Forgotten
08faeb53b5 fix: cap new issue dialog height so long descriptions don't hide controls
The description area in the non-expanded NewIssueDialog could grow
unboundedly, pushing the property chips and footer off-screen. Now
the dialog has max-h-[calc(100vh-6rem)] in both modes, and the
description wrapper scrolls when content overflows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 13:37:45 -06:00
Forgotten
cf237d2e7f feat: add agent icons with picker and collapsible sidebar section
- Add `icon` text column to agents DB schema with migration
- Add icon field to shared Agent type and validators
- Create AgentIconPicker component with 40+ curated lucide icons and search
- Show clickable icon next to agent name on detail page header
- Replace static Agents nav item with collapsible AGENTS section in sidebar
- Each agent shows its icon (defaulting to Bot) with truncated name

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 12:25:13 -06:00
Forgotten
5b8708eae9 feat: make filters dropdown multi-column layout
Converts the single-column stacked filters popover into a 2-column grid
layout. Status filters appear in the left column, Priority + Assignee in
the right column. On mobile (<640px), falls back to single column.
Popover width increased from 320px to 480px with viewport-aware max to
prevent overflow.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 10:58:22 -06:00
Forgotten
ab56a510cc feat: move project description to overview tab and add color picker
- Moved description editing from header to Overview tab content
- Header now shows colored rounded square + project name only
- Added ColorPicker component: clicking the color square opens a
  popover with a 5x2 grid of PROJECT_COLORS to choose from
- Current color is highlighted with a ring indicator

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 09:56:31 -06:00
Forgotten
2a4c0c312d style: make issue filters bar smaller and tighter
- Reduce filter/sort/group button text to text-xs
- Shrink icons from h-3.5/w-3.5 to h-3/w-3
- Tighten icon-to-text spacing from mr-1.5 to mr-1

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 09:55:28 -06:00
Forgotten
a57d3427f7 feat: foldable PROJECTS section in sidebar with color support
- Add `color` (text) and `archivedAt` (timestamp) columns to projects table
- Add PROJECT_COLORS palette constant (10 colors) in shared package
- Add color/archivedAt to Project type interface and Zod validators
- Auto-assign next available color from palette on project creation
- New SidebarProjects component with:
  - Collapsible PROJECTS header above WORK section
  - Caret toggle visible on hover (left of header)
  - Always-visible plus button (right of header) opens NewProjectDialog
  - Lists non-archived projects with colored rounded squares
  - Active project highlighted based on URL match
- Remove Projects nav item from WORK section in sidebar

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-23 09:14:08 -06:00
Forgotten
3392f4dbfa fix: use issue shortname (identifier) in activity feed instead of title
Activity feed and dashboard now display issue identifiers like PAP-32
instead of issue titles for entity names. Also uses identifier-based
URLs for issue links in the activity feed.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 08:25:08 -06:00
Forgotten
fe63c10d69 Include issue identifier in all activity log details for notifications
Activity log events for issue.created and issue.updated were missing
the identifier field in their details, causing toast notifications to
fall back to showing a truncated UUID hash instead of the shortname
(e.g. PAP-47). Also includes checkout lock adoption and activity
query improvements.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 08:23:44 -06:00
Forgotten
57f88f6f6a feat: make comment identity headers clickable links to agent pages
Wraps the Identity component in comment headers with a Link to
/agents/{agentId} so users can click through to view agent details.
Applied to both CommentThread and ApprovalDetail comment sections.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-21 08:19:38 -06:00
Forgotten
40512ad533 Add hour and minute to comment timestamps on issue pages
Comments now show localized date+time (e.g. "Feb 20, 2026, 2:15 PM")
instead of just the date. Added formatDateTime utility to keep the
existing date-only formatDate unchanged for other contexts.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 16:19:54 -06:00
Forgotten
95f0d36adc Fix @-mention tab completion cursor positioning
After tab-completing a mention, the cursor was placed before the
completion instead of after it. The root cause: Lexical's DOM
reconciliation after document.execCommand("insertText") would lose
the browser-set cursor position. Added requestAnimationFrame-based
cursor repositioning that first tries the original text node, then
falls back to searching for the mention text in the DOM.

Also normalizes editor content padding for consistent mention dropdown
positioning.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 16:07:37 -06:00
Forgotten
9906a5ba06 Support issue identifiers (PAP-39) in URLs and prefer them throughout
Backend:
- Add router.param middleware in issues, activity, and agents routes to
  resolve identifiers (e.g. PAP-39) to UUIDs before handlers run
- Simplify GET /issues/:id now that param middleware handles resolution
- Include identifier in getAncestors response and issuesForRun query
- Add identifier field to IssueAncestor shared type

Frontend:
- Update all issue navigation links across 15+ files to use
  issue.identifier ?? issue.id instead of bare UUIDs
- Add URL redirect in IssueDetail: navigating via UUID automatically
  replaces the URL with the human-readable identifier
- Fix childIssues filter to use issue.id (UUID) instead of URL param
  so it works correctly with identifier-based URLs
- Add issueUrl() utility in lib/utils.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 16:04:05 -06:00
Forgotten
0c0c308594 Make toast notifications more informative
- Server: Add bodySnippet, identifier, issueTitle to comment_added
  activity details so the UI can show comment content
- Client: Show comment snippet in comment toasts instead of just
  "posted a comment on PAP-39"
- Client: Add agent title/role as body text in agent status toasts
- Client: Show trigger detail in run status toasts for context

PAP-31

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 15:52:53 -06:00
Forgotten
cae0f416f2 Fix issue short-id vertical alignment in EntityRow
Add position: relative with top: 1px to the identifier span
so "PAP-38" style labels align properly in issue tables.

PAP-39

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 15:49:16 -06:00
Forgotten
65f09a1a9d UI: richer toasts, log viewer scroll fix, multi-goal projects, active panel issue context
Improve activity toasts with actor names, issue identifiers, and
action links. Fix LogViewer auto-scroll to work with scrollable
parent containers instead of only window. Add issue context display
to ActiveAgentsPanel run cards. Support multi-goal selection in
NewProjectDialog. Update GoalDetail to match multi-goal project
linking.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 15:48:42 -06:00
Forgotten
82da8739c1 Add board mutation guard middleware
Require trusted browser origin (Origin or Referer header) for
mutating requests from board actors, preventing cross-origin
mutation attempts against the local-trusted API.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 15:48:30 -06:00
Forgotten
49e15f056d Implement issue execution lock with deferred wake promotion
Add per-issue execution lock (executionRunId, executionAgentNameKey,
executionLockedAt) to prevent concurrent runs on the same issue.
Same-name wakes are coalesced into the active run; different-name
wakes are deferred and promoted when the lock holder finishes.

Includes checkout/release run ownership enforcement, agent run ID
propagation from JWT claims, wakeup deduplication across assignee
and mention wakes, and claimQueuedRun extraction for reuse. Adds
two DB migrations for checkoutRunId and execution lock columns.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 15:48:22 -06:00
Forgotten
4e18cfa818 Add issue run orchestration plan
Document the design for per-issue execution locks that prevent
cascaded wakeups from spawning concurrent runs on the same issue.
Covers same-name coalescing, cross-agent deferral, and deferred
promotion on run completion.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 15:48:07 -06:00
Forgotten
3396a76c9c fix: consistent label spacing in all properties panes
Replace justify-between with fixed w-20 label width in PropertyRow
across IssueProperties, AgentProperties, GoalProperties, and
ProjectProperties for consistent two-column alignment.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 15:10:29 -06:00
Forgotten
487b3fe374 Remove collapsible behavior from sidebar Work and Company sections
The sidebar sections no longer fold/unfold — they are always visible.
Removed Collapsible component, chevron icon, and open/close state.

PAP-38

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 15:08:03 -06:00
Forgotten
7f382ce568 fix: add gap between labels and values in all properties panes
Add gap-3 to PropertyRow flex containers so labels don't touch their
values. Also add shrink-0 on labels and min-w-0 on value containers
to prevent overflow issues.

Applied to: IssueProperties, AgentProperties, GoalProperties,
ProjectProperties.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 15:00:56 -06:00
Forgotten
3a7afe7b66 fix: @-mention autocomplete selection and dismissal
- Use a ref for mentionState so selectMention always reads the latest
  value (prevents stale-closure "blink" on click/Enter/Tab)
- Add explicit space key handling to dismiss the popup immediately
- Move Escape handler outside filteredMentions check so it always works
- Sync mentionStateRef on all state transitions

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 14:59:20 -06:00
Forgotten
735bea5dee fix: @-mention autocomplete — Enter/Tab/click now insert correctly
The old approach used document.execCommand("insertText") to directly
manipulate the contentEditable DOM, but MDXEditor (Lexical) reverted
these changes during reconciliation causing the "blink" bug.

Fix: work at the markdown string level instead — find the @query in
the markdown, replace it with @Name, and update via setMarkdown().
Also add an input event listener alongside selectionchange for more
reliable mention detection (fixes space-to-dismiss).

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 14:53:46 -06:00
Forgotten
2d2906f23f feat: show child issues on issue detail page
Add a Sub-issues section between Comments and Linked Approvals on the
issue detail page. Lists child issues with status, priority, identifier,
title, and assignee. Reuses the cached company issues list for zero
extra API calls.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 14:48:30 -06:00
Forgotten
168d7a45e3 feat: add /issues/recent tab — flat list sorted by most recent updates
Shows all issues in a single flat list ordered by updatedAt descending,
without grouping by status. Displays the update timestamp instead of
creation date in the trailing column.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 14:18:59 -06:00
Forgotten
52224bc4aa feat: extract Permissions & Configuration pane, flatten Run Policy
- Move Advanced Adapter Settings into standalone Permissions & Configuration pane
- Convert create-mode Run Policy from collapsible to regular section
- Remove unused adapterAdvancedOpen and heartbeatOpen state

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 14:16:21 -06:00
Forgotten
53060e770c fix: log viewer auto-follow uses distance-from-bottom instead of element visibility
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-20 14:11:35 -06:00