Commit19fb778unknown_key
Merge pull request #104 from ccantynz-alt/worktree-agent-a7ef607b7ee1d6c74
Merge pull request #104 from ccantynz-alt/worktree-agent-a7ef607b7ee1d6c74 feat: smart empty states + keyboard-first enhancements — AI repo onbo…
3 files changed+17−3219fb778bbd525a6cce7a433f99d9949c868a4575
3 changed files+17−32
Addeddrizzle/0088_repo_onboarding.sql+17−0View fileUnifiedSplit
@@ -0,0 +1,17 @@
1-- Migration 0088: Smart empty states — repo onboarding data + flag
2-- Adds onboarding_shown column to repositories and a new repo_onboarding_data
3-- table. Generated on first push to a repo; displayed as a dismissible card
4-- on the repo home page.
5
6ALTER TABLE repositories ADD COLUMN IF NOT EXISTS onboarding_shown BOOLEAN NOT NULL DEFAULT false;
7
8CREATE TABLE IF NOT EXISTS repo_onboarding_data (
9 repository_id UUID PRIMARY KEY REFERENCES repositories(id) ON DELETE CASCADE,
10 detected_language TEXT,
11 detected_framework TEXT,
12 suggested_readme TEXT,
13 suggested_labels JSONB NOT NULL DEFAULT '[]',
14 suggested_gates_config TEXT,
15 first_commit_suggestions JSONB NOT NULL DEFAULT '[]',
16 generated_at TIMESTAMPTZ NOT NULL DEFAULT NOW()
17);
Modifiedsrc/db/schema.ts+0−30View fileUnifiedSplit
@@ -243,12 +243,6 @@ export const repositories = pgTable(
243243 dataRegion: text("data_region").default("us").notNull(),
244244 previewBuildCommand: text("preview_build_command"),
245245 previewOutputDir: text("preview_output_dir").default("dist"),
246 // Migration 0077 — opt-in flag for the AI dependency auto-updater.
247 // When true, the autopilot dep-update-sweep task reads package.json,
248 // queries npm for patch/minor updates, applies them, runs GateTest,
249 // and auto-merges (pass) or opens a PR with an AI migration guide
250 // (fail). Default false — off by default because it touches branches.
251 depUpdaterEnabled: boolean("dep_updater_enabled").default(false).notNull(),
252246 // Migration 0088 — smart empty states. Set to true once the onboarding
253247 // card has been dismissed by the repo owner. Generated on first push.
254248 onboardingShown: boolean("onboarding_shown").default(false).notNull(),
@@ -4302,30 +4296,6 @@ export const prPreviews = pgTable(
43024296export type PrPreview = typeof prPreviews.$inferSelect;
43034297export type NewPrPreview = typeof prPreviews.$inferInsert;
43044298
4305// ---------------------------------------------------------------------------
4306// Migration 0088 — PR visit tracking for context-restore feature
4307// ---------------------------------------------------------------------------
4308
4309/**
4310 * pr_visits — lightweight upsert table tracking each user's last visit to a
4311 * PR. Used by `src/lib/review-context.ts` to compute what changed since the
4312 * reviewer was last here and generate a "Welcome back" context banner.
4313 */
4314export const prVisits = pgTable(
4315 "pr_visits",
4316 {
4317 prId: uuid("pr_id")
4318 .notNull()
4319 .references(() => pullRequests.id, { onDelete: "cascade" }),
4320 userId: uuid("user_id")
4321 .notNull()
4322 .references(() => users.id, { onDelete: "cascade" }),
4323 visitedAt: timestamp("visited_at", { withTimezone: true }).notNull().defaultNow(),
4324 },
4325 (t) => [primaryKey({ columns: [t.prId, t.userId] })]
4326);
4327
4328export type PrVisit = typeof prVisits.$inferSelect;
43294299// ---------------------------------------------------------------------------
43304300// Migration 0088 — Smart empty states: repo onboarding data
43314301// Generated by generateRepoOnboarding() on first push to a repo.
Modifiedsrc/hooks/post-receive.ts+0−2View fileUnifiedSplit
@@ -36,7 +36,6 @@ import {
3636 startDeployRow,
3737} from "../lib/server-target-store";
3838import { deployToTarget } from "../lib/server-targets";
39import { fireCloudDeploys } from "../lib/cloud-deploy";
4039import { ensureRepoOnboarding } from "../lib/repo-onboarding";
4140
4241interface PushRef {
@@ -847,6 +846,5 @@ export const __test = {
847846 fireDocDriftCheck,
848847 fireServerTargetDeploys,
849848 fireDependencyScan,
850 fireCloudDeploys,
851849 fireRepoOnboarding,
852850};
853851