Skip to content

feat(bkn-project): show projects as cards like the knowledge network list - #1323

Open
leecky wants to merge 2 commits into
mainfrom
feat/bkn-project-cards
Open

leecky wants to merge 2 commits into
mainfrom
feat/bkn-project-cards

Conversation

@leecky

@leecky leecky commented Nov 12, 2026

Copy link
Copy Markdown
Contributor

Summary

The BKN project list (/studio/bkn-project) moves from a table to a card grid that follows the knowledge network list (/studio/knowledge-network).

  • Reuse, not a second design. The page, toolbar, search box, icon buttons and grid compose the classes of KnowledgeNetworkListScene.module.css; the new ProjectCard composes KnowledgeNetworkCard.module.css (card frame, accent bar, icon box, title, more button, menu, footer). The card's accent and icon use theme tokens (--color-text-link, --color-border).
  • Toolbar like the network list. "New project" on the left; on the right a search box that searches as you type (debounced), the "Show archived" filter and a refresh icon button. The in-page title and intro are dropped, as on the network list: the console header already shows them.
  • What each card shows, for a BKN engineer:
    • project name, and its stage read from GET /projects/{id}/status (Not drafted, Drafting, Modeling, Model to confirm, Data check pending, Checking data, Data check needs attention, Ready to publish, Published);
    • a published project names its version ("Published v1.2.0"); a project that went on after its release says "Last published v1.2.0"; a network switched back says "Rolled back, running …" (reusing the release page's copy);
    • the knowledge network (link to the network, plus the existing "same network · N other projects" tag with its explanation as a tooltip), data sources, owner, update time.
  • Actions in the card menu: Open project, and Archive / Restore for the owner only (archive still asks for confirmation). Clicking the card opens the project's overview.
  • Archived projects keep the current logic: hidden by default, shown with "Show archived", dimmed, tagged "Archived"; their status is not read.
  • Cursor paging stays (the backend pages by cursor); the page size goes from 20 to 24 so the grid fills whole rows.
  • zh-CN and en-US copy; unused table keys (cardTitle, cardTip, columns.*, archivedTag) are removed.

Each visible card reads its status once (one request per card, at most 24 per page). The list endpoint has no stage field; if that becomes a cost, a stage on GET /projects would replace these calls.

Project import/export

Not added. There is no project import/export today in the list or in bkn-project. The only project export is requirements export (/requirements/export, for the workshop and eval). With versioned publish in 0.2.2, what a project produces lives in the knowledge network's versions, and the network list already exports and imports those (JSON / BKN package). A project export would only move work in progress (drafts, decisions, requirement documents) between environments. Nobody has asked for that, it would need new backend endpoints, and it does not fit before the 11/15 freeze.

Test plan

  • tsc -p tsconfig.app.json, pnpm lint, pnpm lint:types, prettier
  • vitest run src/modules/bkn-project src/modules/knowledge-network/scenes src/modules/knowledge-network/components/network: 79 files, 836 tests passed (new ProjectCard.test.tsx; list tests updated for cards and menus)
  • Local Studio dev server against the 8081 backend (read-only): cards with stage, archived filter, card menu → open project, search; dark and light themes; no console errors

🤖 Generated with Claude Code

…list

The project list becomes a card grid that reuses the knowledge network
list's toolbar, grid and card styles. Each card shows the project's stage
(read from the project status), its published or last release and a
rollback note, the knowledge network, data sources, owner and update time.
Archive and restore move to the card's menu; archived projects stay dimmed
and are shown only with "Show archived".

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@leecky leecky self-assigned this Nov 12, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

表格改卡片的实现整体正确:请求竞态守卫、游标失效回退、权限判断与 i18n 双语都保留完整,卡片状态全部来自真实 /status 接口,没有占位兜底。只有每张卡片单独拉 status 的请求放大,以及归档后卡片沿用旧 status 两处值得作者看一眼。

影响范围与未覆盖面
  • 影响范围:项目列表每页从 1 个请求变成 1 + 最多 24 个 /projects/{id}/status 并发请求,翻页、刷新、搜索时都会重新拉一遍。

待确认项(不阻断放行)

  • src/modules/bkn-project/components/ProjectCard.tsx — 第 96 行每张卡片挂载时各自调一次 getProjectStatus,一页 24 张就是 24 个并发 /status 请求。需要确认后端 status 接口的开销能承受列表页这种 N+1 调用,或者考虑由后端在列表接口里直接带上 stage/release。

有异议或想再评一轮,请回复 /review——普通回帖不会触发复评,且回帖人需为本仓 OWNER/MEMBER/COLLABORATOR。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant