Skip to content

fix: display of repositories in search modals (CM-1006)#1718

Merged
joanagmaia merged 3 commits intomainfrom
fix/repos-urls-filters
Mar 3, 2026
Merged

fix: display of repositories in search modals (CM-1006)#1718
joanagmaia merged 3 commits intomainfrom
fix/repos-urls-filters

Conversation

@joanagmaia
Copy link
Collaborator

This pull request refactors how repository names are displayed in the search results component to provide more user-friendly and consistent naming, especially across different repository hosting platforms. The main change is the introduction of the normalizeRepoName utility, which standardizes repository name formatting based on the repository URL. Additionally, the component now uses a computed property to transform repository data before rendering.

Repository display improvements:

  • Added a normalizeRepoName utility function in helper.ts to format repository names based on their URL, showing owner/repo for GitHub, GitLab, and similar hosts, and the full path for others; falls back to the original name if parsing fails.
  • Updated search-result.vue to use a computed repositories property that maps and normalizes repository names before rendering, ensuring consistent display in all relevant sections.
  • Replaced all usages of props.repositories in template conditions and loops with the new repositories computed property for clarity and correctness. [1] [2]

Code organization:

  • Imported the new normalizeRepoName utility in search-result.vue to enable repository name normalization.

Issues vs fixes examples

Global Search

Issue:
Screenshot 2026-03-02 at 15 30 46
Fix:
Screenshot 2026-03-02 at 15 30 57

Project Search

Issue:
Screenshot 2026-03-02 at 15 29 27
Fix:
Screenshot 2026-03-02 at 15 29 40

Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
Copy link
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

This PR improves how repository names are displayed in the search modal results by normalizing names derived from repository URLs, aiming for a consistent, user-friendly owner/repo-style display across hosting platforms.

Changes:

  • Updated normalizeRepoName to use URL hostname/path rules to produce consistent repo display names.
  • Updated the search results component to render repositories from a computed, transformed list rather than using props.repositories directly.

Reviewed changes

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

File Description
frontend/app/components/shared/utils/helper.ts Refines repository name normalization logic based on URL hostname/path parsing.
frontend/app/components/shared/layout/search/search-result.vue Introduces a computed repositories list to normalize repo names before rendering and updates template conditions/loops to use it.

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

Signed-off-by: Joana Maia <jmaia@contractor.linuxfoundation.org>
@joanagmaia joanagmaia merged commit 3f74447 into main Mar 3, 2026
9 checks passed
@joanagmaia joanagmaia deleted the fix/repos-urls-filters branch March 3, 2026 10:42
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.

3 participants