Repository navigation
feat(knowledge-network): version picker by the title, readable comparisons and a danger zone - #1310
Merged
Merged
Conversation
…parisons - The version bar says nothing about a draft that matches the running version; a draft with changes shows one line of secondary text. - Version states, diff counts and diff actions show as a colored dot with text instead of filled tags. - A comparison always reads from the older side to the newer one, so a pair picked newer-first no longer reports additions as removals. - The diff counts include a change to the network itself, which the list already shows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The full-width version strip above the workspace gives way to a quiet picker right after the network's name in the top bar, as a branch picker sits next to a repository's name. A draft that matches the running version reads as that version; once the draft has changes the picker says so and a publish link appears. Viewing changes, discarding them and the version history sit behind a small menu. A read-only version keeps one line of secondary text with the way back to the draft. The shell gains a slot after the trail for such page controls. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A new network starts with versioning on; the switch in the create dialog still turns it off. A network without versioning keeps working as before, with edits taking effect at once, and shows a quiet link to enable versioning where the version picker would be. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…n top bar The knowledge network workspace is a standalone page that renders its own TopBar outside the console shell, so the trail slot was missing there and the picker fell back to a strip above the content. The slot becomes a provider that the console shell and the standalone workspace page both use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…itle On the overview the picker now sits next to the network name, as a small filled select with a branch icon; other sections keep it after the top bar's trail. Drops the select's fixed width that left a gap before the caret. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…cker The picker beside the title loses its background and the separate more menu: view changes, discard and history now sit under the version list. The read-only line under a picked version goes too, since the picker already says which version is on screen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ition The publish dialog and the compare dialog list the changed definitions by kind on the left and, for the one picked, its changes on the right: a changed definition field by field, grouped by the property or rule they belong to, with both versions side by side; an added or removed one as its content, one table row per property. Field paths read as labels. The network no longer shows as changed when only the branch each side was read from differs. Ported from the network comparison page on the yf release branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…our tokens The version styles used antd's CSS variables, which the console does not emit, so borders, tints, the selected definition and the status dots fell back to nothing. They now use the console's --color-* tokens, which also follow the dark theme. The comparison counts become small cards with the number in its action's colour, and each changed definition carries its action on a light tint. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er zone Version management keeps publishing and comparing in its summary and moves discarding the draft and rolling back to a danger zone at the bottom, each with what it does. The version picker keeps only a link to version management under the list, and publishing becomes a regular-size primary button with an icon. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On the overview, publishing joins the network's actions on the right of its title as the main one, and the picker stays by the title. Elsewhere it still follows the picker in the top bar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…'s others Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ange The versioning switch is removed with the server that versions every network; turning it on by default here would only conflict with that. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
版本选择器移入标题/顶栏、差异按定义逐项展示、危险操作区三块改动逻辑自洽,未发现可确认的阻断项。剩下的是评测页没有挂顶栏插槽、只读态提示被移除、放弃草稿文案在边界版本号上不准这几处体验问题。
影响范围与未覆盖面
- 影响范围:知识网络工作区各页的版本选择器位置、只读版本的提示方式,以及发布/对比弹窗里的差异展示都变了;评测页(/knowledge-network/workspace/:networkId/evals)的选择器会落回内容区。
- 未覆盖:危险操作区文案描述的回退目标,没有对照后端 draft/reset 的实现核实。
待确认项(不阻断放行)
- src/modules/knowledge-network/components/versions/KnVersionBar.tsx — 原来查看历史/运行版本时会出现「该版本只读」的 Alert 和「回到草稿」按钮,这次一并删掉了。现在 editable=false 时编辑入口会直接消失,只剩选择器上的 v1/v2 这类名字;而无改动的草稿也显示成运行版本名,用户分不清自己是在草稿里还是在只读版本里。请确认这是有意的取舍。
- src/modules/knowledge-network/components/versions/KnVersionsPanel.tsx — 危险操作区的 discardBody 固定写成 knVersionName(running):还没发布过(running=0)但草稿已有改动时,会显示「草稿回到运行版本 v0」;草稿落后(base≠running)时,文案说回到运行版本,而顶栏写的是「基于 base」。请确认 draft/reset 不传 from_version 时,后端实际回退到哪个版本。
有异议或想再评一轮,请回复 /review——普通回帖不会触发复评,且回帖人需为本仓 OWNER/MEMBER/COLLABORATOR。
A network gets its versions on its first edit in Studio, so there is nothing to turn on: the version picker's "enable" entry and the enable dialog are gone, and the versions page of a network without versions says what its first edit does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A network gets its versions on its first edit; until then the picker shows what it holds as its running v1, with the way to version management and nothing to publish, and its versions page says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…k without versions The list still says it is running, as the picker of a versioned network does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A network without versions keeps taking edits at once. Its version picker now carries "Publish": once confirmed, what the network holds is kept as the running v1 and later edits go to a draft. The versions page says so. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
4 of 6 tasks
…st publish Before the first publish there is no running version, and the danger zone said the draft goes back to "v0". It now says the draft is emptied. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
8 tasks done
Member
Author
|
On the pending items:
/review |
There was a problem hiding this comment.
上一轮的待确认项作者都已处理或说明(discardBody 在首次发布前改为「清空草稿」,只读提示的移除属于产品取舍,评测页插槽暂不处理)。本轮新增的「无版本网络显示为 v1、首次发布即 enable」与 service 返回的 running_version=1 语义一致,没有发现新的阻断项。
影响范围与未覆盖面
- 影响范围:未开启版本管理的网络,所有用户在标题旁都会看到 v1 选择器,有 modify 权限的用户还会看到「发布」按钮;版本页不再提供开启入口。
- 未覆盖:首次发布之前在后端被关闭过版本管理的网络,重新 enable 后是否仍编号为 v1,没有对照后端实现核实。
有异议或想再评一轮,请回复 /review——普通回帖不会触发复评,且回帖人需为本仓 OWNER/MEMBER/COLLABORATOR。
Keep stateUnknown from #1309; backToDraft stays removed with the read-only notice. Co-Authored-By: Claude Opus 5.5 <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.
Pull Request
What Changed
Brief description of changes:
--color-*tokens (AntD--ant-*variables are not emitted here, which left them unstyled)Why
How
KnVersionSlot(provider, hosts and portals) places the picker and the publish action in the overview header;KnDiffSummaryis rewritten onlib/kn-diff-path.ts, which splits API change paths such asdata_properties[abbr].display_nameinto a group and a field and drops the network entry when it differs only inbranch;KnVersionsPanelgains the danger zone.Testing
Test notes:
tsc -b --force,vitest runoncomponents/versions,lib,scenes/workspace;vitest run src/modules/knowledge-network(2732 tests), scan-hardcoded-zh and locale parity. New cases inKnVersionBar.test.tsx,KnDiffSummary.test.tsx,KnVersionsPanel.test.tsx. Checked on the dev VM in light and dark theme.Risk & Rollback
POST /knowledge-networks/{kn_id}/versioning. Merges cleanly with feat(knowledge-network): name the draft on every edit and drop the create versioning switch #1309 (checked with tsc after a local merge).Additional Notes
🤖 Generated with Claude Code