Skip to content

EDM-4153: Improve layout of Repository select dropdown#692

Open
celdrake wants to merge 1 commit into
flightctl:mainfrom
celdrake:EDM-4153-fix-repo-dropdown-layout
Open

EDM-4153: Improve layout of Repository select dropdown#692
celdrake wants to merge 1 commit into
flightctl:mainfrom
celdrake:EDM-4153-fix-repo-dropdown-layout

Conversation

@celdrake

@celdrake celdrake commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

The layout looks better now, with proper spacing between the selection mark and the additional content.

Removed validateRepoSelection as we had made changes to the RepositoryForm to enable only creating valid repositories (for example, only writable OCI registries).

repo-layout

Updated shared UI components in libs/ui-components/ to improve the Repository select dropdown layout and simplify repository selection behavior.

  • libs/ui-components/src/components/form/FormSelect.css: adjusted menu item layout and positioned the PatternFly select checkmark absolutely so it no longer overlaps option content.
  • libs/ui-components/src/components/form/RepositorySelect.tsx: removed validateRepoSelection support and related validation/error-item generation; repository creation/selection now directly commits the selected/created repo value.
  • libs/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/OutputImageStep.tsx: removed the step’s writableRepoValidation callback and replaced it with updated helper text indicating only OCI-compliant registries are supported.

Cross-cutting impact:

  • Because RepositorySelect is a shared component, this affects both apps/standalone/ and apps/ocp-plugin/ where the dropdown is used.
  • libs/i18n/locales/en/translation.json: updated strings to align with the new helper text and other copied text changes.
  • eslint.config.js: updated lint rule guidance for PatternFly Modal imports (to use the app’s modal wrapper).

No changes were made to the Go auth proxy, container/packaging, CI/workflows, or Cypress/E2E tests.

@coderabbitai

coderabbitai Bot commented Jun 11, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

This PR removes repository writability validation from the image build wizard and repository selector, and updates repository option rendering plus menu icon alignment styling.

Changes

Repository Selection Updates

Layer / File(s) Summary
Remove repository validation flow
libs/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/OutputImageStep.tsx, libs/ui-components/src/components/form/RepositorySelect.tsx
OutputImageStep removes the writable repository validation callback and its RepositorySelect prop. RepositorySelect removes the validateRepoSelection prop and parameter, no longer sets field errors during repository creation, and always stores the created repository value.
Refactor repository option layout
libs/ui-components/src/components/form/RepositorySelect.tsx, libs/ui-components/src/components/form/FormSelect.css
RepositorySelect switches to Grid and Content helpers, rebuilds repository labels with Grid/Stack/Content, and simplifies read-only option rendering. FormSelect.css adds menu item end padding and vertically centered select-icon positioning.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

  • flightctl/flightctl-ui#702: Updates repository selection configuration in the same image-build flow, touching adjacent behavior around repository picker usage.

Suggested labels

ui-components

Suggested reviewers

  • jkilzi

Poem

Validation stepped aside with a quiet sigh,
Grid and Stack arranged the repos nigh.
Icons now hover neatly in place,
A tidier menu with a cleaner grace.

