Skip to content

feat/simplify-forge-form-messaging#12266

Merged
PavelLaptev merged 4 commits intomasterfrom
feat/simplify-forge-form-messaging
Feb 7, 2026
Merged

feat/simplify-forge-form-messaging#12266
PavelLaptev merged 4 commits intomasterfrom
feat/simplify-forge-form-messaging

Conversation

@PavelLaptev
Copy link
Contributor

@PavelLaptev PavelLaptev commented Feb 7, 2026

Before:
Screenshot 2026-02-07 at 00 37 56

After:
Screenshot 2026-02-07 at 01 22 14


Figma link https://www.figma.com/design/ShIiR6hI5dzH7sT5L03Jg1/App-Design-3.5?node-id=11100-42752&t=fHeg6ha2kFbpcFI1-1


Summary

  • Simplify ForgeForm messaging and CTA for missing accounts.
  • Consolidate forge options and extract repeated account configuration into a reusable renderer.

What changed

  • Replaced verbose InfoMessage blocks with inline conditional titles ("No GitLab accounts found" / "No GitHub accounts found") and a single "Set up in General Settings" button with icon.
  • Removed open-settings container CSS and InfoMessage wrappers; streamlined markup and styles.
  • Centralized forge options into a FORGE_OPTIONS constant (None, GitHub, GitLab, Azure, BitBucket).
  • Added AccountIdentifier union type and getAccountUsername helper for consistent username access.
  • Simplified Select handler to call handleSelectionChange directly.
  • Extracted provider account configuration into a reusable forgeAccountConfig renderer and applied it for GitLab (pattern started for GitHub).
  • Passed provider-specific utilities (account lists, conversion functions, badge component, docs URL, request type) into the reusable renderer to keep provider UI customizable and reduce duplication.

Why

  • Make form copy more compact and consistent across forges.
  • Reduce duplicated markup and styles.
  • Emphasize a single actionable path to integrations settings.
  • Improve readability and maintainability and make adding/updating providers easier.

Notes for reviewers

  • Pay attention to the reusable renderer inputs for provider-specific behavior.
  • Verify that account selection and CTA interactions match previous behavior.

Refactor ForgeForm UI to remove InfoMessage components and adjust titles
and call-to-action for missing GitLab/GitHub accounts. Replace the verbose
warning blocks with inline conditional titles ("No GitLab accounts found"
/"No GitHub accounts found") and a unified "Set up in General Settings"
button that uses an icon and concise label. Remove the dedicated
open-settings container CSS and streamline markup by deleting
InfoMessage wrappers and related styles.

This makes the form copy more compact and consistent across forges,
reduces duplicated markup, and emphasizes a single actionable path to
open integrations settings.
- Replace duplicate forgeOptions with a single FORGE_OPTIONS const to avoid
  repetition and centralize available forge choices (None, GitHub, GitLab,
  Azure, BitBucket).
- Add AccountIdentifier union type and getAccountUsername helper for
  consistent access to account usernames across providers.
- Simplify Select onselect handler to call handleSelectionChange directly.
- Extract repeated provider account configuration markup into a reusable
  forgeAccountConfig render invocation for GitLab (and begin same pattern
  for GitHub). This removes duplicated CardGroup.Item blocks and their
  internal select/item rendering logic.
- Pass provider-specific utilities (account lists, conversion functions,
  badge component, docs URL and request type) into the reusable renderer
  so provider UI remains customizable.

Motivation: reduce duplication, improve readability and maintainability,
and make it easier to add or update forge provider UI in one place.
Copilot AI review requested due to automatic review settings February 7, 2026 00:18
@vercel
Copy link

vercel bot commented Feb 7, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
gitbutler-web Skipped Skipped Feb 7, 2026 0:42am

Request Review

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

This PR simplifies the Desktop app’s ForgeForm UI by consolidating provider-specific account configuration into a reusable renderer and tightening the “missing accounts” messaging/CTA to a single General Settings action.

Changes:

  • Replaced provider-specific InfoMessage blocks with a shared forgeAccountConfig renderer and inline titles/CTA.
  • Centralized forge select options into a FORGE_OPTIONS constant and simplified the select onselect handler.
  • Introduced a shared AccountIdentifier union + getAccountUsername helper for consistent username rendering.

Update ForgeForm.svelte to show a clear call-to-action when no
accounts or no preferred account are present. Replace the passive
"No {displayName} accounts found" with "Connect your {displayName}
account" so users see an explicit next step instead of a status-only
message.

This improves onboarding clarity and encourages users to complete
account setup for integrations.
Introduce a new ForgeAccountConfig component to let users view and
select a preferred Forge account for a project. The component:
- accepts typed props for accounts, conversion helpers, badge component,
  request type and docs URL.
- shows contextual title/caption depending on whether any accounts are
  connected.
- opens General Settings when no accounts exist.
- renders a Select with custom items showing username and AccountBadge,
  and updates the preferred account on change.

Refactor UnassignedViewForgePrompt to simplify integration flow:
- remove project-specific settings branch and the unused AvailableForge
  type import.
- always open General Settings('integrations') for configuration,
  removing openProjectSettings usage and the forge-specific switch.
- adjust button handler to call the simpler configureIntegration.

Minor wiring:
- import ForgeAccountConfig in ForgeForm.
- remove now-unused useSettingsModal import from ForgeForm.
- small adjustments to imports and typing.

These changes streamline account configuration, consolidate
settings navigation, and add a reusable UI for selecting a Forge
account per project.
Copilot AI review requested due to automatic review settings February 7, 2026 00:42
@PavelLaptev PavelLaptev force-pushed the feat/simplify-forge-form-messaging branch from faa4fbf to 7c52d36 Compare February 7, 2026 00:42
@PavelLaptev
Copy link
Contributor Author

cc @estib-vega

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.

}: Props = $props();

const { openGeneralSettings } = useSettingsModal();
const hasAccounts = $derived(accounts.length > 0 && preferredAccount);
Copy link

Copilot AI Feb 7, 2026

Choose a reason for hiding this comment

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

hasAccounts is derived from accounts.length > 0 && preferredAccount, which makes its type/value TAccount | false | undefined rather than a boolean. This works in {#if} but is harder to reason about and can confuse TS narrowing; consider deriving a boolean explicitly (e.g., accounts.length > 0 && preferredAccount !== undefined).

Suggested change
const hasAccounts = $derived(accounts.length > 0 && preferredAccount);
const hasAccounts = $derived(accounts.length > 0 && preferredAccount !== undefined);

Copilot uses AI. Check for mistakes.
@PavelLaptev PavelLaptev enabled auto-merge (squash) February 7, 2026 00:48
@PavelLaptev PavelLaptev merged commit 58c2ee0 into master Feb 7, 2026
31 checks passed
@PavelLaptev PavelLaptev deleted the feat/simplify-forge-form-messaging branch February 7, 2026 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant