feat: JSON 查看器——配置文档从一坨 pre 变成能翻的树 - #100
Merged
Merged
Conversation
发布预览与审计详情两处原来把 JSON.stringify 的原文塞进 <pre>: 结构要靠眼睛缩进,长文档滚不到底,想拿原文还得手选全文。 JsonViewer 折叠树三步接住:折叠看结构(收起的分支摘牌「N 个键/项」)、 展开看内容(guide line 标层级归属)、复制拿原文(反代热路径逐字符 核对仍有全文可抄)。默认展开到第二层,深层收着——日常核对只碰顶层, 需要下钻的再点开。 配色只用灰阶(DESIGN.md 禁第二个色相):键浅值深,数字布尔退半层 tabular-nums,null 斜体;全部绑 CSS 变量,明暗主题自动成立。审计 detail 万一不是 JSON(老数据、手写坏行),回退原样 <pre>——不为 好看吞内容。展开状态整树只存根上一个 Set,节点无状态递归。 Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
改了什么
发布预览与审计详情两处原来把
JSON.stringify的原文塞进<pre>:结构靠眼睛缩进,长文档滚不到底,想拿原文还得手选全文。新增JsonViewer折叠树接住这两处:为什么这么做
<pre>摆出来——不为好看吞内容Set<pathKey>,节点无状态递归——否则「全部展开/收起」要广播到每个节点打架JSON.stringify(path):对象键可以含任意字符,字符串拼接会撞车验证
npm run check全绿/api/*喂 mock,产品代码零改动)五张截图实测:浅色/深色主题、发布预览树折叠+全展开、审计 JSON 树、审计纯文本回退🤖 Generated with Claude Code