Skip to content

feat: native app params use tunnel selector flow#80

Merged
aledefra merged 6 commits intodevelopfrom
codex/native-app-tunnel-selector
Mar 24, 2026
Merged

feat: native app params use tunnel selector flow#80
aledefra merged 6 commits intodevelopfrom
codex/native-app-tunnel-selector

Conversation

@aledefra
Copy link
Collaborator

@aledefra aledefra commented Mar 24, 2026

Summary

  • switch native plugin App Parameters to use the same tunnel selector/generation flow used in generic apps
  • remove manual tunnel token insertion path for native plugin App Parameters
  • add a deterministic Playwright preview harness for the native App Parameters tunneling UI

Validation

  • npm run lint
  • NEXT_PUBLIC_ENVIRONMENT=devnet NEXT_PUBLIC_API_URL=https://example.com npm run build
  • screenshot captured: .playwright/native-app-parameters-tunnel-selector.png

CI

  • GitHub Actions checks are passing (lint, build).

Copilot AI review requested due to automatic review settings March 24, 2026 11:47
Copy link
Contributor

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

Updates the native plugin “App Parameters” tunneling UI to use the same tunnel selector / generation workflow as generic apps, removing the manual token entry path and adding a deterministic Playwright preview harness for this UI.

Changes:

  • Added allowManualTunnelToken to AppParametersSection to optionally remove the “Custom” (manual token) option from the tunnel selector.
  • Updated native plugin inputs to use tunnel selector + generation flow (and disallow manual token entry).
  • Added a dev-only Playwright preview component/page content for the native App Parameters tunneling UI.

Reviewed changes

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

File Description
src/components/playwright-preview/NativeAppParametersPreview.tsx Adds a deterministic preview harness rendering AppParametersSection with the native-plugin tunneling configuration.
src/components/create-job/sections/AppParametersSection.tsx Adds allowManualTunnelToken and adjusts selector behavior when manual token entry is disallowed.
src/components/create-job/plugins/NativeInputsSection.tsx Switches native plugin app parameters to use tunnel selector + generation and disables manual token entry.
app/(public)/playwright-preview/page.tsx Renders the new native app parameters preview component in the dev-only Playwright preview route.

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

Copilot AI review requested due to automatic review settings March 24, 2026 12:01
Copy link
Contributor

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

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


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

Copy link
Contributor

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

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


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


{allowManualTunnelToken === false &&
!!tunnelingSecrets &&
!isFetchingTunnels &&
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

The "No tunnels found. Generate one to continue." info tag can appear before the initial fetch runs (brief flicker) and also on fetch errors, since it only checks existingTunnels.length === 0 and not whether the tunnels list was successfully fetched. Consider gating this message on hasFetchedTunnelsSuccessfully (and/or adding a distinct error state) so users aren’t told there are no tunnels when the request failed or hasn’t completed yet.

Suggested change
!isFetchingTunnels &&
!isFetchingTunnels &&
hasFetchedTunnelsSuccessfully &&

Copilot uses AI. Check for mistakes.
Comment on lines +79 to +83
isCreatingTunnel={isCreatingTunnel}
enableTunnelSelector
allowManualTunnelToken={false}
onGenerateTunnel={onGenerateTunnel}
isTunnelGenerationDisabled={!tunnelingSecrets}
Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

allowManualTunnelToken={false} disables manual tunnel token entry for generic plugins as well. The PR description calls out removing the manual insertion path for the native plugin App Parameters specifically—please confirm this broader behavior change is intended, or update the PR description / set allowManualTunnelToken appropriately for generic plugins.

Copilot uses AI. Check for mistakes.
Comment on lines +38 to +55
const onGenerateTunnel = async () => {
if (!tunnelingSecrets) {
toast.error('Missing Cloudflare secrets.');
return;
}

setFormSubmissionDisabled(true);
setCreatingTunnel(true);

try {
const projectName = projectHash ? getProjectName(projectHash) : '';
const pluginAliasSuffix = stripToAlphanumeric(pluginName || deploymentAlias || 'plugin').toLowerCase();
const tunnelAlias = projectName
? `${stripToAlphanumeric(projectName).toLowerCase()}-${pluginAliasSuffix}`
: pluginAliasSuffix;

const response = await createTunnel(tunnelAlias, tunnelingSecrets);

Copy link

Copilot AI Mar 24, 2026

Choose a reason for hiding this comment

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

The onGenerateTunnel implementation here is essentially duplicated in multiple places (e.g. NativeInputsSection, GenericDeployment, ServiceDeployment). To avoid these flows drifting (alias formatting, error handling, disabled-state management), consider extracting a shared helper/hook for tunnel creation that takes the suffix inputs and returns the {token, url} result.

Copilot uses AI. Check for mistakes.
@aledefra aledefra changed the base branch from main to develop March 24, 2026 15:43
@aledefra aledefra merged commit a675b42 into develop Mar 24, 2026
2 checks passed
@aledefra aledefra deleted the codex/native-app-tunnel-selector branch March 24, 2026 15:44
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.

2 participants