🚥 Pre-merge checks | ✅ 14 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Generated-Files-Not-Hand-Edited ⚠️ Warning PR directly modifies libs/i18n/locales/en/translation.json, a generated i18next-parser file, so it should be regenerated instead of hand-edited. Re-run npm run i18n to regenerate translation.json (and commit the generated output), or revert manual edits to that file.
✅ Passed checks (14 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: improving the Repository select dropdown layout.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
No-Hardcoded-Secrets ✅ Passed Scanned the touched files; no API keys, tokens, passwords, private keys, embedded credentials, or long base64 literals were present.
No-Weak-Crypto ✅ Passed Touched files only adjust repository dropdown layout/validation; no weak crypto, custom crypto, or secret/token comparisons appear in the diff.
No-Injection-Vectors ✅ Passed No eval/exec, dangerouslySetInnerHTML, os.system, or yaml.load sinks appear in the touched TSX/CSS; repository data is rendered as React nodes and plain values.
Container-Privileges ✅ Passed Only UI TSX/CSS files were changed; no container/K8s manifests or privileged settings are present to flag.
No-Sensitive-Data-In-Logs ✅ Passed The touched files add layout/validation changes only; no console/logger calls or sensitive-data output paths were introduced.
Resource-Leaks ✅ Passed PR only changes TS/CSS UI files; no Go files under proxy/ are modified, so the resource-leak check is not applicable.
Unchecked-Errors ✅ Passed The PR only touches UI TS/CSS files; the unchecked-error patterns I found are in existing proxy Go files and are not part of this change.
Ai-Attribution ✅ Passed PASS: The PR commit includes a supported AI attribution trailer, Made-with: Cursor, and no Co-Authored-By AI trailer was found.
I18n-Compliance ✅ Passed Changed .tsx files keep all user-visible literals wrapped in t(); no dynamic t() keys were found in the modified components.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 Stylelint (17.13.0)
libs/ui-components/src/components/form/FormSelect.css

Error: ENOENT: no such file or directory, open '/.stylelintrc.json'
at async open (node:internal/fs/promises:640:25)
at async Object.readFile (node:internal/fs/promises:1287:14)
at async #readConfiguration (/usr/local/lib/node_modules/stylelint/node_modules/cosmiconfig/dist/Explorer.js:83:26)
at async load (/usr/local/lib/node_modules/stylelint/node_modules/cosmiconfig/dist/Explorer.js:20:48)
at async Explorer.load (/usr/local/lib/node_modules/stylelint/node_modules/cosmiconfig/dist/Explorer.js:23:20)
at async getConfigForFile (file:///usr/local/lib/node_modules/stylelint/lib/getConfigForFile.mjs:72:5)
at async resolveOptionValue (file:///usr/local/lib/node_modules/stylelint/lib/utils/resolveOptionValue.mjs:27:24)
at async standalone (file:///usr/local/lib/node_modules/stylelint/lib/standalone.mjs:127:22)


Comment @coderabbitai help to get the list of available commands.

@jkilzi jkilzi left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Good layout overhaul. The Grid + selectedLabel pattern is a clear improvement over the old Flex-in-description approach.

validateRepoSelection removal: safe to drop — writeAccessOnly: true already filters the list so read-only repos never appear. The client-side double-check was redundant. The handleCreateRepository path is also clean since the create modal enforces write access.

Nit — CSS comment: the .pf-v6-c-menu__item-select-icon absolute-position override is correct but fragile against PatternFly version bumps. Add a short comment explaining the intent, e.g. /* PF v6 checkmark overflows the Grid layout without this — position it absolutely so it doesn't affect column widths */.

Watch — merge ordering: this PR, #698, and #702 all touch RepositorySelect.tsx and/or ConfigWithRepositoryTemplateForm.tsx. Recommended merge order: this PR first (biggest refactor), then #698, then #702 — each subsequent branch just needs a rebase to pick up the prior changes.

@celdrake

Copy link
Copy Markdown
Collaborator Author

@jkilzi I rebased and fixed the conflicts with previous branches, PTAL when you can.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
libs/ui-components/src/components/form/RepositorySelect.tsx (1)

31-79: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Restore writable-only filtering for existing OCI repositories.

Line 41 now filters only by repo.spec.type, so options.writeAccessOnly no longer excludes previously created OCI repositories whose access mode is READ. OutputImageStep still uses this selector for an image push destination, and CreateRepository only forces READ_WRITE for newly created repos, so this change regresses existing read-only repositories from blocked to selectable.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@libs/ui-components/src/components/form/RepositorySelect.tsx` around lines 31
- 79, The repository selector in getRepositoryItems no longer respects
writable-only filtering, so existing OCI repositories with READ access can still
appear selectable. Update the filtering logic used by RepositorySelect to keep
excluding read-only OCI repos when options.writeAccessOnly is enabled, while
still allowing newly created READ_WRITE repos from CreateRepository; make sure
OutputImageStep continues to receive only valid push destinations.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@libs/ui-components/src/components/form/RepositorySelect.tsx`:
- Around line 31-79: The repository selector in getRepositoryItems no longer
respects writable-only filtering, so existing OCI repositories with READ access
can still appear selectable. Update the filtering logic used by RepositorySelect
to keep excluding read-only OCI repos when options.writeAccessOnly is enabled,
while still allowing newly created READ_WRITE repos from CreateRepository; make
sure OutputImageStep continues to receive only valid push destinations.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 2b4d2e6b-5785-46d6-b55e-2c9bc1b75d65

📥 Commits

Reviewing files that changed from the base of the PR and between f49488c and 2a8c12c.

⛔ Files ignored due to path filters (1)
  • libs/i18n/locales/en/translation.json is excluded by !libs/i18n/locales/en/translation.json
📒 Files selected for processing (3)
  • libs/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/OutputImageStep.tsx
  • libs/ui-components/src/components/form/FormSelect.css
  • libs/ui-components/src/components/form/RepositorySelect.tsx

@celdrake celdrake force-pushed the EDM-4153-fix-repo-dropdown-layout branch from 2a8c12c to c4a7104 Compare June 29, 2026 09:17

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
libs/ui-components/src/components/form/RepositorySelect.tsx (1)

31-36: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

writeAccessOnly is no longer enforced for existing repository choices.

OutputImageStep still passes options={{ writeAccessOnly: true }}, but getRepositoryItems() now filters only on repo.spec.type and never classifies read-only OCI repos as invalid/disabled. After removing validateRepoSelection, that means the image build wizard can select an existing read-only registry and fail later on submit/push instead of being blocked here. Please thread writeAccessOnly into the item-building logic and keep non-writable repos out of validRepoItems (or render them disabled in invalidRepoItems).

Also applies to: 45-79, 104-117, 155-166

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@libs/ui-components/src/components/form/RepositorySelect.tsx` around lines 31
- 36, `getRepositoryItems` no longer respects `writeAccessOnly`, so read-only
OCI repositories can still appear as selectable existing choices in the image
build flow. Update the item-building logic in `RepositorySelect` to thread the
`writeAccessOnly` option through `getRepositoryItems` (and any helpers it uses)
so repositories with no write access are excluded from `validRepoItems` or moved
into `invalidRepoItems` as disabled entries. Make sure the existing
`OutputImageStep` usage of `options={{ writeAccessOnly: true }}` continues to
prevent selecting non-writable repos.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@libs/ui-components/src/components/form/RepositorySelect.tsx`:
- Around line 31-36: `getRepositoryItems` no longer respects `writeAccessOnly`,
so read-only OCI repositories can still appear as selectable existing choices in
the image build flow. Update the item-building logic in `RepositorySelect` to
thread the `writeAccessOnly` option through `getRepositoryItems` (and any
helpers it uses) so repositories with no write access are excluded from
`validRepoItems` or moved into `invalidRepoItems` as disabled entries. Make sure
the existing `OutputImageStep` usage of `options={{ writeAccessOnly: true }}`
continues to prevent selecting non-writable repos.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 015d4bb1-0514-4e86-a844-699483ae0ff9

📥 Commits

Reviewing files that changed from the base of the PR and between 2a8c12c and c4a7104.

⛔ Files ignored due to path filters (1)
  • libs/i18n/locales/en/translation.json is excluded by !libs/i18n/locales/en/translation.json
📒 Files selected for processing (3)
  • libs/ui-components/src/components/ImageBuilds/CreateImageBuildWizard/steps/OutputImageStep.tsx
  • libs/ui-components/src/components/form/FormSelect.css
  • libs/ui-components/src/components/form/RepositorySelect.tsx

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