Skip to content

SearchPage sort dropdown uses native select instead of custom dropdown#1491

Open
shineetejol9 wants to merge 4 commits into
nisshchayarathi:mainfrom
shineetejol9:fix-searchpage-sort-dropdown
Open

SearchPage sort dropdown uses native select instead of custom dropdown#1491
shineetejol9 wants to merge 4 commits into
nisshchayarathi:mainfrom
shineetejol9:fix-searchpage-sort-dropdown

Conversation

@shineetejol9
Copy link
Copy Markdown

@shineetejol9 shineetejol9 commented May 30, 2026

Description

Replaced the native HTML select element used for repository sorting in SearchPage with the project's custom DropdownMenu component. This change improves UI consistency across the application and aligns the sorting control with the existing design system while preserving the existing sorting functionality.

Related Issue

Closes # 710

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • UI/UX improvement
  • Refactor
  • Tests

Screenshots

Add screenshots or recordings for UI changes. Write N/A if this pull request does not change the UI.

Testing

Describe the commands you ran and any manual verification performed.

  • Ran npm run lint
  • Ran npm run build
  • Ran npm run format
  • Ran git diff --check
  • Verified the changed behavior manually, or wrote N/A for documentation-only changes
  • Updated or added tests where appropriate, or wrote N/A with a reason

Checklist

  • My changes are focused on the linked issue
  • I have reviewed my own code
  • I have not introduced unrelated formatting or generated-file changes
  • Documentation is updated if needed

Summary by CodeRabbit

  • New Features

    • New sort dropdown on search results replacing the previous select control.
    • Repository analysis accepts a configurable timeout option.
  • Bug Fixes

    • Fixed breadcrumb rendering to ensure correct link/label structure.
  • Improvements

    • Updated dashboard loading skeleton and refined keyboard shortcut behavior for the repo URL input.
    • Removed shortcut hint from the repository scope input area.
  • Chores

    • Updated database datasource configuration and added a repository→cache relation.
    • Bumped Prisma-related package versions.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 30, 2026

@shineetejol9 is attempting to deploy a commit to the Nisshchaya's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions
Copy link
Copy Markdown

⚠️ GSSoC Quality Check Failed — PR #1491

Hi @shineetejol9! 👋 Your PR has been flagged by our automated GSSoC quality check.

Issues found:

  • 🔗 No linked issue — Every PR must be linked to an open issue. Add closes #<issue-number> or fixes #<issue-number> in your description so maintainers know what this PR resolves.

✅ How to fix this

  1. Read the issues listed above carefully
  2. Edit your PR title and description to address them
  3. Make sure your PR is linked to an open issue using closes #<issue-number>
  4. Make sure your changes are meaningful and solve a real problem

Once you've fixed these, a maintainer will review and remove the flag. If you believe this is a mistake, please comment below. 🙏

GSSoC'26 automation · Maintainer: @nisshchayarathi

@github-actions github-actions Bot added the gssoc:invalid GSSoC: Invalid contribution label May 30, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 30, 2026

Review Change Stack

📝 Walkthrough

Walkthrough

This PR adds an optional analysis timeout and reuses earlier language detection in repository analysis, updates Prisma datasource/model and package versions, fixes Breadcrumbs JSX, revises Dashboard keyboard focus and loading skeletons, and replaces the SearchPage sort select with a DropdownMenu.

Changes

Analysis Service & Dashboard Improvements

Layer / File(s) Summary
Repository Service Timeout and Language Detection
lib/services/repositoryService.ts
analyzeRepository accepts timeoutMs to configure the AbortController; language detection is performed earlier and its result reused, removing a redundant later detection call.
Prisma Schema and Package Configuration
package.json, prisma/schema.prisma
@prisma/client and prisma versions changed; datasource uses env("DATABASE_URL"); Repository gains geminiAnalysisCaches GeminiAnalysisCache[]; dependency entries reordered.
Dashboard Keyboard Shortcuts and Loading Skeletons
src/pages/Dashboard.tsx
Adds useRef + searchRef, wires ref to the input, reworks global / keydown handling, converts Skeleton sizing to Tailwind classes, removes ShortcutHint and scope Enter key handler.
Breadcrumbs JSX Markup Correction
src/components/layout/Breadcrumbs.tsx
Fixes conditional JSX so active/last items render as a <span> and inactive/non-last items render as a Next.js <Link>.
SearchPage Sort Dropdown
src/pages/SearchPage.tsx
Replaces sort <select> with a DropdownMenu and items that set sortBy to recent, stars, or name.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly Related PRs

Suggested Labels

ui, level:intermediate

Poem

🐰 I hopped through code with timeout in hand,
Languages found and reused as planned,
Breadcrumbs tidy, Dashboard swift to focus,
Dropdowns settle sorting hocus-pocus,
a happy rabbit hops off to nap

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Title check ⚠️ Warning The PR title states the native select was replaced with a custom dropdown, but the actual change is the opposite—a native select was replaced with DropdownMenu components. Update the title to accurately reflect the change: 'Replace native select with custom DropdownMenu in SearchPage sort' or similar.
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 (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
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.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
⚔️ Resolve merge conflicts
  • Resolve merge conflict in branch fix-searchpage-sort-dropdown

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

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.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
lib/services/repositoryService.ts (1)

429-429: ⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Preserve opts.scope when detecting languages.

getFileTree still scopes to opts?.scope, but detectLanguages now always scopes to repository.targetDirectory. Scoped analyses can therefore persist files for one subtree and language percentages for another.

Suggested fix
       const [contributors, languages] = await Promise.all([
         gitService.getContributors(),
         gitService.detectLanguages({
-          targetDirectory: repository.targetDirectory ?? null,
+          targetDirectory: opts?.scope ?? repository.targetDirectory ?? null,
         }),
       ]);

Also applies to: 474-478

🤖 Prompt for 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.

In `@lib/services/repositoryService.ts` at line 429, The language detection now
ignores the requested scope: ensure detectLanguages is called with the same
scope used for gitService.getFileTree by passing opts?.scope (or a scoped path
variable derived from it) instead of unconditionally using
repository.targetDirectory; update the calls to detectLanguages (the one at the
shown getFileTree usage and the other occurrence around the later block) to
accept and use opts?.scope so file persistence and language percentages remain
consistent with the scoped analysis.
🤖 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.

Outside diff comments:
In `@lib/services/repositoryService.ts`:
- Line 429: The language detection now ignores the requested scope: ensure
detectLanguages is called with the same scope used for gitService.getFileTree by
passing opts?.scope (or a scoped path variable derived from it) instead of
unconditionally using repository.targetDirectory; update the calls to
detectLanguages (the one at the shown getFileTree usage and the other occurrence
around the later block) to accept and use opts?.scope so file persistence and
language percentages remain consistent with the scoped analysis.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7b731244-c0a9-493a-9d3b-034e466e9ed3

📥 Commits

Reviewing files that changed from the base of the PR and between 61f7830 and c09aac0.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (5)
  • lib/services/repositoryService.ts
  • package.json
  • prisma/schema.prisma
  • src/components/layout/Breadcrumbs.tsx
  • src/pages/Dashboard.tsx

@shineetejol9 shineetejol9 changed the title SearchPage sort dropdown uses native select instead of custom dropdown #710 SearchPage sort dropdown uses native select instead of custom dropdown May 30, 2026
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 `@src/pages/SearchPage.tsx`:
- Around line 163-169: The sort trigger Button in SearchPage.tsx currently only
shows the selected value via the sortBy state; update the Button (the Button
element rendering the sort trigger) to include an explicit label for
accessibility by adding a descriptive aria-label (e.g., aria-label={`Sort
results by ${sortBy}`} or a visible label element tied to the control) so screen
readers understand the control purpose while preserving the existing displayed
value; ensure the label updates with sortBy and does not alter Button styling or
behavior.
🪄 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: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f75aafe7-a84f-4a0c-9b64-5c9c4c4b63d9

📥 Commits

Reviewing files that changed from the base of the PR and between c09aac0 and 9a3573a.

📒 Files selected for processing (1)
  • src/pages/SearchPage.tsx

Comment thread src/pages/SearchPage.tsx Outdated
Comment on lines +163 to +169
<Button variant="outline" size="sm">
{sortBy === "recent"
? "Recent"
: sortBy === "stars"
? "Most Stars"
: "Name"}
</Button>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Make the sort trigger explicitly labeled for accessibility.

On Line 163, the button text only reflects the selected value; it doesn’t clearly expose the control purpose (sort) to all users. Add an explicit label (visual or aria-label) so the trigger is self-descriptive.

Suggested patch
-    <Button variant="outline" size="sm">
-      {sortBy === "recent"
-        ? "Recent"
-        : sortBy === "stars"
-        ? "Most Stars"
-        : "Name"}
+    <Button
+      variant="outline"
+      size="sm"
+      aria-label="Sort repositories"
+    >
+      Sort:{" "}
+      {sortBy === "recent"
+        ? "Recent"
+        : sortBy === "stars"
+        ? "Most Stars"
+        : "Name"}
     </Button>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<Button variant="outline" size="sm">
{sortBy === "recent"
? "Recent"
: sortBy === "stars"
? "Most Stars"
: "Name"}
</Button>
<Button
variant="outline"
size="sm"
aria-label="Sort repositories"
>
Sort:{" "}
{sortBy === "recent"
? "Recent"
: sortBy === "stars"
? "Most Stars"
: "Name"}
</Button>
🤖 Prompt for 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.

In `@src/pages/SearchPage.tsx` around lines 163 - 169, The sort trigger Button in
SearchPage.tsx currently only shows the selected value via the sortBy state;
update the Button (the Button element rendering the sort trigger) to include an
explicit label for accessibility by adding a descriptive aria-label (e.g.,
aria-label={`Sort results by ${sortBy}`} or a visible label element tied to the
control) so screen readers understand the control purpose while preserving the
existing displayed value; ensure the label updates with sortBy and does not
alter Button styling or behavior.

@Karanjot786
Copy link
Copy Markdown

Hey @shineetejol9! Saw your work on GSSoC 2026.

We are building TermUI, a TypeScript terminal UI framework with React-style hooks and JSX, rendered entirely in the terminal.

We have 67 unassigned GSSoC issues open. 19 are marked good first issue. Your TypeScript background transfers directly.

Karanjot, TermUI maintainer

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

Labels

gssoc:invalid GSSoC: Invalid contribution

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants