Skip to content

User-owned channels & editable messages#40

Merged
JosephMaynard merged 1 commit into
masterfrom
feat/user-channels-and-editing
Jul 3, 2026
Merged

User-owned channels & editable messages#40
JosephMaynard merged 1 commit into
masterfrom
feat/user-channels-and-editing

Conversation

@JosephMaynard

Copy link
Copy Markdown
Owner

User-owned channels & editable messages

A batch of features that let people shape and correct their own space — the natural next step after admin channels and message deletion.

✍️ Message editing

  • PATCH /api/messages/:id — the author edits a body-bearing message (not even admins can — rewriting someone's words is impersonation; admins moderate by deleting). Stamps editedAt, refuses reactions (400) and still-streaming messages (409), broadcasts messageUpdated.
  • Client: an inline Edit affordance on your own messages (hover-revealed on desktop, always shown on touch) with a Save/Cancel editor, and an "(edited)" tag in the message meta.

➕ User-created channels

  • POST /api/channels — admins always; ordinary users when enableUserChannels is on (default), wiring a flag that previously gated nothing. The creator becomes the owner.
  • Client: a compact "New channel" control in the sidebar (shown to admins, and to everyone when the flag is on) that creates the channel and navigates straight to it.

👤 Channel ownership

  • PATCH /api/channels/:id — now allowed for an admin or the channel's owner (was admin-only): rename, posting policy, archive/restore.

🏷️ Channel identity in the header

  • The conversation header now shows the channel's real name and description (falling back to the id) instead of the raw id.

🧹 Endpoint tidy-up

  • Unified the channel write endpoints under /api/channels (POST create, PATCH update) with the authz above; GET /api/admin/channels stays as the admin full-list (incl. archived). Extracted a shared createChannelFromRequest helper. The admin channels panel and its tests use the unified paths.

Validation

  • Schema: MessageEditRequestSchema (non-empty body).
  • Tests: server 79 → 84 — user-create gating (on/off), owner-vs-stranger channel update, message editing (author edits + editedAt; non-author/admin blocked; empty-body 400 / missing 404). Full build + suite green.
  • CodeRabbit: reviewed once against master0 findings.

🤖 Generated with Claude Code

A batch of messaging features that let people shape and correct their own space.

Message editing
- PATCH /api/messages/:id — the author (only; not even admins, since rewriting
  someone's words is impersonation) edits a body-bearing message. Sets editedAt,
  refuses reactions (400) and still-streaming messages (409), broadcasts
  messageUpdated.
- Client: an inline "Edit" affordance on your own messages (hover-revealed;
  always shown on touch) with a Save/Cancel editor, and an "(edited)" tag.

User-created channels
- POST /api/channels — admins always; ordinary users when enableUserChannels is
  on (default). The creator becomes the owner.
- Client: a compact "New channel" control in the sidebar (shown to admins, and to
  everyone when the flag is on) that navigates to the channel it creates.

Channel ownership
- PATCH /api/channels/:id — allowed for an admin or the channel's owner (was
  admin-only). Rename / posting policy / archive.

Channel identity in the header
- The conversation header now shows the channel's real name and description
  (falling back to the id) instead of the raw id.

Endpoint tidy-up
- Unified the channel write endpoints under /api/channels (POST create, PATCH
  update) with the authz above; GET /api/admin/channels stays as the admin
  full-list (incl. archived). Extracted a shared createChannelFromRequest helper.
  The admin channels panel and tests use the unified paths.

Schema: MessageEditRequestSchema (non-empty body).

Tests: server 79 → 84 — user-create gating (on/off), owner-vs-stranger channel
update, and message-edit (author edits + editedAt; non-author/admin blocked;
empty-body 400 / missing 404). Full build + suite green.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You’ve reached a temporary PR review limit under our Fair Usage Limits Policy.

Your recent review volume is higher than typical usage, so adaptive limits are currently applied.

Next review available in: 11 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 282e6948-d714-44ff-afd0-49d14bb3f660

📥 Commits

Reviewing files that changed from the base of the PR and between 3fd1b2f and 6275300.

📒 Files selected for processing (5)
  • apps/client/src/app.tsx
  • apps/client/src/global.css
  • apps/server/src/app.test.ts
  • apps/server/src/app.ts
  • packages/schema/src/index.ts
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/user-channels-and-editing

Comment @coderabbitai help to get the list of available commands.

@JosephMaynard JosephMaynard merged commit eb29b1a into master Jul 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant