Skip to content

Feat: Busca inteligente e Autocomplete de Skills no Discover#92

Merged
YnotMax merged 1 commit into
mainfrom
develop
Jul 1, 2026
Merged

Feat: Busca inteligente e Autocomplete de Skills no Discover#92
YnotMax merged 1 commit into
mainfrom
develop

Conversation

@YnotMax

@YnotMax YnotMax commented Jul 1, 2026

Copy link
Copy Markdown
Member

Título do PR:

Feat: Busca inteligente e Autocomplete de Skills no Discover

Descrição:

Qual é o objetivo deste PR?
Melhorar significativamente a experiência de busca e filtragem de perfis na aba Discover. Substituímos a lista fixa (que exibia apenas as 8 tags mais populares e ocupava muito espaço) por uma barra de busca dinâmica, permitindo que os usuários encontrem tecnologias de nicho.

Mudanças Principais:

  • Lógica de Extração de Tags: A função getPopularTags no seletor foi refatorada para retornar o "Top 3" de tags mais usadas e, simultaneamente, uma lista completa e alfabética de todas as skills únicas extraídas dos perfis carregados (campos loves e comfort).
  • Novo UI/UX (DiscoverFilters.tsx):
    • Quick Filters: Mantivemos as 3 skills mais populares como botões de acesso rápido.
    • Barra de Busca (Autocomplete): Adicionado um input de texto com dropdown interativo (mesma mecânica de UI do Onboarding) para pesquisar qualquer outra tecnologia. O dropdown filtra as sugestões em tempo real conforme a digitação.
    • Prevenção de Tela Vazia: Como a barra de busca só sugere tags que já existem nos perfis da memória, garantimos que o usuário nunca faça uma busca que retorne 0 resultados.

Testes Realizados:

  • O Top 3 é renderizado corretamente baseado na popularidade real.
  • A barra de busca filtra as tags ignorando letras maiúsculas/minúsculas.
  • O clique no dropdown aplica o filtro aos perfis imediatamente.
  • O botão de limpar filtro (tanto o botão rápido quanto o link de texto) reseta a seleção corretamente.

Summary by CodeRabbit

  • New Features

    • Added a new Skills filtering experience with quick-access top tags and a searchable tag dropdown.
    • Users can now search through all available tags, with animated dropdown results and an empty state when no matches are found.
  • Bug Fixes

    • Improved tag selection and clearing behavior, including closing the dropdown when clicking outside and resetting the search after selection.
    • Tag suggestions now reflect a broader set of profile data for more complete results.

@vercel

vercel Bot commented Jul 1, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
match-tech Ready Ready Preview, Comment Jul 1, 2026 1:59am

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

This PR replaces the single popularTags list used in Discover filters with two derived lists, topTags and allTags. The selector now aggregates tag counts from both loves and comfort fields. The filter component gains an autocomplete search dropdown with click-outside handling and clear-selection controls.

Changes

Skills Tag Filtering

Layer / File(s) Summary
Tag aggregation and ranking
src/features/discover/model/discover.selectors.ts
getPopularTags counts tags from loves and comfort, returning topTags (top 3 by count) and allTags (alphabetically sorted with pt-BR locale rules).
Hook exposure of tag lists
src/features/discover/hooks/useDiscoverFilters.ts
useDiscoverFilters destructures and returns topTags/allTags instead of the previous single popularTags value.
Filter component state and search logic
src/features/discover/components/DiscoverFilters.tsx
DiscoverFiltersProps updated to topTags/allTags; component adds search state, dropdown-open state, refs, memoized filtering, and click-outside effect.
Skills filter UI
src/features/discover/components/DiscoverFilters.tsx
Renders top-3 quick tag buttons, an animated autocomplete dropdown with an empty state, and clear-filter controls based on selection.

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant DiscoverFilters
  participant useDiscoverFilters
  participant getPopularTags

  User->>DiscoverFilters: open Discover page
  DiscoverFilters->>useDiscoverFilters: request filters
  useDiscoverFilters->>getPopularTags: compute tags from profiles
  getPopularTags-->>useDiscoverFilters: topTags, allTags
  useDiscoverFilters-->>DiscoverFilters: topTags, allTags

  User->>DiscoverFilters: type in skill search
  DiscoverFilters->>DiscoverFilters: filter allTags into visibleTags

  User->>DiscoverFilters: select tag from dropdown
  DiscoverFilters->>DiscoverFilters: close dropdown, apply selected tag
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

A rabbit hops through fields of skills,
Sorting tags with tiny thrills 🐇
Top three shown, the rest tucked in,
A dropdown search to help you win.
Click outside, and poof — it's clear,
Filter magic, right in here! ✨

🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the PR’s main change: smart skill search and autocomplete in Discover.
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.
✨ 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 develop

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@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.

Actionable comments posted: 3

🤖 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 `@src/features/discover/components/DiscoverFilters.tsx`:
- Around line 123-238: The autocomplete in DiscoverFilters should use basic
combobox semantics so assistive tech can understand the popup. Update the
input/search block to wire the dropdown with aria-expanded, aria-controls, and
an appropriate combobox-related role/state, and give the suggestions container a
listbox-style role tied to the input. Keep the existing tag selection behavior
in handleTagSelect, setIsTagDropdownOpen, and the dropdownRef logic, and also
add Escape-to-close handling for the tag search popup.
- Around line 149-176: The new autocomplete search UI in DiscoverFilters needs
accessible names for both controls: add a proper label/aria-label to the
skill-search input instead of relying on placeholder text, and give the
icon-only clear button an accessible label as well. Update the input and button
in DiscoverFilters so screen readers can identify their purpose, using the
existing Search and X controls as the reference points.

In `@src/features/discover/model/discover.selectors.ts`:
- Around line 9-28: The tag aggregation in getPopularTags currently treats
differently cased strings as separate values, which splits counts and breaks
selectedTag matching. Update the normalization logic used in this selector so
canvas.loves and canvas.comfort entries are converted to a canonical form before
counting and before building allTags/topTags, or ensure the canonical key is
used consistently across filtering. Keep the behavior localized in
getPopularTags and any related tag comparison helpers so React/react variants
resolve to the same tag.
🪄 Autofix (Beta)

❌ Autofix failed (check again to retry)

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: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: c3ccfb1c-a5fd-4fce-8768-64e4ce7def54

📥 Commits

Reviewing files that changed from the base of the PR and between 5edfaf3 and ce112ef.

📒 Files selected for processing (3)
  • src/features/discover/components/DiscoverFilters.tsx
  • src/features/discover/hooks/useDiscoverFilters.ts
  • src/features/discover/model/discover.selectors.ts

Comment thread src/features/discover/components/DiscoverFilters.tsx
Comment thread src/features/discover/components/DiscoverFilters.tsx
Comment thread src/features/discover/model/discover.selectors.ts
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

An unexpected error occurred while generating fixes: Repository rule violations found

Changes must be made through a pull request.

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 1 file(s) based on 1 unresolved review comment.

A stacked PR containing fixes has been created.

  • Stacked PR: #94
  • Files modified:
  • src/features/discover/model/discover.selectors.ts

Time taken: 3m 16s

@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 1 file(s) based on 1 unresolved review comment.

A stacked PR containing fixes has been created.

  • Stacked PR: #93
  • Files modified:
  • src/features/discover/model/discover.selectors.ts

Time taken: 2m 20s

@YnotMax
YnotMax merged commit 53e3941 into main Jul 1, 2026
5 checks passed
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Autofix skipped. No unresolved CodeRabbit review comments with fix instructions found.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant