docs: clarify developer workspace editing and request presentation
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
//! 开发工具画面的绘制辅助:文字行、按钮、分隔线和滚动条。
|
||||
//! 绘制命令与可交互区域同步登记,保证屏幕上的管理控件能用同一几何命中。
|
||||
//!
|
||||
//! developer_tools::build 为当前工具构造 Painter,各子工具提交 Line/Action;本模块不访问 VM,也不再次执行活动日志里的请求。
|
||||
//! lines 的完整文本用于宽度缓存和复制,可见切片用于绘制;行的可见命中矩形与完整背景矩形分开,滚动条在内容裁剪弹出后登记。
|
||||
use super::*;
|
||||
|
||||
/// 开发工具的绘制助手,把布局结果写入同帧显示列表。
|
||||
@@ -123,6 +125,7 @@ impl Painter {
|
||||
if let Some(divider) = line.divider {
|
||||
self.fill(
|
||||
Rect::new(area.x, y, area.width, 1.0),
|
||||
// 分隔线只选择配色,不创建额外可激活行;Line.action 才决定该行能否登记点击目标。
|
||||
match divider {
|
||||
Divider::Accent => self.ui.theme.accent,
|
||||
Divider::Neutral => BORDER,
|
||||
@@ -299,6 +302,7 @@ pub(super) fn console_result(out: &mut Vec<Line>, body: &str, color: Color) {
|
||||
if let Some(diagnostics) = value["diagnostics"].as_array()
|
||||
&& !diagnostics.is_empty()
|
||||
{
|
||||
// 只解释响应中已有诊断数据,不向 VM 请求 traceback;列表缺失/为空则继续尝试 error 或 revision。
|
||||
// 每条诊断可选显示位置,再显示 message;缺 message 用固定失败提示,不调用源对象格式化。
|
||||
for d in diagnostics {
|
||||
if let Some(line) = d["line"].as_u64() {
|
||||
@@ -371,6 +375,7 @@ pub(super) fn request_details(out: &mut Vec<Line>, r: &Exchange) {
|
||||
out.push(l);
|
||||
multiline(
|
||||
out,
|
||||
// 空预览明确显示占位,正文仍来自已记录的受限 Exchange,不在详情展开时重新读网络流。
|
||||
if body.is_empty() { "(empty)" } else { body },
|
||||
if title == "RESPONSE BODY" && r.status.is_some_and(|s| s >= 400) {
|
||||
ERROR
|
||||
|
||||
Reference in New Issue
Block a user