Skip to content

Switch content blocks to @block only#54

Merged
leoafarias merged 3 commits intorelease/nextfrom
leoafarias/use-block-only
Mar 11, 2026
Merged

Switch content blocks to @block only#54
leoafarias merged 3 commits intorelease/nextfrom
leoafarias/use-block-only

Conversation

@leoafarias
Copy link
Collaborator

Summary

  • remove legacy @column parsing and core model/schema support so markdown content blocks are @block only
  • update setup scaffolding, demos, docs, and reference fixtures to use @block consistently
  • refresh parser and model tests around the new directive behavior

Validation

  • packages/builder: targeted parser and slide processor tests
  • packages/core: targeted model tests and dart analyze lib test
  • packages/superdeck: flutter test test/deck/file_deck_loader_test.dart test/deck/bundled_deck_loader_test.dart

Copilot AI review requested due to automatic review settings March 11, 2026 14:18
@docs-page
Copy link

docs-page bot commented Mar 11, 2026

To view this pull requests documentation preview, visit the following URL:

docs.page/btwld/superdeck~54

Documentation is deployed and generated using docs.page.

@github-actions
Copy link

github-actions bot commented Mar 11, 2026

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

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 column discriminator normalization and schema branches; enforce block as the only content-block type.
  • Update builder parsing to reject @column directives with a clear DeckFormatException.
  • Refresh docs, demo content, fixtures, and tests to use @block consistently.

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 columnblock 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",
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
Comment on lines +896 to +900
test('rejects legacy column type', () {
final map = {'type': 'column', 'content': 'Parsed'};

expect(() => Block.parse(map), throwsA(anything));
});
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

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.

Copilot uses AI. Check for mistakes.
"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```",
Copy link

Copilot AI Mar 11, 2026

Choose a reason for hiding this comment

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

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).

Copilot uses AI. Check for mistakes.
@leoafarias leoafarias merged commit b32864b into release/next Mar 11, 2026
2 checks passed
@leoafarias leoafarias deleted the leoafarias/use-block-only branch March 11, 2026 14:51
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.

2 participants