Skip to content

chore(demo): hide Plan/Execute toggle + add message backdate route#302

Closed
lilyshen0722 wants to merge 1 commit intomainfrom
lily/demo-polish-bundle
Closed

chore(demo): hide Plan/Execute toggle + add message backdate route#302
lilyshen0722 wants to merge 1 commit intomainfrom
lily/demo-polish-bundle

Conversation

@lilyshen0722
Copy link
Copy Markdown
Contributor

Summary

Two demo-prep changes bundled to share one deploy cycle.

1. Hide Plan/Execute mode toggle

The toggle persists mode to the pod but no downstream surface uses it for behavior — clicks land but nothing changes. Reads as broken in demos. Wrapped in {false && (...)} with a comment naming the re-enable condition.

2. PATCH /api/messages/:id/created-at — backdate route

Pod-creator-or-author can set a message's created_at to a past timestamp. Body: { created_at: ISO8601 }.

Why: PG egress to Aiven is firewalled from kubectl exec (long-lived backend pool works, new sessions time out at TCP). Demo seeding wants "yesterday afternoon / evening / this morning" timestamps but POST always stamps NOW(). Backed by the same config/db-pg pool as the rest of messaging.

🤖 Generated with Claude Code

Two unrelated demo-prep changes bundled to share a deploy cycle.

1. Hide the Plan/Execute mode toggle
-------------------------------------
The pod-mode toggle persists `mode` to the pod but no downstream
surface uses it for behavior — clicks land but nothing changes for
the user, so the control reads as broken in any demo or dogfood
context. Wrap the JSX in `{false && (...)}` with a comment naming
the re-enable condition (downstream actually uses the field).
Surgical revert: delete the wrapper.

2. PATCH /api/messages/:id/created-at — backdate route
-------------------------------------------------------
Backdates a chat message's `created_at` (and `updated_at`).
Pod-creator-only or message-author; no general-purpose user
authorization to edit other people's chronology.

Why this exists: chat-history demos / fixtures want plausible
"yesterday afternoon / yesterday evening / this morning" timestamps,
but POST /:podId always stamps with NOW(). Direct PG UPDATE works
for ops with PG access; this route is the same capability when
PG is firewalled (Aiven IP-allowlist + kubectl exec connection
tracking blocking new sessions even from inside the cluster).

Body: { created_at: ISO8601 string }

Backed by the same long-lived PG pool as the rest of the messaging
stack (`config/db-pg`), so no new connection profile is needed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@lilyshen0722 lilyshen0722 deleted the lily/demo-polish-bundle branch May 4, 2026 17:19
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