Skip to content

Adding Switch podkit component to prebuild settings page #19171

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

Merged
merged 4 commits into from
Dec 1, 2023

Conversation

selfcontained
Copy link
Contributor

@selfcontained selfcontained commented Nov 30, 2023

Description

This primarily just adds a new <Switch/> component to podkit. I also dropped it onto the Prebuilds settings for repo configs. It's not wired up to any api calls yet, wanted to keep this PR scoped to just the component and dropping it into a surface to see it.

Off On
image image
image image
Summary generated by Copilot

🤖[deprecated] Generated by Copilot at 7b5a424

This pull request adds a switch component to the dashboard UI using the @podkit design system and a new dependency on @radix-ui/react-switch. It also allows users to enable or disable prebuilds for a repository in the configuration detail view.

How to test

  • Import a Repository via the Repositories link in the org menu
  • Click the Prebuilds sidebar link
  • Play with toggling the switch on/off. Try it in dark mode as well.
  • It won't make any api calls so don't expect it to enable/disable prebuilds yet, that will come in a followup.

Documentation

Preview status

Gitpod was successfully deployed to your preview environment.

Build Options

Build
  • /werft with-werft
    Run the build with werft instead of GHA
  • leeway-no-cache
  • /werft no-test
    Run Leeway with --dont-test
Publish
  • /werft publish-to-npm
  • /werft publish-to-jb-marketplace
Installer
  • analytics=segment
  • with-dedicated-emulation
  • workspace-feature-flags
    Add desired feature flags to the end of the line above, space separated
Preview Environment / Integration Tests
  • /werft with-local-preview
    If enabled this will build install/preview
  • /werft with-preview
  • /werft with-large-vm
  • /werft with-gce-vm
    If enabled this will create the environment on GCE infra
  • /werft preemptible
    Saves cost. Untick this only if you're really sure you need a non-preemtible machine.
  • with-integration-tests=all
    Valid options are all, workspace, webapp, ide, jetbrains, vscode, ssh. If enabled, with-preview and with-large-vm will be enabled.
  • with-monitoring

/hold

gray: podkitColors.gray,
// Podkit colors - eventually we'll only use these colors
// Once migrated, we can remove the colors above and shift this up under theme directly instead of extend
"pk-content": {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

First step in setting up the new colors for the design system. This will let us reference contextual class names in our podkit components.

@selfcontained selfcontained marked this pull request as ready for review November 30, 2023 00:29
@selfcontained selfcontained requested a review from a team as a code owner November 30, 2023 00:29
Copy link

New dependencies detected. Learn more about Socket for GitHub ↗︎

Packages Version New capabilities Transitives Size Publisher
@radix-ui/react-switch 1.0.3 None +0 44.9 kB benoitgrelard

Copy link
Member

@filiptronicek filiptronicek left a comment

Choose a reason for hiding this comment

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

Super stoked about the color abstractions. Is there a way that they would be theme / state aware, so that pk-surface-primary + pk-surface-primary-dark could become just pk-surface-primary?

Either way, happy to leave for a follow-up.

Comment on lines 26 to 27
Prebuilds reduce wait time for new workspaces. Enabling requires permissions to configure repository
webhooks.{" "}
Copy link
Member

Choose a reason for hiding this comment

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

I think this is safe to remove since it's a part of the switch now. Same goes for the link below, but GitHub did not let me expand my suggestion that far

Suggested change
Prebuilds reduce wait time for new workspaces. Enabling requires permissions to configure repository
webhooks.{" "}
Prebuilds reduce wait time for new workspaces.

@selfcontained
Copy link
Contributor Author

Super stoked about the color abstractions. Is there a way that they would be theme / state aware, so that pk-surface-primary + pk-surface-primary-dark could become just pk-surface-primary?

Either way, happy to leave for a follow-up.

I think there is probably a way, I’ll try and find some time to look into it, would be nice to figure out before proliferating these classnames too much.

@selfcontained
Copy link
Contributor Author

/unhold

@roboquat roboquat merged commit 3155a30 into main Dec 1, 2023
@roboquat roboquat deleted the brad/prebuild-settings-ui branch December 1, 2023 16:23
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.

3 participants