Skip to content

feat(editor): expose exportFloorplanPdf and add structure+utility export scope - #636

Open
SomSamantray wants to merge 4 commits into
pascalorg:mainfrom
SomSamantray:feat/floorplan-export-routing-scope
Open

feat(editor): expose exportFloorplanPdf and add structure+utility export scope#636
SomSamantray wants to merge 4 commits into
pascalorg:mainfrom
SomSamantray:feat/floorplan-export-routing-scope

Conversation

@SomSamantray

@SomSamantray SomSamantray commented Aug 11, 2026

Copy link
Copy Markdown

What does this PR do?

Fixes the two gaps from #619 that blocked host apps from shipping their own floorplan export UI:

  • exportFloorplanPdf is now exported from @pascal-app/editor, so hosts can trigger a PDF export directly instead of only through the built-in Settings panel.
  • A new 'routing' export scope includes structure and utility nodes (ducts, pipes, HVAC) while excluding furniture, for electrical/engineering sheets. The scope filter is shared through one pure predicate applied at both collection sites; 'full' and 'structure' behavior is unchanged.

How to test

  1. bun test packages/editor/src/lib/floorplan — 51 pass, including new isFloorplanNodeInExportScope cases for all scopes/categories.
  2. bun run --cwd apps/editor check-types and bun run --cwd packages/editor check-types — pass, including a new consumer-side import assertion guarding the re-export.
  3. Editor app boots on bun dev with no console errors.

Screenshots / screen recording

Not applicable — library API change with no visual difference.

Checklist

  • I've tested this locally with bun dev
  • My code follows the existing code style (run bun check to verify)
  • I've updated relevant documentation (if applicable)
  • This PR targets the main branch

Related: #619


Compound Engineering


Note

Low Risk
Focused library API and export filtering change with tests; existing full/structure export paths are preserved via the same predicate semantics.

Overview
Exposes exportFloorplanPdf and FloorplanExportScope from @pascal-app/editor so host apps can trigger PDF export without reaching into internal paths (addresses #619).

Adds a routing export scope: structure plus utility nodes (ducts, pipes, HVAC), excluding furniture and other categories. full and structure behavior is unchanged. Scope filtering is centralized in isFloorplanNodeInExportScope and used at both floorplan geometry collection sites (level tree walk and linked-level nodes) instead of duplicated inline checks.

Unit tests cover the predicate for all scopes and categories; apps/editor gets a compile-time smoke test that the package entry still re-exports the API and includes routing in the scope union. A residual review findings doc records follow-up issues (schedules ignoring scope, no in-tree UI for routing, etc.).

Reviewed by Cursor Bugbot for commit 40a1543. Bugbot is set up for automated code reviews on this repo. Configure here.

SomSamantray and others added 4 commits August 11, 2026 20:48
Add a third FloorplanExportScope value that includes structure and
utility nodes (ducts, pipes, HVAC) without furniture, shared through a
pure isFloorplanNodeInExportScope predicate used at both collection
filter sites. Existing 'full' and 'structure' behavior is unchanged.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Re-export exportFloorplanPdf and the FloorplanExportScope type from
@pascal-app/editor so hosts with their own export UI can trigger a
floorplan PDF export without reaching into the settings panel.

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
…t comment

Per code review, add a consumer-side compile-time assertion in apps/editor
that imports exportFloorplanPdf and FloorplanExportScope from the
@pascal-app/editor package entry, so a broken re-export fails check-types
instead of passing silently. Also drop the WHAT-narration doc comment on
collectFloorplanGeometry (behavior-preserving).

Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
Co-authored-by: CommandCodeBot <noreply@commandcode.ai>
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