feat(apollo-vertex): ai-chat message actions — copy, feedback, edit, regenerate [3/5]#630
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
e315e1b to
cc1b25a
Compare
28f05e0 to
e6653c8
Compare
Dependency License Review
License distribution
Excluded packages
|
cc1b25a to
1cd03f4
Compare
e6653c8 to
7817feb
Compare
1cd03f4 to
c39dd48
Compare
7b409a5 to
2c7e90f
Compare
ccb80ab to
cf9efc2
Compare
d332c03 to
6a9cb61
Compare
cf9efc2 to
b3871a0
Compare
0xr3ngar
left a comment
There was a problem hiding this comment.
@petervachon since other PRs mentioned here were closed, can we close this PR as well?
b3871a0 to
fffc189
Compare
ac1db1f to
8d64feb
Compare
0xr3ngar
left a comment
There was a problem hiding this comment.
OK I started reviewing the code again but I see smells everywhere :panic:
rn the data flow feels pretty shady. We pass messages into <AiChat />, but then the consumer also maps over messages and renders <AiChatMessage /> manually. On top of that, getAiChatMessageProps re-derives streaming/latest/action state, AiChatMessage re-derives display text/content visibility, and the template owns tool rendering as children
So the same source of truth is being interpreted in a bunch of different places
AiChathandles empty state, loading, header, copy conversation, scroll, etc..getAiChatMessagePropshandles latest message/streaming/action visibilityAiChatMessagehandles display text and whether the message is renderable- the template handles message mapping and tool rendering
that feels like a pretty big code smell, we’ve kind of split ownership in the worst middle-ground way- AiChat both owns and doesn’t own messages at the same time :/
It also creates a bunch of perf smells. During streaming, we’re constantly re-rendering/recomputing across multiple layers: the template maps every message again, tool parts are checked/rendered again, message props are re-derived, display text is rebuilt, and AiChat also walks messages for shell-level state like copy conversation/loading
I don’t think the current pattern/architecture is healthy at all. I think we need to go back to the drawing board and create a better architecture where message state is derived in one place instead of being re-interpreted and re-computed constantly across multiple components
882f789 to
67f3652
Compare
60ffe60 to
8ddf50c
Compare
87429af to
b8069b1
Compare
76b6af1 to
f8d36f9
Compare
f8d36f9 to
4dab193
Compare
What this does
Adds the per-message action layer — the controls that let users interact with individual messages rather than just reading them.
onFeedbackcallback so the host app can record quality signalsAiChatProvidercontext so all message components can read it without prop-drillingTest plan
onFeedbackwith the message ID and typeonRegenerate🤖 Generated with Claude Code