Skip to content

feat(channels): record and show whether a channel proposal was auto- or admin-approved #616

Closed

Description

@dborup

Problem

With channelProposals.autoApprove on, an admin cannot see which approved channels were auto-approved and which were approved by hand. channel_proposals stores only status, created_at and reviewed_at (cmd/ingestor/channel_proposals.go, submitChannelProposal). Today the only way to tell is to read the database and infer it from reviewed_at ≈ created_at.

Proposal

  1. Schema (ingestor; the server stays read-only). Add a nullable column channel_proposals.approved_by TEXT with the values 'auto' or 'admin'.
    • Add it as an idempotent migration: ALTER TABLE … ADD COLUMN when missing.
    • Register it with the self-healing optional-column detection on the server side, so a server/ingestor boot race cannot hide it.
  2. Writes (ingestor).
    • submitChannelProposal sets 'auto' when autoApprove approves a new name.
    • Admin approve sets 'admin'.
    • Reject and revoke clear it. A resubmitted (revoked → pending) row also clears it.
  3. Backfill (one-off, ingestor migration). For existing approved rows, set 'auto' where reviewed_at - created_at < 60000 and otherwise 'admin'. Document that values from before the migration are inferred.
  4. API / UI.
    • Expose approvedBy on the proposals list used by #/channels?view=proposals, as a named struct field (no map[string]interface{}).
    • Show it as a small badge ("auto" / "admin") and add a filter "Auto-approved" to that view.
    • Reflect the filter in the URL hash (deep link), use CSS variables only, and make it work at 390px.

Tests

  • Ingestor:
    • auto-approve writes 'auto', admin approve writes 'admin', reject and revoke clear it, and resubmit resets it;
    • the migration is idempotent;
    • the backfill classifies the fixture rows correctly.
  • Server:
    • the field is present when the column exists and omitted or null on an old DB without it;
    • the read-only invariant holds.
  • Frontend:
    • unit test for the filter and badge;
    • Playwright test for the filter and its deep link.

Relates to the shared hashtag channels feature (channelProposals).

Activity

  1. dborup commented on Oct 26, 2026

    @dborup
    OwnerAuthor

    Fixed by #617 (merged as b519e6bbac4bb729ede12e9e3e1e908a08566458).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions