Skip to content

Conversation

@jul-dan
Copy link
Contributor

@jul-dan jul-dan commented Dec 4, 2025

Summary

Issue: QOV-1240

Several fixes:

  • Fix the search field, today it is not clickable
  • Increase the dropdown to day it is too small
  • For helm raw yaml override, disable the built_in variables as it will fail in the deployment + add an indication to use an alias

Screenshots / Recordings

Before After
image image
image image

Testing

  • Changes tested locally in the relevant Console's pages and Storybooks
  • yarn test or yarn test -u (if you need to regenerate snapshots)
  • yarn format
  • yarn lint

PR Checklist

  • I followed naming, styling, and TypeScript rules (see .cursor/rules)
  • I performed a self-review (diff inspected, dead code removed)
  • I titled the PR using Conventional Commits with a scope when possible (e.g. feat(service): add new Terraform service) - required for semantic-release
  • I only kept necessary comments, written in English (watch for useless AI comments)
  • I involved a designer to validate UI changes if I am not a designer
  • I covered new business logic with tests (unit)
  • I confirmed CI is green (Codecov red can be accepted)
  • I reviewed and executed locally any AI-assisted code

@RemiBonnet
Copy link
Member

Qovery Preview

Qovery can create a Preview Environment for this PR.
To trigger its creation, please post a comment with one of the following command.

Command Blueprint environment
/qovery preview 28c47145-c8e7-4b9d-8d9e-c65c95b48425 staging
/qovery preview cc1de7de-94e5-40f8-8e45-bc8986d9dfec storybook
/qovery preview {all|UUID1,UUID2,...} To preview multiple environments

This comment has been generated from Qovery AI 🤖.
Below, a word from its wisdom :

There is no better time than now, better future does not exist

@jul-dan jul-dan changed the title Fixes/Improvements search magic wand for variables fix(variablesDropdown): Fixes/Improvements search magic wand for variables Dec 4, 2025
@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

❌ Patch coverage is 53.84615% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.25%. Comparing base (a635f0f) to head (d07776a).
⚠️ Report is 59 commits behind head on staging.

Files with missing lines Patch % Lines
...re/src/lib/dropdown-variable/dropdown-variable.tsx 50.00% 2 Missing and 3 partials ⚠️
.../lib/code-editor-variable/code-editor-variable.tsx 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##           staging    #2202      +/-   ##
===========================================
- Coverage    49.33%   49.25%   -0.09%     
===========================================
  Files         1182      708     -474     
  Lines        20179    15309    -4870     
  Branches      5982     4555    -1427     
