Pre-launch — Gluecron is in final validation. Public signups and git hosting for non-owner users open after launch review.
Commitc645a86unknown_key

Add Discussions — threaded community forum per repo (GitHub Discussions equivalent)

Add Discussions — threaded community forum per repo (GitHub Discussions equivalent)

https://claude.ai/code/session_01DzJMTFASjMHt2f5ze4cNLR
Claude committed on June 7, 2026Parent: d9b3649
4 files changed+734201c645a86dc7a18ca9cc8990c051c57503fb07fea4
4 changed files+734−201
Addeddrizzle/0077_discussion_categories.sql+25−0View fileUnifiedSplit
1-- Gluecron migration 0077: Discussion categories table.
2--
3-- Adds per-repo discussion_categories so discussions can be organised into
4-- named buckets (General, Q&A, Announcements, Ideas) rather than relying on
5-- a bare text enum. The existing discussions.category text column is kept for
6-- backwards-compatibility; new code reads categories from this table.
7--
8-- is_answerable = true means the category surfaces a "Mark as answer" button
9-- (GitHub's Q&A category behaviour).
10
11--> statement-breakpoint
12CREATE TABLE IF NOT EXISTS "discussion_categories" (
13 "id" serial PRIMARY KEY NOT NULL,
14 "repository_id" uuid NOT NULL,
15 "name" text NOT NULL,
16 "emoji" text NOT NULL DEFAULT '💬',
17 "description" text,
18 "is_answerable" boolean NOT NULL DEFAULT false,
19 CONSTRAINT "discussion_categories_repo_fk" FOREIGN KEY ("repository_id")
20 REFERENCES "repositories"("id") ON DELETE CASCADE
21);
22
23--> statement-breakpoint
24CREATE INDEX IF NOT EXISTS "discussion_categories_repo"
25 ON "discussion_categories" ("repository_id");
Modifiedsrc/db/schema.ts+23−1View fileUnifiedSplit
16601660export type DepUpdateRun = typeof depUpdateRuns.$inferSelect;
16611661
16621662// ---------------------------------------------------------------------------
1663// Block E2 — Discussions (migration 0013)
1663// Block E2 — Discussions (migration 0013 + 0077)
16641664// ---------------------------------------------------------------------------
16651665
1666/**
1667 * Per-repo discussion categories (migration 0077).
1668 * Seeded lazily on first discussion creation: General, Q&A, Announcements, Ideas.
1669 * is_answerable = true surfaces "Mark as answer" on threads in that category.
1670 */
1671export const discussionCategories = pgTable(
1672 "discussion_categories",
1673 {
1674 id: serial("id").primaryKey(),
1675 repositoryId: uuid("repository_id")
1676 .notNull()
1677 .references(() => repositories.id, { onDelete: "cascade" }),
1678 name: text("name").notNull(),
1679 emoji: text("emoji").notNull().default("💬"),
1680 description: text("description"),
1681 isAnswerable: boolean("is_answerable").notNull().default(false),
1682 },
1683 (table) => [index("discussion_categories_repo").on(table.repositoryId)]
1684);
1685
1686export type DiscussionCategory = typeof discussionCategories.$inferSelect;
1687
16661688/**
16671689 * Discussions — forum-style threaded conversations attached to a repo.
16681690 * Similar to GitHub Discussions: categorised + pinnable + answerable.
Modifiedsrc/routes/discussions.tsx+679−200View fileUnifiedSplit
Large file (1,157 lines). Load full file
Modifiedsrc/views/components.tsx+7−0View fileUnifiedSplit
148148 | "wiki"
149149 | "projects"
150150 | "agents"
151 | "discussions"
151152 | "settings";
152153}> = ({ owner, repo, active }) => (
153154 <div class="repo-nav">
160161 >
161162 Issues
162163 </a>
164 <a
165 href={`/${owner}/${repo}/discussions`}
166 class={active === "discussions" ? "active" : ""}
167 >
168 Discussions
169 </a>
163170 <a
164171 href={`/${owner}/${repo}/wiki`}
165172 class={active === "wiki" ? "active" : ""}
166173