Skip to content
Merged
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
6839602
fix: dark mode background color support in advanced options input fields
nadr0 Aug 11, 2025
529a1ae
chore: implementing quick values for the default domain
nadr0 Aug 11, 2025
41a4f91
fix: trying to merge main?
nadr0 Aug 12, 2025
fd15458
fix: don't know how this happened?
nadr0 Aug 12, 2025
97c0eac
Merge branch 'main' into nadro/adhoc/environment-quality-of-life
nadr0 Aug 12, 2025
fafe17b
chore: adding a new icon for the domain
nadr0 Aug 12, 2025
a50b2a1
Merge branch 'nadro/adhoc/environment-quality-of-life' of github.com:…
nadr0 Aug 12, 2025
259c544
Update snapshots
github-actions[bot] Aug 12, 2025
08f6722
Update snapshots
github-actions[bot] Aug 12, 2025
ba68dc9
fix: improving layout from PR comments
nadr0 Aug 12, 2025
ec7d549
Merge branch 'nadro/adhoc/environment-quality-of-life' of github.com:…
nadr0 Aug 12, 2025
3e69a2f
chore: nvm reverting this so I don't do too much in one PR
nadr0 Aug 12, 2025
d169e4d
fix: removing unused file
nadr0 Aug 12, 2025
7ffd276
fix: last fix for dark and light coloring, had some issues
nadr0 Aug 12, 2025
48cc104
Update snapshots
github-actions[bot] Aug 12, 2025
5109bbd
Update snapshots
github-actions[bot] Aug 12, 2025
dc1a5f5
Update snapshots
github-actions[bot] Aug 12, 2025
d0850c4
fix: merging main, annoying snapshot conflict
nadr0 Aug 21, 2025
167aa90
Merge branch 'main' into nadro/adhoc/environment-quality-of-life
nadr0 Aug 22, 2025
0083997
Update snapshots
github-actions[bot] Aug 22, 2025
746515e
Update snapshots
github-actions[bot] Aug 22, 2025
bd32dea
Update snapshots
github-actions[bot] Aug 22, 2025
1a022ea
Update snapshots
github-actions[bot] Aug 22, 2025
5a0c45b
Update snapshots
github-actions[bot] Aug 22, 2025
a194313
Update snapshots
github-actions[bot] Aug 22, 2025
6441704
Merge branch 'main' into nadro/adhoc/environment-quality-of-life
nadr0 Aug 29, 2025
c6c0910
fix: huh?
nadr0 Aug 29, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
159 changes: 133 additions & 26 deletions src/routes/AdvancedSignInOptions.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,72 @@
import { Popover, Transition, Combobox } from '@headlessui/react'
import { Popover, Transition, Combobox, RadioGroup } from '@headlessui/react'
import { CustomIcon } from '@src/components/CustomIcon'
import { Fragment } from 'react'
import { Fragment, useState } from 'react'
import { isDesktop } from '@src/lib/isDesktop'
import { ActionButton } from '@src/components/ActionButton'

interface Domain {
name: string
}

function SupportedDomainsRadioGroup({
selected,
setSelected,
domains,
}: {
selected: string
setSelected: (environment: string) => void
domains: Domain[]
}) {
return (
<div className="w-full py-4">
<div className="mx-auto w-full max-w-md">
<RadioGroup value={selected} onChange={setSelected}>
<div className="space-y-2">
{domains.map((domain) => (
<RadioGroup.Option
key={domain.name}
value={domain.name}
className={({ checked }) =>
`${checked ? 'bg-primary' : 'text-chalkboard-70'}
relative flex cursor-pointer rounded py-1 focus:outline-none`
}
>
{({ checked }) => (
<>
<div className="flex w-full items-center justify-between">
<div className="flex items-center">
<div className="text-sm">
<RadioGroup.Label
as="p"
className={`text-xs px-1 ${
checked
? 'text-chalkboard-30'
: 'text-chalkboard-70 dark:text-chalkboard-30'
}`}
>
{domain.name}
</RadioGroup.Label>
</div>
</div>
{checked && (
<div className="shrink-0 text-white">
<CustomIcon
name="checkmark"
className="w-4 h-4 text-chalkboard-10 dark:text-chalkboard-40"
/>
</div>
)}
</div>
</>
)}
</RadioGroup.Option>
))}
</div>
</RadioGroup>
</div>
</div>
)
}

