Skip to content

Feat/pptx template - #3924

Open
ashwinmukund2 wants to merge 11 commits into
devfrom
feat/pptx-template
Open

ashwinmukund2 wants to merge 11 commits into
devfrom
feat/pptx-template

Conversation

@ashwinmukund2

Copy link
Copy Markdown

Description

Adds a Template PPTX step (export.template_pptx) to the automation canvas. Users pick a PowerPoint template, click shapes in the PPTX viewer to define replacements (text, image or chart), and the step generates a PPTX through the TemplatePPTX pixel. Shape picking works through a new event from the PPTX file panel to the automation inspector.

Changes Made

@semoss/panels

  • Added a FILE_PPTX_VIEWER_PANEL blueprint (file-pptx-panel.tsx). It replaces the generic createFileViewPanel entry for the PPTX viewer.
  • FilePptxView now takes an onShapeSelected prop and forwards the viewer's onSelectionChange as { shapeName, shapeType }.
  • Added the FILE_PANEL_EVENTS.PPTX_SHAPE_SELECTED bus event and the PptxShapeSelectedPayload type. Both are exported.
  • The panel emits the event on the workbench bus, so the panels → workbench dependency direction is preserved.

@semoss/automation

  • New TemplatePptxForm (forms/template-pptx-form.tsx):
    • Fields for the template file and an optional output file name.
    • A Pick Shapes toggle: while it's on, a selected shape is added as a replacement. The type is inferred from the shape: image, chart or text.
    • A chart editor for categories and series.
    • Categories and series values can be literals or an exact variable reference such as ${step.output}, resolved at runtime.
    • A live preview of the generated TemplatePPTX(...) pixel.
  • Added the TemplatePptxConfig, TemplatePptxReplacement and PptxChartSeries types and the new node type.
  • Registered the step in STEP_TYPES and TYPE_DISPLAY_META.
  • Added workflow adapter support for the default config, the merge back to workflow config, and the canvas ↔ workflow type mapping.
  • Threaded pptxShapeSelection through AutomationWorkbenchContext, the inspector panel, InspectorTab, NodeEditDrawer and StepForm.
  • Exported PptxShapeSelection and PptxChartSeries.

@semoss/client

  • AutomationWorkbench listens for PPTX_SHAPE_SELECTED and stores the selection with an incrementing token. Selecting the same shape twice still triggers the form.

How to Test

  1. pnpm install, then pnpm dev:client.
  2. Open an automation and add a Template PPTX step from the step picker.
  3. Set the template file to a .pptx in the app, and open it in a PowerPoint panel.
  4. In the step inspector, turn on Pick Shapes, then click shapes in the PPTX viewer.
    • Expected: each click adds a replacement, typed text, image or chart. Clicking the same shape twice doesn't create a duplicate entry or break the picker.
    • Expected: with Pick Shapes off, selecting shapes adds nothing.
  5. Fill in values:
    • For a chart, enter categories and series, then try ${upstream.var} references.
    • Set an output file name.
    • Expected: the pixel preview updates with the output name, defaulting to output.
  6. Save and reload the automation.
    • Expected: the replacements and the output name round-trip.
  7. Open the automation read-only.
    • Expected: the form is non-editable and Pick Shapes does nothing.
  8. Run pnpm check and pnpm test.

Notes

  • Two of the three commits are marked WIP, so the squash title could drop the WIP tag.
  • pnpm-lock.yaml has uncommitted changes in your working tree. They aren't part of the branch commits, so check before pushing.
  • No tests are included yet. The adapter round-trip and the replacement-type inference (deriveReplacementType) are the best candidates.
  • The TemplatePPTX pixel and the backend contract for variable references aren't part of this PR. The form only builds the pixel for preview.

Ashwin added 6 commits November 10, 2026 18:22
…ate node

- Allow chart categories and series values to be an exact variable
  reference (e.g. ${step.output}) resolved at runtime, using BoundInput
  with upstream variable suggestions in the chart editor
- Add optional outputFileName to the template PPTX config and carry it
  through the workflow adapter (default and merge paths)
- Use outputFileName in the TemplatePPTX pixel preview instead of the
  hardcoded "output.pptx"
- Widen PptxChartSeries/TemplatePptxReplacement types to accept string
  references
@ashwinmukund2
ashwinmukund2 requested a review from a team as a code owner November 21, 2026 03:49
@snyk-io

snyk-io Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

✅ Snyk checks have passed. No issues have been found so far.

Status Scan Engine Critical High Medium Low Total (0)
✅ Open Source Security 0 0 0 0 0 issues

💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse.

@ashwinmukund2

ashwinmukund2 commented Nov 23, 2026 •

Copy link
Copy Markdown
Author

Travon Comments:

  1. the template file has an absolute path backup change it to look in the root for the file incase ppl wanna skip download step and uploads the pptx directly into the assets folder
  2. Also maybe have it as a dropdown selector that searches root for any pptx.
  3. clicking pick shapes should open the pptx selected in template files if not open. and minimize everything else except the inspector in my opinion to help it look less busy
  4. should show the inspector card over the pptx when clicking the shape so it isn't ghost added
  5. set showToolbar to false in pptx viewer. I think it should be strictly for clicking shapes if they need to edit/add things to the pptx it should be done elsewhere. This will also help with the busy look
  6. default add for ppl who already know the shapes so they don't have to manually go click on all them. So if porting over an automation or something from somewhere else you already know the xml. You don't need to go click on all the items, you can automatically set it up.

Ashwin added 5 commits November 23, 2026 14:22
(WIP)

Replace the free-text Template File input in the PPTX template node's
inspector form with a searchable dropdown. It lists .pptx files found in
the automation's project assets and in the current insight folder,
grouped by location, and still accepts a typed path or ${variable}.

- add usePptxTemplateFiles hook that runs SearchAppAssets and
  SearchInsightAssets only while the dropdown is open
- add PptxTemplateSelect popover/command combobox
- pass appId from StepForm through TemplatePptxForm
- add tests for the search result parsing
… (WIP)

Pick Shapes now opens the template chosen in Template File, then collapses
the left and bottom panels so only the PPTX and the Inspector stay visible.

- add findPptxTemplateFile to resolve a template (insight folder first,
  then project assets)
- add usePickPptxShapes in the client to open the template, collapse the
  borders and show the inspector, and move that logic out of the workbench
  shell
- add onPickShapes to the workbench context
- move pptxShapeSelection and onPickShapes into PptxPickContext so the
  inspector, node drawer and step form no longer pass them as props
- add unit tests for the template lookup, the form's shape picking and
  usePickPptxShapes

Work in progress and NOT tested in the browser. Only the unit tests above
have been run. Still to do: verify the open and collapse behavior in the
running app, and restore the collapsed panels when pick mode is turned off.
… or project assets

- findPptxTemplateFile and usePptxTemplateFiles take the run's insight id
  instead of the UI insight; the run is searched first, then the project,
  and a closed run workspace falls through to the project assets
- the template picker lists "Run Files" and "Project Assets"
- Pick Shapes opens a run template scoped to the run's insight
- add getVisibleRun and use it in the run files panel, the inspector panel
  and the pick shapes hook so all three agree on which run is shown
- add runInsightId to PptxPickContext
- update and add unit tests for the lookup, getVisibleRun and
  usePickPptxShapes

Unit tests pass. Not verified: opening a template from a run whose
workspace has already closed, and that TemplatePPTX reads project assets
at run time.
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