Switch content blocks to @block only#54
Conversation
|
To view this pull requests documentation preview, visit the following URL: Documentation is deployed and generated using docs.page. |
|
Visit the preview URL for this PR (updated for commit 0a9d231): https://superdeck-dev--pr54-leoafarias-use-block-xj1evhuj.web.app (expires Fri, 10 Apr 2026 14:36:10 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 Sign: bd68fc230762285849207e7e120aaf87cd4ca2f9 |
There was a problem hiding this comment.
Pull request overview
This PR removes legacy @column support across the SuperDeck toolchain (core models/schemas, builder parsing, CLI scaffolding) so Markdown content blocks are @block-only, and updates tests, fixtures, demos, and docs accordingly.
Changes:
- Remove legacy
columndiscriminator normalization and schema branches; enforceblockas the only content-block type. - Update builder parsing to reject
@columndirectives with a clearDeckFormatException. - Refresh docs, demo content, fixtures, and tests to use
@blockconsistently.
Reviewed changes
Copilot reviewed 40 out of 40 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/superdeck/test/fixtures/deck_reference.json | Updates reference fixture markdown + parsed block types from column to block. |
| packages/superdeck/README.md | Updates package README examples to @block. |
| packages/core/test/src/models/slide_model_test.dart | Updates slide model tests to expect block type. |
| packages/core/test/src/models/deck_model_test.dart | Updates deck model tests to expect block type. |
| packages/core/test/src/models/block_model_test.dart | Updates/extends model tests to validate rejecting legacy column. |
| packages/core/schema/superdeck.deck.schema.json | Removes column schema branch from the published deck JSON schema contract. |
| packages/core/lib/src/models/mappers.dart | Deletes legacy column→block normalization hook. |
| packages/core/lib/src/models/block_model.mapper.dart | Removes mapping hooks that previously normalized legacy discriminator values. |
| packages/core/lib/src/models/block_model.dart | Drops legacyKey support; tightens parsing to only accept block. |
| packages/core/lib/src/deck_configuration.dart | Changes superdeckDir from cached field to computed getter. |
| packages/cli/lib/src/commands/setup_command.dart | Updates setup scaffolded slides to use @block. |
| packages/builder/test/src/slide_processor_test.dart | Updates builder slide processor test inputs to use @block. |
| packages/builder/test/src/parsers/tag_tokenizer_test.dart | Updates tokenizer test expectations to block. |
| packages/builder/test/src/parsers/section_parser_test.dart | Updates parser tests and adds coverage that @column fails loudly. |
| packages/builder/test/src/parsers/block_parser_test.dart | Updates parser tests; adds coverage that legacy @column throws with offset. |
| packages/builder/lib/src/parsers/section_parser.dart | Updates documentation/comments to reflect @block. |
| packages/builder/lib/src/parsers/markdown_parser.dart | Updates documentation/comments to reflect @block. |
| packages/builder/lib/src/parsers/block_parser.dart | Rejects legacy @column directives at parse time with a clear exception. |
| docs/tutorials/first-presentation.mdx | Updates tutorial snippets to @block. |
| docs/tutorials/block-layouts.mdx | Updates layout tutorial snippets to @block. |
| docs/reference/markdown-syntax.mdx | Updates syntax reference table to @block. |
| docs/reference/block-types.mdx | Renames @column section to @block and updates examples. |
| docs/index.mdx | Updates docs landing page feature list to @block. |
| docs/guides/superdeck-overview.mdx | Updates overview guide examples and bullet list to @block. |
| docs/guides/markdown-authoring.mdx | Updates authoring guide references/examples to @block. |
| docs/getting-started.mdx | Updates getting-started examples to @block. |
| docs/examples.mdx | Updates examples to @block. |
| demo/slides.md | Updates demo slide deck directives from @column to @block. |
| demo/showcase.md | Updates showcase deck directives from @column to @block. |
| README.md | Updates root README examples to @block. |
| AGENTS.md | Updates contributor/agent guide block-system reference to @block. |
| .planning/feature-templates.md | Updates planning doc references from @column to @block. |
| "style": "show_sections" | ||
| }, | ||
| "markdown": "{@section}\n{@image src: https://picsum.photos/1200/1200?waves align: topLeft fit: cover}\n\n{@section flex: 2}\n{@column flex: 2}\n# Two Column HGoes here\n\nThis is a two-column layout. You can use it to compare two different concepts or ideas.\n\n\n{@column}\n\n### Section Options\n\nEasily customize the content of each section to suit your needs.\n\nUse front matter to define the layout of each section", | ||
| "markdown": "{@section}\n{@image src: https://picsum.photos/1200/1200?waves align: topLeft fit: cover}\n\n{@section flex: 2}\n{@block flex: 2}\n# Two Column HGoes here\n\nThis is a two-column layout. You can use it to compare two different concepts or ideas.\n\n\n{@block}\n\n### Section Options\n\nEasily customize the content of each section to suit your needs.\n\nUse front matter to define the layout of each section", |
There was a problem hiding this comment.
There appears to be a typo in the heading text: "HGoes". This will show up in the reference fixture content and makes the example look unpolished.
| test('rejects legacy column type', () { | ||
| final map = {'type': 'column', 'content': 'Parsed'}; | ||
|
|
||
| expect(() => Block.parse(map), throwsA(anything)); | ||
| }); |
There was a problem hiding this comment.
This test assertion is very broad (throwsA(anything)), so it won’t catch regressions in the failure mode/message. Since the intent is to reject legacy column block types, assert the specific exception type (and ideally part of the message) that callers should rely on.
| "style": "custom" | ||
| }, | ||
| "markdown": "{@section}\n{@column}\n## This is an example of a widgets\n\n{@widget name: demo}\n\n{@column}\n\n```dart\nimport 'package:flutter/material.dart';\n\nvoid main() {\n final style = Style(\n $box.padding.all(),\n $box.border.all(),\n );\n}\n\n```", | ||
| "markdown": "{@section}\n{@block}\n## This is an example of a widgets\n\n{@widget name: demo}\n\n{@block}\n\n```dart\nimport 'package:flutter/material.dart';\n\nvoid main() {\n final style = Style(\n $box.padding.all(),\n $box.border.all(),\n );\n}\n\n```", |
There was a problem hiding this comment.
The slide title text has a grammar typo ("an example of a widgets"). Consider changing it to something like "an example of widgets" or "an example of a widget" (and update the duplicated occurrence in the sections[0].sub_sections[0].content string as well).
Summary
@columnparsing and core model/schema support so markdown content blocks are@blockonly@blockconsistentlyValidation
packages/builder: targeted parser and slide processor testspackages/core: targeted model tests anddart analyze lib testpackages/superdeck:flutter test test/deck/file_deck_loader_test.dart test/deck/bundled_deck_loader_test.dart