fix(search): n'afficher qu'une seule barre de recherche quand le panneau s'ouvre#256
Conversation
The trigger button stayed visible while the open panel rendered its own input, leaving two stacked search fields. The trigger now turns into the live input on open and the dropdown shows only results.
📝 WalkthroughWalkthroughLe composant ChangesRefactorisation UI du GlobalSearch
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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.
Inline comments:
In `@apps/web/src/components/global-search.tsx`:
- Around line 150-153: The clear button currently only calls setQuery("") which
empties the input but doesn't close the panel; update the button's onClick
handler (the one that calls setQuery("")) to also invoke the same close behavior
used by the Escape key — i.e. call the component's close handler (e.g.
onClose(), closeSearchPanel(), setIsOpen(false) or whichever function is used to
close the search panel) so that clicking the "X" mirrors the Esc key and fully
closes the panel.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: ASSERTIVE
Plan: Pro
Run ID: af2f78a1-4799-4004-9403-fd81c6ad409e
📒 Files selected for processing (1)
apps/web/src/components/global-search.tsx
Summary
Bug : à l'ouverture de la recherche globale, deux champs s'affichaient — le bouton-déclencheur restait visible et le panneau ouvert rendait son propre
<Input>en dessous (cf. capture utilisateur).Fix : le bouton-déclencheur se transforme en
<Input>actif quandisOpen=true(au même emplacement, focus auto, mêmes raccourcis). Le panneau dropdown ne contient désormais que la liste de résultats.Test plan
Summary by CodeRabbit