Skip to content

fix(search): n'afficher qu'une seule barre de recherche quand le panneau s'ouvre#256

Merged
InstaZDLL merged 1 commit into
mainfrom
fix/global-search-double-input
May 4, 2026
Merged

fix(search): n'afficher qu'une seule barre de recherche quand le panneau s'ouvre#256
InstaZDLL merged 1 commit into
mainfrom
fix/global-search-double-input

Conversation

@InstaZDLL
Copy link
Copy Markdown
Owner

@InstaZDLL InstaZDLL commented May 4, 2026

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 quand isOpen=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

  • Cliquer sur la barre → un seul champ de recherche, focus immédiat
  • Ctrl+K → idem
  • Taper du texte → résultats s'affichent en dropdown sans champ redondant
  • Effacer via X / Esc → ferme correctement

Summary by CodeRabbit

  • Style
    • Amélioration de l'interface du composant de recherche globale avec un rendu optimisé des états ouvert et fermé, et une meilleure accessibilité des éléments d'action.

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.
@github-actions github-actions Bot added scope: frontend apps/web type: fix Bug fix size: m 50-200 lines labels May 4, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 4, 2026

📝 Walkthrough

Walkthrough

Le composant GlobalSearch a été refactorisé pour afficher conditionnellement soit un input de recherche avec bouton clear, soit un bouton déclencheur "Rechercher..." selon l'état isOpen. La structure du panneau de résultats reste inchangée.

Changes

Refactorisation UI du GlobalSearch

Layer / File(s) Summary
Structure de rendu conditionnelle
apps/web/src/components/global-search.tsx (139-175)
Le rendu du header passe d'un seul bouton avec styles variables à deux branches conditionnelles : une zone input stylisée avec bouton clear (X) quand isOpen est vrai, ou un bouton "Rechercher..." avec raccourci Ctrl+K quand isOpen est faux.
Panneau de résultats
apps/web/src/components/global-search.tsx (177-178)
Le conteneur des résultats et son comportement restent inchangés, ancré au même isOpen && conditionnel.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Suggested labels

type: fix, scope: frontend, size: xs

Poem

🔍 Un bouton devient deux chemins,
Ouvert et fermé, c'est plus malin,
Le X s'invite avec clarté,
Rechercher... juste à portée,
Interface fluide, enfin pansée ✨

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed Le titre décrit précisément le changement principal : remplacer l'affichage double de la barre de recherche par un seul champ lors de l'ouverture du panneau.
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.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/global-search-double-input

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

@InstaZDLL InstaZDLL self-assigned this May 4, 2026
@InstaZDLL InstaZDLL enabled auto-merge May 4, 2026 21:40
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

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

📥 Commits

Reviewing files that changed from the base of the PR and between 3c55d60 and ef8e662.

📒 Files selected for processing (1)
  • apps/web/src/components/global-search.tsx

Comment thread apps/web/src/components/global-search.tsx
@InstaZDLL InstaZDLL merged commit 430cf8d into main May 4, 2026
13 checks passed
@github-actions github-actions Bot locked and limited conversation to collaborators May 4, 2026
@InstaZDLL InstaZDLL deleted the fix/global-search-double-input branch May 4, 2026 21:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

scope: frontend apps/web size: m 50-200 lines type: fix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant