Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 20, 2025

On Windows, the Git authentication settings section was completely hidden. Windows users need visibility into which authentication method GitButler uses, even though only one option is supported.

Changes

KeysForm.svelte

  • Added platform detection via backend.platformName
  • Conditionally render SSH key and Git credentials helper options only on non-Windows platforms
  • Display compatibility note on Windows explaining the limitation
  • Default to systemExecutable credential type on Windows (previously defaulted to local)

GitForm.svelte

  • Removed platform check that hid the entire KeysForm component on Windows

Result

{#if isWindows}
  <br /><br />
  <strong>Note:</strong> On Windows, only the Git executable option is available 
  for compatibility reasons.
{/if}

{#if !isWindows}
  <!-- SSH key option -->
  <!-- Git credentials helper option -->
{/if}

Windows users now see the Git authentication section with:

  • "Use a Git executable (default)" option (visible)
  • Explanatory note about Windows limitation (visible)
  • SSH key option (hidden)
  • Git credentials helper option (hidden)

macOS/Linux behavior unchanged.

Original prompt

#11584 (comment) In the "Project Settings -> Git Stuff", on Windows we want to show the whole section, but with only the Use a Git executable (default) entry listed. There should also be a note above that on Windows, this is the only option for compatibility reasons.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

@vercel
Copy link

vercel bot commented Dec 20, 2025

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

1 Skipped Deployment
Project Deployment Review Updated (UTC)
gitbutler-web Skipped Skipped Dec 20, 2025 9:00am

Copilot AI changed the title [WIP] Update Git settings to show single option on Windows Show Git authentication section on Windows with only executable option Dec 20, 2025
Copilot AI requested a review from Byron December 20, 2025 04:35
Copilot AI and others added 2 commits December 20, 2025 09:41
Co-authored-by: Byron <63622+Byron@users.noreply.github.com>
@Byron Byron force-pushed the copilot/update-git-settings-for-windows branch from 795326a to ea050c3 Compare December 20, 2025 09:00
@Byron Byron marked this pull request as ready for review December 20, 2025 09:00
Copilot AI review requested due to automatic review settings December 20, 2025 09:00
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 makes the Git authentication settings section visible on Windows, addressing the issue where it was completely hidden. Windows users can now see which authentication method GitButler uses, even though only the Git executable option is supported on that platform.

Key Changes

  • Made the Git authentication section visible on Windows by removing the platform check in GitForm.svelte
  • Added platform detection in KeysForm.svelte to conditionally hide SSH key and Git credentials helper options on Windows
  • Changed the default credential type to systemExecutable on Windows (previously defaulted to local)

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
apps/desktop/src/components/GitForm.svelte Removed platform check that previously hid the entire KeysForm component on Windows
apps/desktop/src/components/KeysForm.svelte Added platform detection, conditional rendering of auth options, Windows-specific messaging, and platform-appropriate default credential type

Comment on lines +45 to 52
function getDefaultCredentialType(): KeyType {
// Use systemExecutable on Windows since other options are not available
return isWindows ? 'systemExecutable' : 'local';
}
let selectedType: KeyType = $derived(
typeof project?.preferred_key === 'string' ? project?.preferred_key : 'local'
typeof project?.preferred_key === 'string' ? project?.preferred_key : getDefaultCredentialType()
);
Copy link

Copilot AI Dec 20, 2025

Choose a reason for hiding this comment

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

The getDefaultCredentialType() function is being called inside a $derived block (line 51), but it references another $derived value (isWindows). This creates a reactivity issue where the function doesn't properly track the dependency on isWindows.

The selectedType derivation should inline the logic instead of calling a function, or the function should be converted to a $derived itself. Here's the recommended fix:

Replace the function call with inline logic:

let selectedType: KeyType = $derived(
	typeof project?.preferred_key === 'string' 
		? project?.preferred_key 
		: (isWindows ? 'systemExecutable' : 'local')
);

Then remove the getDefaultCredentialType() function as it's no longer needed.

Copilot uses AI. Check for mistakes.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be no problem as isWindows is static.

@Byron
Copy link
Collaborator

Byron commented Dec 20, 2025

It generally seems to work, but the radio box with only one item doesn't seem to display that it's selected until one clicks, even though by all means (i.e. the data) it should already be selected.

The motivation for this PR is #11584 , and it could be followed up by a documentation update which at least mentions that on Windows there is only one choice. But in a way, this now is obvious with the changes in this PR.

@PavelLaptev can probably make this mergeable - the code is easy to try and easy to review with the "hide whitespace" option. Thanks for your help 🙏.

On Windows

The video shows how the initial selection is missing, but everything seems to work.

Screen.Recording.2025-12-20.at.09.58.50.mov

Not on Windows

The video shows how everything works as before. The glitch around selecting the SSH key is also in Nightly

Screen.Recording.2025-12-20.at.09.59.23.mov

Nightly

Here is nightly for reference, so I don't think anything broke.

Screen.Recording.2025-12-20.at.10.02.38.mov

@Byron Byron requested review from PavelLaptev and removed request for Byron December 20, 2025 09:06
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.

2 participants