Skip to content

Add app information modal to dev session UI #6052

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

nickwesselman
Copy link
Contributor

@nickwesselman nickwesselman commented Jul 2, 2025

Summary

The new app dev command makes the app URL less accessible. This PR adds a new App Information modal accessible via the i key in app dev, which includes the app URL. It also adds the App URL as an output to the app dev logs, via dev session messaging on the app home component.

Key Features

Modal triggered by 'i' key - Only available when app preview is ready
Escape key or 'i' again to close - Intuitive toggle behavior
Comprehensive app information display:

  • App name
  • App URL (development URL)
  • Config file name
  • Dev store
  • Organization name
    Clean UI integration - Hides preview/GraphiQL URLs when modal is active
    Consistent styling - Uses Alert component from cli-kit for proper formatting

Implementation Details

  • Added modal state management to DevSessionUI component
  • Enhanced keyboard event handling for 'i' and escape keys
  • Created reusable formatAppInfoBody utility following existing patterns
  • Updated prop threading through dev session component hierarchy
  • Maintains alphabetical order of menu items in footer

Testing

  • 21 comprehensive test cases covering all functionality
  • Tests for keyboard shortcuts, modal state management, and formatting
  • Updated existing snapshots to include new UI elements
  • All existing tests continue to pass

Code Quality

  • Follows existing code patterns and conventions
  • TypeScript compliant with proper type definitions
  • Passes all linting checks
  • No breaking changes to existing functionality

Test plan

  • Run shopify app dev command
  • Verify 'i' key option appears only when app is ready
  • Press 'i' to show app information modal
  • Verify all app details are displayed correctly
  • Press escape or 'i' again to close modal
  • Verify preview/GraphiQL URLs are hidden when modal is active
  • Verify all tests pass and no regressions introduced

🤖 Generated with Claude Code

@nickwesselman nickwesselman requested a review from a team as a code owner July 2, 2025 21:29

This comment has been minimized.

@nickwesselman nickwesselman marked this pull request as draft July 2, 2025 21:30
Copy link
Contributor

github-actions bot commented Jul 2, 2025

Coverage report

St.
Category Percentage Covered / Total
🟡 Statements
78.38% (+0.04% 🔼)
12590/16062
🟡 Branches
72.61% (+0.15% 🔼)
6142/8459
🟡 Functions
78.47% (-0.01% 🔻)
3281/4181
🟡 Lines
78.82% (+0.04% 🔼)
11912/15112
Show new covered files 🐣
St.
File Statements Branches Functions Lines
🟢
... / format-app-info-body.ts
100% 100% 100% 100%
Show files with reduced coverage 🔻
St.
File Statements Branches Functions Lines
🟢
... / app_config_app_home.ts
83.33% (-16.67% 🔻)
100%
50% (-50% 🔻)
83.33% (-16.67% 🔻)
🟢
... / Dev.tsx
90.59% (-2.35% 🔻)
75% (-1.79% 🔻)
86.36% (-4.55% 🔻)
92.5% (-1.25% 🔻)

Test suite run success

2927 tests passing in 1264 suites.

Report generated by 🧪jest coverage report action from 060cc88

@nickwesselman nickwesselman marked this pull request as ready for review July 3, 2025 16:36
nickwesselman and others added 6 commits July 3, 2025 13:05
- Add appURL prop to DevSessionUI component interface
- Display App URL in terminal footer when available
- Pass development URL from config through renderDev to DevSessionUI
- Show App URL above Preview URL and GraphiQL URL for consistent ordering

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit introduces a comprehensive app information modal accessible via the 'i' key during `shopify app dev` sessions. The modal displays essential app details including app name, app URL, config file, dev store, and organization in a clean, formatted interface.

Key features:
- Modal triggered by 'i' key (when app preview is ready)
- Escape key or 'i' key again to close
- Uses Alert component from cli-kit for consistent styling
- Hides preview/GraphiQL URLs when modal is active
- Comprehensive test coverage with 21 test cases
- Follows existing code patterns and conventions

Files changed:
- DevSessionUI: Added modal state management and keyboard handlers
- New utility: formatAppInfoBody for consistent formatting
- Enhanced prop threading through dev session components
- Updated test snapshots and added extensive test coverage

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
The Box wrapper around the persistent dev alert was inadvertently removed.
This change restores the proper spacing and layout consistency by adding
back the Box component with marginTop={1} and flexDirection="column".

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@nickwesselman nickwesselman force-pushed the feature/app-info-modal branch from 5a49f25 to 913b4b8 Compare July 3, 2025 17:05
@nickwesselman nickwesselman requested a review from a team as a code owner July 3, 2025 17:07
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