Skip to content

fix(website): make reference selector label transparent only in placeholder state#6482

Open
Copilot wants to merge 5 commits into
mainfrom
copilot/fix-multi-ref-selector-bg
Open

fix(website): make reference selector label transparent only in placeholder state#6482
Copilot wants to merge 5 commits into
mainfrom
copilot/fix-multi-ref-selector-bg

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 21, 2026

Before:
Google Chrome 2026-05-22 15 50 52

After:
Google Chrome 2026-05-22 15 50 41

🚀 Preview: https://copilot-fix-multi-ref-sel.loculus.org

@corneliusroemer corneliusroemer added the preview Triggers a deployment to argocd label May 21, 2026
Copilot AI changed the title [WIP] Fix multi reference selector label background color fix(website): remove white placeholder label patch in reference selector fields May 21, 2026
Copilot AI requested a review from corneliusroemer May 21, 2026 11:02
@corneliusroemer corneliusroemer force-pushed the copilot/fix-multi-ref-selector-bg branch from cc71093 to 3f4dec8 Compare May 21, 2026 11:15
@corneliusroemer
Copy link
Copy Markdown
Contributor

@copilot as I said, don't use transparent on the label once it's moved up from placeholder position to above the text field as it needs to cover the outline. If possible, match the background color to the element behind - maybe it works to just not set your own background and it will be inherited? If that's not possible use white for that position.

The transparent background for placeholder position works well though.

Copy link
Copy Markdown
Contributor Author

Copilot AI commented May 21, 2026

@copilot as I said, don't use transparent on the label once it's moved up from placeholder position to above the text field as it needs to cover the outline. If possible, match the background color to...

Implemented in commit 5d30d4b: placeholder state remains transparent, and focused/floated label now explicitly uses opaque background (peer-focus:bg-white / dark equivalent) so it still covers the outline. Screenshot: https://github.com/user-attachments/assets/2a5200d2-f375-49be-8829-ab3d7208e94d

Copilot AI changed the title fix(website): remove white placeholder label patch in reference selector fields fix(website): make reference selector label transparent only in placeholder state May 21, 2026
Copilot AI and others added 5 commits May 22, 2026 15:33
…e selector fields

Agent-Logs-Url: https://github.com/loculus-project/loculus/sessions/33de4b38-0a73-4382-8eff-d9c0fe896295

Co-authored-by: corneliusroemer <25161793+corneliusroemer@users.noreply.github.com>
…ent container background

Agent-Logs-Url: https://github.com/loculus-project/loculus/sessions/80e0b6ea-a7d4-474b-aceb-05f7e1ffed43

Co-authored-by: corneliusroemer <25161793+corneliusroemer@users.noreply.github.com>
…ch single-line

Agent-Logs-Url: https://github.com/loculus-project/loculus/sessions/80e0b6ea-a7d4-474b-aceb-05f7e1ffed43

Co-authored-by: corneliusroemer <25161793+corneliusroemer@users.noreply.github.com>
@corneliusroemer corneliusroemer force-pushed the copilot/fix-multi-ref-selector-bg branch from 6ac0e9a to 6381b07 Compare May 22, 2026 13:33
@corneliusroemer
Copy link
Copy Markdown
Contributor

Tested and works

@corneliusroemer corneliusroemer marked this pull request as ready for review May 22, 2026 13:58
Copilot AI review requested due to automatic review settings May 22, 2026 13:58
Copy link
Copy Markdown
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

Updates the search-page TextField label styling so the label background can become transparent when the input is in its placeholder (empty) state, aligning the floating-label visuals with the intended design.

Changes:

  • Override Flowbite FloatingLabel label classes to use peer-placeholder-shown:!bg-transparent and !bg-inherit.
  • Adjust the multiline (textarea) label classes to use !bg-inherit and placeholder-shown transparency.
  • Add a unit test asserting the placeholder-related label classes are present.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
website/src/components/SearchPage/fields/TextField.tsx Adds/adjusts floating-label background utilities for both input (Flowbite) and textarea variants.
website/src/components/SearchPage/fields/TextField.spec.tsx Adds a test asserting label class utilities related to placeholder transparency.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

className={`absolute text-sm text-gray-500 dark:text-gray-400 pointer-events-none ${
isTransitionEnabled ? 'duration-300' : ''
} transform -translate-y-3 scale-75 top-1 z-10 origin-[0] bg-white dark:bg-gray-900 px-2 peer-focus:px-2 peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-1 peer-focus:scale-75 peer-focus:-translate-y-3 start-1 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto`}
} transform -translate-y-3 scale-75 top-1 z-10 origin-[0] !bg-inherit px-2 peer-focus:px-2 peer-focus:!bg-inherit peer-focus:text-blue-600 peer-focus:dark:text-blue-500 peer-placeholder-shown:!bg-transparent peer-placeholder-shown:scale-100 peer-placeholder-shown:-translate-y-1/2 peer-placeholder-shown:top-1/2 peer-focus:top-1 peer-focus:scale-75 peer-focus:-translate-y-3 start-1 rtl:peer-focus:translate-x-1/4 rtl:peer-focus:left-auto`}
Comment on lines +34 to +38
it('applies transparent background classes to label in placeholder state', () => {
render(<TextField label='Test Field' />);

const label = screen.getByText('Test Field');
expect(label).toHaveClass('peer-placeholder-shown:!bg-transparent');
expect(label).toHaveClass('peer-placeholder-shown:!bg-transparent');
expect(label).toHaveClass('!bg-inherit');
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

preview Triggers a deployment to argocd

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multi reference selector has grey background but label/placeholder still white

3 participants