Title: deepnote cat shows separator blocks as (empty) instead of --- · Issue #599 · deepnote/deepnote · GitHub
Open Graph Title: deepnote cat shows separator blocks as (empty) instead of --- · Issue #599 · deepnote/deepnote
X Title: deepnote cat shows separator blocks as (empty) instead of --- · Issue #599 · deepnote/deepnote
Description: Problem deepnote cat is supposed to show separator blocks as a horizontal line (---), as added in #242. Instead, the text output prints (empty): ──────────────────────────────────────────────────────────── separator (b) (empty) ─────────...
Open Graph Description: Problem deepnote cat is supposed to show separator blocks as a horizontal line (---), as added in #242. Instead, the text output prints (empty): ────────────────────────────────────────────────────...
X Description: Problem deepnote cat is supposed to show separator blocks as a horizontal line (---), as added in #242. Instead, the text output prints (empty): ────────────────────────────────────────────────────...
Opengraph URL: https://github.com/deepnote/deepnote/issues/599
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"deepnote cat shows separator blocks as (empty) instead of ---","articleBody":"## Problem\n\n`deepnote cat` is supposed to show separator blocks as a horizontal line (`---`), as added in #242. Instead, the text output prints `(empty)`:\n\n```\n────────────────────────────────────────────────────────────\nseparator (b)\n (empty)\n\n────────────────────────────────────────────────────────────\n```\n\n`deepnote cat \u003cfile> -o json` returns `\"content\": \"\"` for the same block.\n\n## Cause\n\nThe separator branch in `getBlockContent` never runs, because the `content` check before it always matches:\n\nhttps://github.com/deepnote/deepnote/blob/a698ad0291be8e75d841ab9404f0f5e594f0a64a/packages/cli/src/commands/cat.ts#L252-L264\n\n`cat` reads blocks through `deserializeDeepnoteFile`. Its `emptyContent()` preprocess always sets a separator's `content` to `''`, even when the file has no `content` key:\n\nhttps://github.com/deepnote/deepnote/blob/a698ad0291be8e75d841ab9404f0f5e594f0a64a/packages/blocks/src/deepnote-file/deepnote-file-schema.ts#L10\n\nSo `getBlockContent` returns `''`, and the text renderer prints `(empty)`:\n\nhttps://github.com/deepnote/deepnote/blob/a698ad0291be8e75d841ab9404f0f5e594f0a64a/packages/cli/src/commands/cat.ts#L206-L222\n\nThis has been the case since `cat` was added. TypeScript didn't flag the dead branch because the inferred type of `content` was `'' | undefined`. #597, the zod 4 migration, makes the type exactly `''`, so the comparison becomes TS2367. That PR removes the unreachable branch and doesn't change any behavior.\n\n## Proposed fix\n\n- In the text output path of `cat`, show `---` for separator blocks instead of the result of `getBlockContent`. For example, `block.type === 'separator' ? '---' : getBlockContent(block)`. `highlightContent` only colors `code` and `sql`, so `---` prints as is.\n- Leave `-o json` unchanged (`\"content\": \"\"`). JSON output carries block data, not display strings, so the check shouldn't move to the top of `getBlockContent`.\n- Add `packages/cli/src/commands/cat.test.ts` cases for a separator block in text output and in JSON output. No test covers separators today.\n\n## Acceptance criteria\n\n- `deepnote cat \u003cfile>` prints `---` for a separator block.\n- `deepnote cat \u003cfile> -o json` still returns `\"content\": \"\"` for that block.\n- Tests cover both outputs.\n","author":{"url":"https://github.com/tkislan","@type":"Person","name":"tkislan"},"datePublished":"2026-10-28T19:15:04Z","url":"https://github.com/deepnote/deepnote/issues/599"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:96cad1e8-80ba-5b2a-c5a5-2b6628eb743c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | ACC6:21FC11:F955D8:14B6605:6AED6126 |
| html-safe-nonce | 42df266e1626b6233a0a50299262320b8d059a821fecb47842a266f59a65d3f8 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQ0M2OjIxRkMxMTpGOTU1RDg6MTRCNjYwNTo2QUVENjEyNiIsInZpc2l0b3JfaWQiOiI3OTg5MzcyNDQzNTMwNDUzMjg2IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | c5d376ebb6898ac65afa55fbeca4b6b5f86991af2b6ddc23d8258eb335f304a1 |
| hovercard-subject-tag | issue:6085788489 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/deepnote/deepnote/599/issue_layout |
| twitter:image | https://opengraph.githubassets.com/94bb2b084085be460572858413f82026c2f136a422ec1d4997d2eb536b8967d1/deepnote/deepnote/issues/599 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/94bb2b084085be460572858413f82026c2f136a422ec1d4997d2eb536b8967d1/deepnote/deepnote/issues/599 |
| og:image:alt | Problem deepnote cat is supposed to show separator blocks as a horizontal line (---), as added in #242. Instead, the text output prints (empty): ────────────────────────────────────────────────────... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | tkislan |
| hostname | github.com |
| expected-hostname | github.com |
| None | 56fb42677ae87ed3e64410323d67980aa65d0485568a7858f874e7edfc6d1c11 |
| turbo-cache-control | no-preview |
| go-import | github.com/deepnote/deepnote git https://github.com/deepnote/deepnote.git |
| octolytics-dimension-user_id | 45339858 |
| octolytics-dimension-user_login | deepnote |
| octolytics-dimension-repository_id | 1066509034 |
| octolytics-dimension-repository_nwo | deepnote/deepnote |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1066509034 |
| octolytics-dimension-repository_network_root_nwo | deepnote/deepnote |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 9c9a37e2423ed382cf39f70b5aa4b4858b40a3b0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width