Skip to content

refactor: remove dead code, unused API, and stale docs - #123

Merged
leoafarias merged 16 commits into
mainfrom
refactor/codebase-cleanup
Sep 23, 2026
Merged

leoafarias merged 16 commits into
mainfrom
refactor/codebase-cleanup

Conversation

@leoafarias

@leoafarias leoafarias commented Sep 22, 2026 •

Copy link
Copy Markdown
Collaborator

Intent

Codebase-wide cleanup after the recent refactors. It removes code, API, dependencies, and files that nothing uses, and corrects docs and comments that are now false. There are two intentional exceptions:

  • the default slide header no longer shows a leftover talk title
  • unused public API is removed while 1.0.0 is still unreleased (pub.dev latest is 0.0.4)

Rebased on main after #122.

Commits

  1. Playground editor leftovers: Command, a duplicate color util, per-file bookmark access (Dart and Swift), unused store APIs, DeckMarkdownCodec.encode, the unrendered deck-edit prompt, empty scaffolds, and editor-era comments.
  2. PDF: the three copy-pasted wait loops become one _pollUntil.
  3. superdeck: the route-authority doc comment moves to the method that implements it.
  4. Unused code:
    • removed: MeasureSize, GoToSlideEvent, MarkdownRenderScope.of, unused Wizard widgets, and generation helpers
    • test helpers and fixtures nothing used
  5. Dependencies and assets:
    • playground: gpt_markdown, golden_toolkit, and integration_test are removed; http moves to dev.
    • superdeck and builder: meta is removed.
    • superdeck: mocktail is removed, and iframe_template.html is no longer bundled.
  6. Docs:
    • The quick-start const SuperDeckApp(options: DeckOptions()) examples did not compile.
    • The 1.0 migration notes called it "the next major" and said 1.x where they meant 0.x.
    • The changelog still named flutter_mermaid.
    • The Copilot instructions were stale.
  7. Tooling config: removes the uninstalled custom_lint plugin, the unused lint_staged block, freezed globs, and stale ignore entries.
  8. Shared analysis options now apply to every package. Five packages used an extends: key the analyzer ignores, so only cli applied the shared settings. Switching to include: surfaces no new issues.
  9. Playground:
    • quick_agent/ becomes generation/, since it is the Wizard's generation engine.
    • Removed: validation codes nothing produces, the write-only open-deck state, and accessors and string wrappers only tests called.
    • Those tests now assert through what production exposes.
  10. refactor! — unused public API (with changelog entries): aiSlideSchema, DeckWorkspace.projectDirectory, BlockInsets.authoringSchema, MarkdownAstConverter.toJson, SlideSerializer.serializeSlide, superDeckAspectRatio.
  11. Test-only fields: usingTemplate, the duplicate ghost-suffix state, CachedImage.targetSize, and PdfController.disposed. savePdfWithFileSaverForTesting becomes savePdfWithFileSaver, since it is the production default.
  12. fix(superdeck): untitled slides no longer show "Generative UI with Flutter" in the default header. Four ci-excluded goldens are updated.
  13. test(superdeck): fails when the vendored Mermaid parser's upstream version differs from the resolved mermaid_core.
  14. Duplicates: removes the cli tests that re-tested core's file extensions, and the unreferenced demo/showcase.md.
  15. Docs links:
    • Package homepages and README links now point at conceptadev/superdeck.
    • navigation.mdx is added to the docs sidebar.
    • Docs no longer name the deleted MeasureSize.
    • AGENTS.md documents vendor/ directories.
  16. Config: the melos pin now gives its real reason (it must match CI's melos-version), and .gitignore explicitly tracks the root lockfile.

Impacted packages

core, builder, cli, superdeck, plugins/pdf, playground, and demo, plus root tooling config and docs.

Commands run (on the rebased branch)

  • fvm dart run melos bootstrap
  • fvm dart run melos run build_runner:build --no-select: no generated-file drift
  • fvm dart analyze --fatal-infos in all 7 packages, and on playground test_live: no issues
  • fvm dart test (core, builder, cli) and fvm flutter test (superdeck, plugins/pdf, playground): all passing
  • fvm dart run melos run contracts:check --no-select: schema up to date
  • xcrun swiftc -parse on the changed Swift files: clean

Not run:

  • the macOS app build and integration tests: both macOS runners target 10.15, which current Xcode rejects
  • DCM: it needs a license, so dead code was found by reference tracing rather than DCM

Kept on purpose

  • DeckPresentationState.isTransitioning and the convenience re-exports (DeckLoader, DeckPlugin, DeckWorkspace, DeckFormatException, and ack from core). These are API for consumers.
  • ...ForTesting and @visibleForTesting seams, which are test seams rather than dead code.
  • DeckCustomizationStore.level(). The tests have no other way to read resolved text styles without pumping widgets.
  • generationBudget. It encodes the 30-second ceiling that the live smoke test asserts.
  • The default footer text #superdeck.

Still open (needs a decision or tools we don't have here)

  • macOS: the minimum window size (1200×700) needs a runtime check. The macOS deployment target of 10.15 also needs raising before any macOS build can run.
  • DCM: packages/playground/dcm_baseline.json still suppresses about 468 findings. Clearing them needs a DCM license.
  • URLs: documentation: URLs (docs.page/btwld), docs.json social links, image asset URLs, and the demo deck content still use btwld. GitHub redirects them.
  • Empty decks: while a deck is empty, DeckPresentationState resets currentIndex to 0 even though the route keeps its slide.
  • CLI tests: CommandX in cli has no direct tests. This predates this PR.

@github-actions

github-actions Bot commented Sep 22, 2026 •

Copy link
Copy Markdown

Visit the preview URL for this PR (updated for commit 56297b2):

https://superdeck-dev--pr123-refactor-codebase-cl-55i0hmru.web.app

(expires Fri, 23 Oct 2026 00:41:26 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: bd68fc230762285849207e7e120aaf87cd4ca2f9

The Wizard became the only authoring flow in #114, but code that only the file-backed editor used stayed behind: the Command pattern, a duplicate color utility, per-file bookmark access on both the Dart and Swift sides, unused store setters and revision tracking, DeckMarkdownCodec.encode, the deck-edit system prompt, and empty scaffold directories. Comments that still described editor sidebars and deck-edit tools now describe the current app.
Delete symbols, files, and fixtures that nothing references outside their own tests: MeasureSize, GoToSlideEvent, MarkdownRenderScope.of, unused Wizard UI components, generation helpers, test helpers, and config fixtures. None of them is exported. Correct comments that pointed at the wrong schema builder or narrated history.
Remove gpt_markdown, golden_toolkit, and integration_test from playground, meta from superdeck and builder, and mocktail from superdeck; move http to playground dev_dependencies. Stop bundling the unused iframe template.
DeckOptions has no const constructor, so the quick-start examples did not compile. The block-layout migration notes called 1.0 the next major and 0.x releases 1.x. The superdeck changelog named flutter_mermaid and a deprecation that became a removal. Copilot instructions listed a removed generator and a fixed frontmatter pitfall.
Drop the uninstalled custom_lint analyzer plugin, the lint_staged block with no runner, freezed and MeasureSize globs in the DCM scripts, and ignore entries for puppeteer and a removed env file.
Five packages loaded shared_analysis_options.yaml through an 'extends:' key that the analyzer does not recognize, so only cli applied it. Include it alongside the lint preset instead; no new issues surface.
…only state

quick_agent is the Wizard's deck-generation engine, so name the folder for what it is. Remove validation codes nothing produces, the write-only open-deck field, and accessors and string wrappers only tests called; those tests now assert through what production exposes.
Remove aiSlideSchema, DeckWorkspace.projectDirectory, BlockInsets.authoringSchema, MarkdownAstConverter.toJson, SlideSerializer.serializeSlide, and superDeckAspectRatio. Nothing in production used them and each has a replacement noted in the changelog.
Drop usingTemplate, the duplicate ghost-suffix state in markdown helpers, CachedImage.targetSize, and PdfController.disposed. Rename savePdfWithFileSaverForTesting to savePdfWithFileSaver, since production uses it as the default saver.
Slides without a title showed 'Generative UI with Flutter'. Show only the slide number instead, and update the affected goldens.
Point package homepages and README links at conceptadev/superdeck, list the navigation reference in the docs sidebar, stop naming the deleted MeasureSize, and document vendor/ directories.
@leoafarias leoafarias changed the title refactor: remove dead code, unused dependencies, and stale docs refactor: remove dead code, unused API, and stale docs Sep 23, 2026
@leoafarias
leoafarias force-pushed the refactor/codebase-cleanup branch from 6a7c772 to 56297b2 Compare September 23, 2026 00:36
@leoafarias
leoafarias merged commit abcc784 into main Sep 23, 2026
6 checks passed
@leoafarias
leoafarias deleted the refactor/codebase-cleanup branch September 23, 2026 01:20
leoafarias added a commit that referenced this pull request Sep 23, 2026
Resolve against #122 and #123 without restoring what they removed:
- Keep DeckLibraryController.openDeck; the ownership fix now reads it in production.
- Serialize retained generations with SlideSerializer instead of reviving DeckMarkdownCodec.encode.
- Drop the PDF dialog's disposed check rather than restoring PdfController.disposed; the dialog disposes a controller only when it replaces it or unmounts.
- Point imports and audit references at features/ai/generation, and state the renderer, assembly, and Mermaid decisions inline now that their notes are gone.
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.

1 participant