export const AdvancedSignInOptions = ({
pool,
Expand All @@ -14,6 +79,19 @@
selectedEnvironment: string
setSelectedEnvironment: (environment: string) => void
}) => {
const domains: Domain[] = [
{
name: 'zoo.dev',
},
{
name: 'zoogov.dev',
},
{
name: 'dev.zoo.dev',
},
]
const [showCustomInput, setShowCustomInput] = useState(false)

return isDesktop() ? (
<div className="flex flex-row items-center">
<span className="text-xs text-chalkboard-70 dark:text-chalkboard-30 w-64 h-8">
Expand Down Expand Up @@ -51,41 +129,70 @@
as={Fragment}
>
<Popover.Panel
className={`z-10 absolute top-full left-0 mt-1 p-2 w-52 bg-chalkboard-10 dark:bg-chalkboard-90
className={`z-10 flex flex-col absolute top-full left-0 mt-1 p-2 w-52 bg-chalkboard-10 dark:bg-chalkboard-90
border border-solid border-chalkboard-20 dark:border-chalkboard-90 rounded
shadow-lg`}
>
{() => (
<>
<div className="flex flex-col items-start py-0.5">
<span className="text-xs text-chalkboard-70 dark:text-chalkboard-30">
Domain
</span>
</div>
<span className="text-xs text-chalkboard-70 dark:text-chalkboard-30">
Supported Domains
</span>

Check warning on line 140 in src/routes/AdvancedSignInOptions.tsx

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

jsx-not-internationalized

JSX element not internationalized Supported Domains . You should support different languages in your website or app with internationalization. Instead use packages such as i18next in order to internationalize your elements.
<SupportedDomainsRadioGroup
selected={selectedEnvironment}
setSelected={setSelectedEnvironment}
domains={domains}
/>
<ActionButton
Element="button"
className={
'text-xs text-chalkboard-70 dark:text-chalkboard-30 border-none pl-0 pb-2'
}
onClick={() => setShowCustomInput((show) => !show)}
>
Advanced options
<CustomIcon
name="caretDown"
className={`w-4 h-4 ${!showCustomInput ? '' : 'ui-open:rotate-180'} `}
Copy link
Contributor

Choose a reason for hiding this comment

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

The ui-open:rotate-180 class is designed for Headless UI disclosure components where the ui-open: modifier is automatically applied. Since this is a standard button toggle using React state, the rotation should be directly tied to the state variable:

className={`w-4 h-4 ${showCustomInput ? 'rotate-180' : ''}`}

This will ensure the caret rotates correctly when the advanced options are toggled.

Suggested change
className={`w-4 h-4 ${!showCustomInput ? '' : 'ui-open:rotate-180'} `}
className={`w-4 h-4 ${showCustomInput ? 'rotate-180' : ''} `}

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

/>
</ActionButton>

Check warning on line 158 in src/routes/AdvancedSignInOptions.tsx

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

jsx-not-internationalized

JSX element not internationalized Advanced options . You should support different languages in your website or app with internationalization. Instead use packages such as i18next in order to internationalize your elements.
{showCustomInput && (
<div className="flex flex-col items-start py-0.5">
<span className="text-xs text-chalkboard-70 dark:text-chalkboard-30">
Domain
</span>

Check warning on line 163 in src/routes/AdvancedSignInOptions.tsx

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

jsx-not-internationalized

JSX element not internationalized Domain . You should support different languages in your website or app with internationalization. Instead use packages such as i18next in order to internationalize your elements.
</div>
)}

<Combobox
value={selectedEnvironment}
onChange={setSelectedEnvironment}
>
<Combobox.Input
className="gap-1 rounded h-9 mr-auto max-h-min min-w-max border py-1 flex items-center dark:hover:bg-chalkboard-90 text-xs text-chalkboard-70 dark:text-chalkboard-30"
placeholder="auto"
onChange={(event) =>
setSelectedEnvironment(event.target.value)
}
/>
{showCustomInput && (
<Combobox.Input
className="gap-1 rounded h-6 border px-2 flex items-center dark:hover:bg-chalkboard-80 text-xs text-chalkboard-70 dark:text-chalkboard-30 dark:bg-chalkboard-90"
placeholder="auto"
onChange={(event) =>
setSelectedEnvironment(event.target.value)
}
/>
)}
Comment on lines +171 to +179
Copy link
Contributor

Choose a reason for hiding this comment

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

UI State Synchronization Issue

There's a potential state synchronization issue between the radio group selection and the custom domain input. When a user:

  1. Selects a predefined domain via the radio group
  2. Opens advanced options (the custom input will show this selected value)
  3. Closes advanced options without modifying the input

The application maintains the selectedEnvironment value but the UI no longer clearly indicates which input method is active. This creates a disconnected state where the selected value exists but isn't visibly represented in the UI.

Consider one of these approaches:

  • Maintain separate state for radio selection vs. custom input, with logic to reconcile them
  • Add synchronization logic to ensure the radio group reflects the current selectedEnvironment when toggling advanced options
  • Implement a clear visual indication of which input method is currently controlling the domain value

This would improve the user experience by maintaining a consistent relationship between the UI state and the underlying domain value.

Spotted by Diamond

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

</Combobox>
<div className="flex flex-col items-start py-0.5">
<span className="text-xs text-chalkboard-70 dark:text-chalkboard-30">
Connection pool
</span>
</div>
{showCustomInput && (
<div className="flex flex-col items-start py-1">
<span className="text-xs text-chalkboard-70 dark:text-chalkboard-30">
Connection pool
</span>

Check warning on line 185 in src/routes/AdvancedSignInOptions.tsx

View workflow job for this annotation

GitHub Actions / semgrep-oss/scan

jsx-not-internationalized

JSX element not internationalized Connection pool . You should support different languages in your website or app with internationalization. Instead use packages such as i18next in order to internationalize your elements.
</div>
)}
<Combobox value={pool} onChange={setPool}>
<Combobox.Input
className="
gap-1 rounded h-9 mr-auto max-h-min min-w-max border py-1 flex items-center dark:hover:bg-chalkboard-90 text-xs text-chalkboard-70 dark:text-chalkboard-30"
placeholder="auto"
onChange={(event) => setPool(event.target.value)}
/>
{showCustomInput && (
<Combobox.Input
className="gap-1 rounded h-6 border px-2 flex items-center dark:hover:bg-chalkboard-80 text-xs text-chalkboard-70 dark:text-chalkboard-30 dark:bg-chalkboard-90"
placeholder="auto"
onChange={(event) => setPool(event.target.value)}
/>
)}
</Combobox>
</>
)}
Expand Down
Loading