7 天前端 Agent 体验:从流式到生成式界面
课程题库 · 27 / 27 道题
标签
全部#streaming10#ux6#protocol-design5#error-handling4#generative-ui4#accessibility3#ui-state3#agent-ui2#architecture2#human-in-the-loop2#react-performance2#security2
还有 33 个标签收起标签
#state-sync2#testing2#tool-calling2#abort-controller1#aria-live1#browser-api1#chat-ui1#cost-control1#data-structure1#debugging1#decision-making1#deduplication1#engineering-practice1#focus-management1#forward-compatibility1#information-architecture1#json-patch1#keyboard1#long-running-tasks1#markdown1#metrics1#performance1#profiling1#progress-ui1#prompt-injection1#reasoning-ui1#rendering1#resilience1#resumption1#scroll-behavior1#session-management1#sse1#state-management1
D1 Agent 前端难在哪:事件协议与浏览器里的第一条流
浏览器里要读一条带请求体的流式响应,EventSource、WebSocket、fetch 加 ReadableStream 你选哪个?为什么?You need to consume a streaming response in the browser and the request carries a body. Would you use EventSource, WebSocket, or fetch with ReadableStream? Why?
国内高频海外高频基础#streaming#sse#browser-api🔒 解锁 D1 后查看答题要点。
AG-UI 这类协议为什么要把一条消息拆成 START、CONTENT、END 三个事件,而不是直接发一条完整消息?Why do protocols like AG-UI split one message into START, CONTENT, and END events instead of sending a complete message?
国内高频海外高频进阶#protocol-design#streaming#ui-state🔒 解锁 D1 后查看答题要点。
你的前端收到一个协议里没定义过的事件类型,应该报错、忽略,还是透传给上层?说出你的判断依据。Your frontend receives an event type the protocol does not define. Should it throw, ignore it, or pass it through? What drives your decision?
国内高频海外高频深入#forward-compatibility#protocol-design#error-handling🔒 解锁 D1 后查看答题要点。
D2 不抖的流式渲染:渲染风暴、增量 Markdown 与滚动锚定
模型每秒吐 80 个增量,你的聊天页开始掉帧、输入框也变卡,你按什么顺序排查和优化?A model is emitting 80 deltas per second, your chat page drops frames, and the input box lags. In what order do you diagnose and fix it?
国内高频海外高频深入#react-performance#streaming#profiling🔒 解锁 D2 后查看答题要点。
流式 Markdown 渲染到一半,代码块的围栏只来了一半,你的渲染器应该怎么处理?Your streaming Markdown renderer receives a code fence that has opened but not yet closed. How should it handle that?
国内高频海外高频进阶#markdown#streaming#rendering🔒 解锁 D2 后查看答题要点。
聊天消息列表什么时候该自动滚到底部,什么时候不该?说出你的判定规则。When should a chat message list auto-scroll to the bottom, and when should it not? State your rule.
国内高频海外高频基础#scroll-behavior#ux#chat-ui🔒 解锁 D2 后查看答题要点。
你的流式聊天在本地怎么测都不卡,一上线用户就抱怨界面卡顿。可能是什么原因?Your streaming chat never janks locally but users report lag in production. What could explain that?
国内高频海外高频深入#react-performance#testing#debugging🔒 解锁 D2 后查看答题要点。
D3 工具调用可视化与人在回路:中断不是本地拦截
为什么人在回路的审批要做成运行中断加恢复,而不是前端弹窗拦住请求?Why implement human-in-the-loop approval as run interruption and resumption rather than a frontend modal that blocks the request?
国内高频海外高频深入#human-in-the-loop#security#protocol-design🔒 解锁 D3 后查看答题要点。
工具调用的参数是一段段流式拼出来的,界面在参数还没拼完时应该显示什么?Tool call arguments arrive as streamed fragments. What should the UI display before they are complete?
国内高频海外高频进阶#tool-calling#streaming#ui-state🔒 解锁 D3 后查看答题要点。
用户拒绝了一个工具调用,你的系统接下来应该怎么处理?The user rejects a tool call. What should your system do next?
国内高频海外高频基础#ux#error-handling#human-in-the-loop🔒 解锁 D3 后查看答题要点。
Agent 并发发起了三个工具调用,事件交错着到达前端,你怎么保证它们各自归位?An agent fires three tool calls concurrently and their events interleave on arrival. How do you keep them straight?
国内高频海外高频进阶#streaming#state-management#tool-calling🔒 解锁 D3 后查看答题要点。
D4 推理过程与共享状态:可折叠的思考区和增量同步
模型的推理过程要不要展示给用户?默认收起还是默认展开?说出你的理由。Should the model's reasoning be shown to users? Collapsed or expanded by default? Justify your choice.
国内高频海外高频进阶#reasoning-ui#ux#protocol-design🔒 解锁 D4 后查看答题要点。
共享状态既可以每次发完整快照,也可以发增量补丁,你怎么决定用哪种?Shared state can be sent as full snapshots or as incremental patches. How do you decide which?
国内高频海外高频进阶#state-sync#protocol-design#architecture🔒 解锁 D4 后查看答题要点。
前端收到一个打不上的 JSON Patch,说明发生了什么?你的恢复策略是什么?Your frontend receives a JSON Patch that cannot be applied. What does that tell you, and how do you recover?
国内高频海外高频深入#state-sync#error-handling#json-patch🔒 解锁 D4 后查看答题要点。
什么样的信息该放进共享状态面板,什么样的该留在对话里?What belongs in a shared state panel versus in the conversation itself?
国内高频海外高频进阶#information-architecture#ux#agent-ui🔒 解锁 D4 后查看答题要点。
D5 生成式界面的三种范式:从组件映射到声明式 UI
生成式界面的三种范式分别把多少控制权交给模型?你在生产里会选哪种?How much control do the three generative UI paradigms hand to the model, and which would you choose in production?
国内高频海外高频进阶#generative-ui#architecture#decision-making🔒 解锁 D5 后查看答题要点。
模型返回了一个你没注册过的组件类型,界面应该怎么处理?The model returns a component type you never registered. How should the interface handle it?
国内高频海外高频进阶#generative-ui#error-handling#resilience🔒 解锁 D5 后查看答题要点。
让模型直接生成前端代码并在用户浏览器里执行,有哪些风险?你会怎么设边界?What are the risks of having a model generate frontend code that runs in the user's browser, and how would you bound them?
国内高频海外高频深入#security#generative-ui#prompt-injection🔒 解锁 D5 后查看答题要点。
结构化输出也是流式生成的,界面在 JSON 只到一半时应该怎么渲染?Structured output also streams. How should the interface render a JSON payload that is only half complete?
国内高频海外高频进阶#streaming#generative-ui#ui-state🔒 解锁 D5 后查看答题要点。
D6 会话控制与长任务:打断、重试、分支与子 Agent
用户点了停止,前端调用中止控制器就够了吗?服务端还需要做什么?The user clicks stop. Is calling AbortController enough on the frontend? What does the server still need to do?
国内高频海外高频进阶#abort-controller#cost-control#streaming🔒 解锁 D6 后查看答题要点。
会话历史用数组还是用树?编辑重发和分支这两个需求会怎么影响你的选择?Should conversation history be an array or a tree? How do edit-and-resend and branching affect that choice?
国内高频海外高频进阶#data-structure#session-management#ux🔒 解锁 D6 后查看答题要点。
流断在一半,前端重连续播,怎么保证不出现重复的消息?A stream breaks midway and the client reconnects to resume. How do you prevent duplicate messages?
国内高频海外高频深入#resumption#deduplication#streaming🔒 解锁 D6 后查看答题要点。
Agent 跑一个三分钟的长任务,界面上你会怎么表现进度?An agent runs a three-minute task. How do you present progress in the UI?
国内高频海外高频进阶#long-running-tasks#progress-ui#ux🔒 解锁 D6 后查看答题要点。
D7 可访问性与性能预算:让流式界面对所有人可用
为什么把实时区域直接指向流式渲染的元素是错的?正确做法是什么?Why is pointing a live region at the streaming element wrong, and what should you do instead?
国内高频海外高频深入#accessibility#aria-live#streaming🔒 解锁 D7 后查看答题要点。
你会给一个 Agent 聊天界面设哪几条性能预算?分别怎么测?What performance budgets would you set for an agent chat interface, and how would you measure each?
国内高频海外高频进阶#performance#metrics#agent-ui🔒 解锁 D7 后查看答题要点。
新消息流式到达时,键盘焦点应该跟着走吗?说出你的判断和理由。When a new message streams in, should keyboard focus follow it? Justify your answer.
国内高频海外高频进阶#accessibility#keyboard#focus-management🔒 解锁 D7 后查看答题要点。
你的流式界面在自动化测试里全绿,但用户报告说屏幕阅读器上有问题。这说明什么?Your streaming UI is green across automated tests, yet users report problems with screen readers. What does that tell you?
国内高频海外高频深入#testing#accessibility#engineering-practice🔒 解锁 D7 后查看答题要点。