===========================================
- Hits          9955     7540    -2415     
+ Misses        8279     6353    -1926     
+ Partials      1945     1416     -529     
Flag Coverage Δ
unittests 49.25% <53.84%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jul-dan jul-dan marked this pull request as ready for review December 5, 2025 07:51
<Popover.Content className="flex max-h-60 w-[248px] min-w-[248px] flex-col p-2">
{/*
<Popover.Content
container={container}
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure to understand why you need to pass down the container here?
Same goes for the other props

Copy link
Member

Choose a reason for hiding this comment

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

@jul-dan Please answer to the comment in your PR 🙏

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I asked Claude for explanation:

The container prop is used when DropdownVariable is rendered inside modals (see create-update-variable-modal.tsx:403 and values-override-yaml-modal.tsx:81). Without it, the popover renders to document.body which causes z-index issues where the dropdown appears behind the modal overlay.

The other props like side, align, etc. aren't passed from parents - they're positioning configuration defined within this component.

Julien Dan and others added 4 commits December 8, 2025 15:02
- Increase dropdown size to 400px width and 240px max-height for better visibility
- Fix search field clickability by adding modal container setup with useState/useEffect
- Use capture phase event handlers to prevent DropdownMenu interference
- Disable built-in variables in Helm value override with informative tooltip
- Position info icon 8px from variable name, horizontally aligned
- Add proper text truncation to prevent horizontal scrolling
- Enable mouse wheel scrolling with onWheel handler

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove projectId/serviceId props from values-override-yaml-setting
- Remove orphaned aliases/overrides handling from sort-variables
- These features should be handled on the backend per PR feedback

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Remove projectId/serviceId props from values-override-yaml-setting
- Remove orphaned aliases/overrides handling from sort-variables
- These features should be handled on the backend per PR feedback

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

Co-Authored-By: Claude <noreply@anthropic.com>
- Reduce event handlers from 10 to 3 essential ones (onKeyDown, onPointerDown, onClick)
- Remove unnecessary capture phase and touch event handlers
- Maintain same functionality with cleaner code

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

Co-Authored-By: Claude <noreply@anthropic.com>
@jul-dan jul-dan requested a review from rmnbrd December 17, 2025 17:30
@RemiBonnet
Copy link
Member

What's the status of this PR ? @jul-dan @rmnbrd
If not necessary we can close it

@jul-dan
Copy link
Contributor Author

jul-dan commented Jan 7, 2026

What's the status of this PR ? @jul-dan @rmnbrd If not necessary we can close it

I am still waiting for the review. It is necessary because the search is not working today.

Copy link
Member

@RemiBonnet RemiBonnet left a comment

Choose a reason for hiding this comment

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

Thanks @jul-dan !
Please take ownership of your PR, make sure to follow up if it's been waiting for too long, and reply directly on the PR so we keep a clear trace of the discussions 🙏

Here's my feedback:

  • I've found a simpler way to fix the scroll bug without using useEffect and adding too much code, available here

https://www.loom.com/share/683e0c27e7a64c6293268ff535a17583

  • Missing full variable name on hover:
    Your version
Screenshot 2026-01-07 at 09 34 19

Current version
Screenshot 2026-01-07 at 09 35 01

<Popover.Content className="flex max-h-60 w-[248px] min-w-[248px] flex-col p-2">
{/*
<Popover.Content
container={container}
Copy link
Member

Choose a reason for hiding this comment

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

@jul-dan Please answer to the comment in your PR 🙏

Julien Dan and others added 2 commits January 7, 2026 14:21
- Remove unused projectId prop from DropdownVariable and CodeEditorVariable
- Add tooltip to show full variable name on hover when truncated
- Replace useEffect pattern with fakeModal option to prevent scroll lock issues
- Remove container prop now that fakeModal handles portal positioning
- Add fakeModal: true to all variable modal calls for better UX

This fixes PR review feedback about AI-generated useEffect patterns
and improves the dropdown behavior when used inside modals.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Remove unused projectId prop from DropdownVariable and CodeEditorVariable
- Add tooltip to show full variable name on hover when truncated
- Replace useEffect pattern with fakeModal option to prevent scroll lock issues
- Remove container prop now that fakeModal handles portal positioning
- Add fakeModal: true to all variable modal calls for better UX

This fixes PR review feedback about AI-generated useEffect patterns
and improves the dropdown behavior when used inside modals.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@jul-dan jul-dan requested a review from RemiBonnet January 7, 2026 14:04
@jul-dan
Copy link
Contributor Author

jul-dan commented Jan 7, 2026

Thanks @RemiBonnet I have reviewed all your comments :)

</div>
<div className="overflow-y-auto">
<DropdownMenu.Label asChild>
<div
Copy link
Member

Choose a reason for hiding this comment

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

I don't think it’s necessary to change it, we can keep what we had before it already works
The issue was caused by the missing fakeModal

Keep only your logic with isBuiltIn etc not the DOM changes

<Truncate text={variable.service_name} truncateLimit={30} />
<div className="flex w-full min-w-0 items-center gap-2">
<Tooltip content={variable.key} side="bottom">
<span className="min-w-0 max-w-full overflow-hidden text-ellipsis whitespace-nowrap text-sm font-medium">
Copy link
Member

Choose a reason for hiding this comment

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

Missing the <Truncate /> composant, this is what I've say in the review before

Copy link
Contributor Author

@jul-dan jul-dan Jan 7, 2026

Choose a reason for hiding this comment

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

I did not see any comment on this file 🤔 Or your mean the previous comment? Anyway I have updated it !

Copy link
Member

Choose a reason for hiding this comment

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

Screenshot 2026-01-07 at 18 02 45

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have added the full variable name on hover

- Revert unnecessary DOM positioning props (side, align, sideOffset, etc.)
- Use Truncate component instead of CSS truncation + Tooltip for variable name
- Keep simple Popover.Content structure with 400px width (user requested)
- Retain isBuiltIn logic and disableBuiltInVariables functionality
- Keep fakeModal option for proper modal behavior

This addresses PR review comments requesting simpler DOM structure
and Truncate component usage while maintaining the new isBuiltIn
feature functionality and improved dropdown width.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@jul-dan jul-dan requested a review from RemiBonnet January 7, 2026 16:38
Copy link
Member

@RemiBonnet RemiBonnet left a comment

Choose a reason for hiding this comment

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

We've some space at the right I think you can increase the truncateLimit
Screenshot 2026-01-07 at 18 07 09

- Revert unnecessary DOM positioning props (side, align, sideOffset, etc.)
- Use Truncate component instead of CSS truncation + Tooltip for variable name
- Keep simple Popover.Content structure with 400px width (user requested)
- Retain isBuiltIn logic and disableBuiltInVariables functionality
- Keep fakeModal option for proper modal behavior

This addresses PR review comments requesting simpler DOM structure
and Truncate component usage while maintaining the new isBuiltIn
feature functionality and improved dropdown width.

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@jul-dan jul-dan force-pushed the fix/search_magic_wand_for_variables branch from f853901 to 6642d7b Compare January 8, 2026 09:37
@jul-dan jul-dan requested a review from RemiBonnet January 8, 2026 09:40
Copy link
Member

@RemiBonnet RemiBonnet left a comment

Choose a reason for hiding this comment

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

Last one, after it should be good !

…ad of custom class

Remove redundant 'cursor-not-allowed opacity-50' class as it's already handled
by dropdownMenuItemVariants when passing disabled: isDisabled
@jul-dan jul-dan requested a review from RemiBonnet January 8, 2026 13:28
@RemiBonnet RemiBonnet changed the title fix(variablesDropdown): Fixes/Improvements search magic wand for variables fix(variables-dropdown): fixes/improvements search magic wand for variables Jan 8, 2026
@RemiBonnet RemiBonnet enabled auto-merge (squash) January 8, 2026 13:49
@RemiBonnet RemiBonnet merged commit 7e821c2 into staging Jan 8, 2026
10 checks passed
@RemiBonnet RemiBonnet deleted the fix/search_magic_wand_for_variables branch January 8, 2026 14:33
@RemiBonnet
Copy link
Member

🎉 This PR is included in version 1.264.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants