Skip to content

AINATIVEM-44 app extensions: ComposeBuilder, panel SDK demo, env-driven config#11

Merged
youssef-saber-3 merged 7 commits into
masterfrom
AINATIVEM-44
May 15, 2026
Merged

AINATIVEM-44 app extensions: ComposeBuilder, panel SDK demo, env-driven config#11
youssef-saber-3 merged 7 commits into
masterfrom
AINATIVEM-44

Conversation

@youssef-saber-3
Copy link
Copy Markdown
Contributor

Summary

  • Replace 6 string-assembly docker-compose functions with a typed ComposeBuilder class that serializes once via the yaml package — consistent with the existing NodeProjectBuilder pattern
  • Fix app extension panel: resize now toggles between two sizes; button label updates accordingly
  • Add Log activity button to the panel that opens Pipedrive's native activity creation dialog pre-filled with the current deal from iframe context (selectedIds)
  • Load custom modal action_id from VITE_CUSTOM_MODAL_ACTION_ID env var instead of a hardcoded placeholder; .env.example documents it; envDir in vite config points to project root; app-extension-ui docker-compose service gets env_file
  • Add AES-256-GCM token encryption (ENCRYPTION_KEY) to the generated OAuth token repository

Test plan

  • Generate a postgres app and run docker-compose up --watch — confirm stack starts and OAuth flow works
  • Generate a mysql app and confirm the same
  • Generate a sqlite app — no db service in compose, backend starts directly
  • Generate a custom-panel + custom-modal app — confirm VITE_CUSTOM_MODAL_ACTION_ID appears in .env.example
  • In the running panel: "Log activity" opens the activity dialog pre-linked to the current deal
  • In the running panel: resize button toggles between expanded and collapsed
  • In the running panel: "Open modal" works when VITE_CUSTOM_MODAL_ACTION_ID is set correctly in .env

- resize now toggles between initial and expanded sizes; clicking again collapses back
- button label updates to "Expand panel/modal" / "Collapse panel/modal"
- open modal handler gets a comment pointing to Developer Hub action_id config
@youssef-saber-3 youssef-saber-3 marked this pull request as ready for review May 15, 2026 10:48
Copilot AI review requested due to automatic review settings May 15, 2026 10:48
Copy link
Copy Markdown

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 updates the generated Node app-extension experience by wiring environment-driven modal configuration, adding panel SDK demo actions, and improving resize behavior.

Changes:

  • Adds VITE_CUSTOM_MODAL_ACTION_ID support and Vite root .env loading for generated app-extension UI.
  • Adds app-extension UI Docker Compose env loading.
  • Updates generated panel/modal SDK demo UI with activity logging and expand/collapse labels.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
src/generators/node/projectBuilder.ts Documents the custom modal action ID env variable in generated .env.example.
src/generators/node/database.ts Passes .env into the generated app-extension UI Docker Compose service.
src/generators/node/appExtensions/sdk.ts Tracks resize expanded/collapsed state in the generated SDK wrapper.
src/generators/node/appExtensions/frontend.ts Uses env-driven custom modal IDs and adds panel activity logging plus resize labels.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +197 to 206
const nextExpanded = !isExpanded;
const size = surface === 'modal'
? (nextExpanded ? { height: 480, width: 720 } : { height: 420, width: 640 })
: (nextExpanded ? { height: 420 } : { height: 360 });
await runSdkAction(nextExpanded ? 'Expanded' : 'Collapsed', (client) =>
client.execute(Command.RESIZE, size),
);
setIsExpanded(nextExpanded);
}, [runSdkAction, surface, isExpanded]);


async function logActivity(): Promise<void> {
const dealId = context.query.selectedIds ? parseInt(context.query.selectedIds) : undefined;
await runSdkAction('Activity logged', (client) =>
Comment on lines 181 to +184
client.execute(Command.OPEN_MODAL, {
type: Modal.CUSTOM_MODAL,
action_id: 'custom-modal',
// Replace with your Custom Modal's "Extension identifier" from Marketplace Developer Hub → App Extensions
action_id: import.meta.env.VITE_CUSTOM_MODAL_ACTION_ID,
Comment on lines +226 to +227
client.execute(Command.OPEN_MODAL, {
type: Modal.ACTIVITY,
Copy link
Copy Markdown
Contributor

@dmitriyeff dmitriyeff left a comment

Choose a reason for hiding this comment

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

🚀 🚀 🚀

@youssef-saber-3 youssef-saber-3 merged commit 276c133 into master May 15, 2026
1 check passed
@youssef-saber-3 youssef-saber-3 deleted the AINATIVEM-44 branch May 15, 2026 11:19
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.

3 participants