💄 style(vscode): 代码阅读的「按注释规范写注释」按钮统一排在卡片右上角那排最前面,不再画在「注释」一行上

This commit is contained in:
cruldra committed 2026-10-08 08:03:00 +08:00
1 parent c398a538d9
commit ebea984852
7 files changed
+52 -68

No files matched your search

@@ -252,7 +252,7 @@ export function PropertyTable({ parentId, columns, items, marks, toggles }: {
* 给了列名的(输入参数、数据表的字段)排成表格,没给的排成列表。
* 标差异时(marks)新加的行淡绿底、左边 +,删掉的行放回原来的位置、淡红底划掉、左边 −,值改了的按旧值 → 新值或逐词标。
*/
export function PropertyGrid({ blockId, rows, collapsed, onToggleFold, marks, slots, rowTools }: {
export function PropertyGrid({ blockId, rows, collapsed, onToggleFold, marks, slots }: {
blockId: string
rows: PropertyRow[]
collapsed: ReadonlySet<string>
@@ -261,8 +261,6 @@ export function PropertyGrid({ blockId, rows, collapsed, onToggleFold, marks, sl
marks?: RowsDiff
/** 挂在这张属性表子行上的子块(库规则的卡片),见 GridSlots */
slots?: GridSlots
/** 排在某一行值右边的按钮(「注释」一行的「重写注释」),按行的下标 */
rowTools?: ReadonlyMap<number, ReactNode>
}): ReactElement {
const removed = (after: number): ReactElement[] => removedAt(marks?.removed, after)
.map(({ value, index }) => <RemovedRow key={`removed-${index}`} id={`${blockId}/x${index}`} row={value} />)
@@ -298,14 +296,7 @@ export function PropertyGrid({ blockId, rows, collapsed, onToggleFold, marks, sl
</button>
)
: <span className="cr-prop-label flex h-5 items-center">{row.label}</span>}
{rowTools?.has(index)
? (
<div className="flex min-w-0 items-start gap-1">
<div className="min-w-0 flex-1"><RowValue row={row} mark={mark} /></div>
{rowTools.get(index)}
</div>
)
: <RowValue row={row} mark={mark} />}
<RowValue row={row} mark={mark} />
</div>
{!folded && layout === 'table' && <PropertyTable parentId={id} columns={row.columns ?? []} items={row.items ?? []} marks={mark?.items} toggles={toggles} />}
{!folded && layout === 'list' && <PropertyItems parentId={id} items={row.items ?? []} folding={{ collapsed, onToggleFold }} marks={mark?.items} />}