Add nested posts UI cutover.
CI / test (pull_request) Successful in 8m23s

Render reply trees with permission-aware inline controls, and move hunt, profile, voting, submission, and hiding flows to post storage.
This commit is contained in:
2026-08-27 07:40:14 -07:00
parent 4d994d5300
commit d3ce29031f
22 changed files with 1033 additions and 351 deletions
+13
View File
@@ -64,6 +64,9 @@ CREATE TABLE IF NOT EXISTS posts (
{name: "index post replies", sql: `
CREATE INDEX IF NOT EXISTS idx_posts_parent_created
ON posts(parent_id, created_at, id)`},
{name: "index post authors", sql: `
CREATE INDEX IF NOT EXISTS idx_posts_author_created
ON posts(author_id, created_at DESC, id DESC)`},
{name: "index root posts", sql: `
CREATE INDEX IF NOT EXISTS idx_posts_root_date
ON posts(post_date, post_state)
@@ -117,6 +120,15 @@ CREATE INDEX IF NOT EXISTS idx_post_votes_post_id
return nil
}
func migratePostAuthorIndex(ctx context.Context, exec execContext) error {
if _, err := exec.ExecContext(ctx, `
CREATE INDEX IF NOT EXISTS idx_posts_author_created
ON posts(author_id, created_at DESC, id DESC)`); err != nil {
return fmt.Errorf("idx_posts_author_created: %w", err)
}
return nil
}
func migratePostDate(ctx context.Context, exec execContext) error {
steps := []struct {
name string
@@ -306,6 +318,7 @@ CREATE TABLE IF NOT EXISTS schema_migrations (
{"005_post_vote_post_id_index", migratePostVoteIndex},
{"006_post_date", migratePostDate},
{"007_post_state", migratePostState},
{"008_post_author_index", migratePostAuthorIndex},
}
for _, m := range migrations {
if applied[m.version] {