beadboard/src/app/api/sessions/[beadId]/comment/route.ts
zenchantlive f3558dc0d1 feat(ui): deliver Social-Dense Agent Sessions Hub
This is our biggest UX pivot of the project. We abandoned the 'Page' model for a 'Command Workspace'.

Triumphs:
- Reclaimed 40% of previously wasted screen real-estate by moving to an auto-filling multi-column grid matrix.
- Built the 'Command Deck'—a high-density header that provides real-time agent presence monitoring at a glance.
- Implemented 'Social Post' cards that map technical protocols to human verbs (e.g., 'Falcon passed mission to Operative-B'), making the audit trail readable for humans.
- Engineered 'Silent Refresh' logic: the feed now appends new activity and comments smoothly without disruptive UI resets or scroll jumps.

Raw Honest Moment:
The original card-based social feed was a failure. It was beautiful in isolation but useless for actual supervision. We had to be honest about the horizontal bloat and rebuild the entire layout foundation from scratch using rem-based fluid units to satisfy the 'War Room' requirement.
2026-02-14 00:20:41 -08:00

22 lines
648 B
TypeScript

import { NextResponse } from 'next/server';
import { executeMutation, validateMutationPayload } from '../../../../../lib/mutations';
export async function POST(
request: Request,
{ params }: { params: Promise<{ beadId: string }> }
): Promise<Response> {
const { beadId } = await params;
const body = await request.json();
try {
const payload = validateMutationPayload('comment', {
...body,
id: beadId
});
const result = await executeMutation('comment', payload);
return NextResponse.json(result);
} catch (error) {
return NextResponse.json({ ok: false, error: String(error) }, { status: 400 });
}
}