Skip to content

[add] Render Debugger page for Lark Cloud documents#15

Merged
TechQuery merged 9 commits into
mainfrom
copilot/mobx-lark
Jun 17, 2026
Merged

[add] Render Debugger page for Lark Cloud documents#15
TechQuery merged 9 commits into
mainfrom
copilot/mobx-lark

Conversation

Copilot AI commented Jun 14, 2026

Copy link
Copy Markdown
Contributor

PR-15 PR-15 PR-15 Powered by Pull Request Badge

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]/debugger

Four views rendered from two DocumentBlockModel calls:

  • Raw Blocks / Renderable Blocks — side-by-side <CodeBlock language="json"> showing getAll() and getRenderableAll() respectively
  • Component Tree<CodeBlock language="tsx"> (idea-react) rendering the JSX tree from renderBlocks()
  • Document — full-width live render of renderBlocks()
const [rawBlocks, renderableBlocks] = await Promise.all([
  new MyDocumentBlockModel(domain, node.obj_token).getAll(),
  new MyDocumentBlockModel(domain, node.obj_token).getRenderableAll(
    token => `/api/Lark/file/${token}/placeholder`,
  ),
]);

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].tsxpages/wiki/[node_token]/index.tsx to allow the /debugger subroute under the same dynamic segment.

Human changes

  1. [add] Git Diff View component for Lark JSON diff (resolve 新增 MobX-Lark 云文档渲染调试器 #14)
  2. [migrate] upgrade to PNPM 11, Lint-Stage 17, Marked 18, amondnet/vercel-action 42 & other latest Upstream packages

@TechQuery TechQuery added the feature New feature or request label Jun 14, 2026
Copilot AI changed the title [WIP] Add MobX-Lark cloud document rendering debugger feat: add MobX-Lark cloud document debugger at /wiki/[node_token]/debugger Jun 14, 2026
Copilot AI requested a review from TechQuery June 14, 2026 14:31
Comment thread pages/api/core.ts
Comment thread pages/wiki/[node_token]/debugger.tsx Outdated
Comment thread pages/wiki/[node_token]/index.tsx Outdated
Comment thread pages/wiki/index.tsx
Comment thread pnpm-workspace.yaml
@TechQuery

Copy link
Copy Markdown
Member

@copilot 重新修改 review 内容:#15 (review)

Copilot AI commented Jun 14, 2026

Copy link
Copy Markdown
Contributor Author

@copilot 重新修改 review 内容:#15 (review)

Done in commit fix: address review feedback - SSR for debugger, revert error swallowing:

  • pages/api/core.ts: reverted — RobotToken is always generated unconditionally.
  • pages/wiki/[node_token]/debugger.tsx: converted to getServerSideProps (removed getStaticPaths, replaced getStaticProps/GetStaticProps with getServerSideProps/GetServerSideProps, removed the Minute/Second imports and error-swallowing try-catch).
  • pages/wiki/[node_token]/index.tsx: reverted — getStaticPaths no longer wraps the API calls in a try-catch.
  • pages/wiki/index.tsx: reverted — getStaticProps no longer has a try-catch, and treeFrom is called directly again.

For pnpm-workspace.yaml: idea2app/HuiZhong-charity-system returns 404 (private repository). Could you paste the content of that file here so I can copy it in?

@TechQuery TechQuery marked this pull request as ready for review June 17, 2026 19:09
Copilot AI review requested due to automatic review settings June 17, 2026 19:09

Copilot AI 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.

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 GitDiffView component to compare raw vs renderable blocks.
  • Restructured the wiki dynamic route to a folder (pages/wiki/[node_token]/index.tsx) to enable the /debugger sub-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.

Comment thread components/GitDiffView.tsx
Comment on lines +19 to +23
const { client, domain } = documentStore;

class MyDocumentBlockModel extends DocumentBlockModel {
client = client;
}
Comment thread pages/wiki/[node_token]/debugger.tsx Outdated
Comment thread components/GitDiffView.tsx Outdated
@TechQuery TechQuery changed the title feat: add MobX-Lark cloud document debugger at /wiki/[node_token]/debugger [add] Render Debugger page for Lark Cloud documents Jun 17, 2026
@TechQuery TechQuery merged commit c274370 into main Jun 17, 2026
3 checks passed
@TechQuery TechQuery deleted the copilot/mobx-lark branch June 17, 2026 22:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

新增 MobX-Lark 云文档渲染调试器

3 participants