[add] Render Debugger page for Lark Cloud documents#15
Conversation
|
@copilot 重新修改 review 内容:#15 (review) |
Done in commit
For |
There was a problem hiding this comment.
Pull request overview
Adds a new /wiki/[node_token]/debugger page to inspect Lark cloud document blocks and rendering output, alongside repo maintenance updates (routing restructure and dependency/tooling upgrades) to support the new sub-route and UI.
Changes:
- Added a wiki document debugger page (SSR) and introduced a
GitDiffViewcomponent to compare raw vs renderable blocks. - Restructured the wiki dynamic route to a folder (
pages/wiki/[node_token]/index.tsx) to enable the/debuggersub-route. - Updated global styling and bumped/adjusted package + pnpm workspace configuration.
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| styles/globals.less | Adjusts global layout styles and enforces responsive image sizing. |
| pnpm-workspace.yaml | Introduces pnpm workspace-level configuration (overrides/build allowances/hoisting). |
| pages/wiki/[node_token]/index.tsx | Updates imports after route folder restructure. |
| pages/wiki/[node_token]/debugger.tsx | Adds SSR debugger page fetching raw/renderable blocks and rendering a diff + live document. |
| pages/api/Lark/file/[id]/[name].ts | Simplifies non-OK response body parsing for file download proxy. |
| package.json | Adds diff-view deps and upgrades various runtime/dev dependencies. |
| eslint.config.ts | Removes a now-unneeded inline TS suppression comment. |
| components/GitDiffView.tsx | Adds a MobX-backed diff viewer component used by the debugger page. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| const { client, domain } = documentStore; | ||
|
|
||
| class MyDocumentBlockModel extends DocumentBlockModel { | ||
| client = client; | ||
| } |
Adds a new debug page for Lark cloud documents exposing raw blocks, processed blocks, the rendered component tree, and the live document render — all from a single URL.
New page:
/wiki/[node_token]/debuggerFour views rendered from two
DocumentBlockModelcalls:<CodeBlock language="json">showinggetAll()andgetRenderableAll()respectively<CodeBlock language="tsx">(idea-react) rendering the JSX tree fromrenderBlocks()renderBlocks()The debugger page uses server-side rendering (
getServerSideProps) so API calls are made per-request rather than at build time, avoiding repeated consumption of API quota on every build.Routing restructure
pages/wiki/[node_token].tsx→pages/wiki/[node_token]/index.tsxto allow the/debuggersubroute under the same dynamic segment.Human changes