1
0
mirror of synced 2025-12-19 18:14:56 -05:00

fix: improve dropdown visibility and remove configuration duplication

- Increase dropdown z-index to 99999 with !important to ensure visibility
- Add backdrop-filter: none and contain properties for solid background
- Remove duplicate 'configuration' header from SourceConfiguration component
- Move oneOf badge above combobox (shown once instead of twice)
- Restructure SourceConfiguration to show: oneOf badge → combobox → properties
- Eliminate visual duplication and improve layout clarity

Changes result in:
- Dropdown options now properly hide content behind them
- Configuration section appears only once in the UI
- Cleaner, more organized layout with oneOf badge at top
- Better visual flow: badge → selector → properties

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
This commit is contained in:
letiescanciano
2025-12-18 15:06:02 +01:00
parent 789a64e924
commit 34ac090a7a
2 changed files with 90 additions and 74 deletions

View File

@@ -106,85 +106,98 @@ export const SourceConfiguration = ({ endpointData }) => {
};
return (
<>
<Combobox
immediate
value={selectedSource}
onChange={handleSourceSelect}
onClose={() => setSearchQuery("")}
>
<div className={styles.comboboxWrapper}>
<ComboboxInput
id="source-combobox"
className={styles.input}
placeholder="Search sources..."
displayValue={(source) => source?.id ?? ""}
onChange={(event) => setSearchQuery(event.target.value)}
autoComplete="off"
/>
<ComboboxButton className={styles.dropdownButton}>
<svg
viewBox="0 0 20 20"
fill="currentColor"
data-slot="icon"
aria-hidden="true"
className="ugz uig"
>
<path
d="M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z"
clipRule="evenodd"
fillRule="evenodd"
></path>
</svg>
</ComboboxButton>
</div>
<ComboboxOptions className={styles.dropdown} anchor="bottom">
{filteredSources.length === 0 ? (
<div className={styles.noResults}>
{searchQuery
? `No sources found for "${searchQuery}"`
: "No sources available"}
</div>
) : (
filteredSources.map((source) => (
<ComboboxOption
key={source.id}
value={source}
className={({ active, selected }) =>
`${styles.option} ${active ? styles.active : ""} ${
selected ? styles.selected : ""
}`
}
>
<span className={styles.optionId}>{source.id}</span>
</ComboboxOption>
))
)}
</ComboboxOptions>
</Combobox>
{endpointData?.configurationSchema && (
<div style={{ marginTop: "1rem" }}>
{/* Header with oneOf badge inline */}
<div style={{ display: "flex", alignItems: "center", gap: "0.5rem", marginBottom: "0.75rem" }}>
<span className="openapi-schema__property" style={{ fontWeight: 600 }}>
configuration
</span>
<span className="openapi-schema__name">SourceConfiguration</span>
{endpointData.configurationSchema.oneOf && (
<>
{/* Show oneOf badge above combobox - only once */}
{endpointData.configurationSchema.oneOf && (
<div style={{ marginBottom: "0.75rem" }}>
<span className="badge badge--info" style={{ marginBottom: 0 }}>
oneOf
</span>
</div>
)}
{/* Combobox for source selection */}
<Combobox
immediate
value={selectedSource}
onChange={handleSourceSelect}
onClose={() => setSearchQuery("")}
>
<div className={styles.comboboxWrapper}>
<ComboboxInput
id="source-combobox"
className={styles.input}
placeholder="Search sources..."
displayValue={(source) => source?.id ?? ""}
onChange={(event) => setSearchQuery(event.target.value)}
autoComplete="off"
/>
<ComboboxButton className={styles.dropdownButton}>
<svg
viewBox="0 0 20 20"
fill="currentColor"
data-slot="icon"
aria-hidden="true"
className="ugz uig"
>
<path
d="M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z"
clipRule="evenodd"
fillRule="evenodd"
></path>
</svg>
</ComboboxButton>
</div>
<ComboboxOptions className={styles.dropdown} anchor="bottom">
{filteredSources.length === 0 ? (
<div className={styles.noResults}>
{searchQuery
? `No sources found for "${searchQuery}"`
: "No sources available"}
</div>
) : (
filteredSources.map((source) => (
<ComboboxOption
key={source.id}
value={source}
className={({ active, selected }) =>
`${styles.option} ${active ? styles.active : ""} ${
selected ? styles.selected : ""
}`
}
>
<span className={styles.optionId}>{source.id}</span>
</ComboboxOption>
))
)}
</ComboboxOptions>
</Combobox>
{/* Display configuration schema properties for selected source */}
<div style={{ marginTop: "1rem" }}>
{endpointData.configurationSchema.description && (
<p
style={{
fontSize: "0.9rem",
lineHeight: "1.4",
marginBottom: "0.5rem",
}}
>
{endpointData.configurationSchema.description}
</p>
)}
{/* Display required properties for selected source */}
{selectedSource && endpointData.configurationSchema.oneOf && (
<ConfigurationFields
selectedSourceId={selectedSource.id}
configSchema={endpointData.configurationSchema}
/>
)}
</div>
{/* Display required properties for selected source */}
{selectedSource && endpointData.configurationSchema.oneOf && (
<ConfigurationFields
selectedSourceId={selectedSource.id}
configSchema={endpointData.configurationSchema}
/>
)}
</div>
</>
)}
</>
);