Skip to content

Search 2.0 — complete GitHub-native search with clear/reset and real data #323

Description

@SayanthRock

Goal

Upgrade GitHub Rock Search into a complete, GitHub-native search experience using the existing authenticated GitHub API/repository architecture.

This is an overall Search improvement, not only a visual change.

Current audit

The current UnifiedSearchScreen already performs real GitHub searches through GitHubSearchRepository and GitHubRestApi.

Current capabilities:

  • Repositories
  • Owners/users
  • Topics derived from real repository topic data
  • All mode combining repositories + owners
  • Debounced search
  • Search history
  • Pagination / Load more
  • Clear icon in the text field

Current limitations:

  • Search scope is incomplete compared with the range of GitHub search resources.
  • Topics are derived from returned repository topics rather than being a first-class GitHub topic result.
  • Clear only resets the current query; the overall search state/history UX is not polished.
  • The screen is visually functional but not yet a premium GitHub Rock search experience.
  • Search is coupled to every text change, which can create unnecessary GitHub requests/rate-limit pressure.
  • Empty, loading, error, and pagination states need a clearer unified UX.
  • Legacy Material icon usage remains in this screen and should ultimately follow issue Replace all legacy Material icons with the new GitHub Rock icon system #302.

Required Search 2.0

Real GitHub data only

Use the existing authenticated GitHub API infrastructure. Do not mock results, hard-code repositories/users, generate fake counts, create a second Retrofit/API client, or create fake search toggles.

Every displayed result must originate from GitHub data.

Complete search scopes

Where supported by the existing API architecture, expose real GitHub search resources:

  • All
  • Repositories
  • Code
  • Issues
  • Pull requests
  • Users
  • Commits
  • Topics

Do not add a UI scope unless its underlying API request and result handling are actually implemented.

If GitHub/API permissions or endpoint limitations prevent a scope from being available, show a truthful unavailable/permission state instead of fake results.

Search behavior

  • Keep a single canonical query state.
  • Trim/normalize the query.
  • Avoid unnecessary requests while the user is still typing.
  • Cancel obsolete requests safely.
  • Do not let an older response overwrite a newer query.
  • Preserve pagination per active search scope.
  • Handle GitHub rate limits and network failures clearly.
  • Do not search for empty/one-character queries unless the API explicitly supports it.

Clear Search

Provide a prominent, accessible Clear action whenever a query exists.

Clear must:

  • immediately clear the text
  • cancel the active search
  • clear displayed results
  • reset pagination/loading/error state
  • return to the recent-search/empty-search state
  • not navigate away
  • not require reopening Search

Add a separate clearly labeled action for clearing search history if the existing preferences architecture supports it.

Do not confuse Clear search with Clear history.

Search history

Reuse the existing preferences/history architecture:

  • recent searches when query is empty
  • one-tap reuse
  • clear history action
  • duplicate suppression
  • normalized values
  • predictable ordering
  • no sensitive data logging

Results UI

Create a polished native Compose result experience consistent with GitHub Rock:

  • dark-first charcoal surfaces
  • strong light-mode support
  • rounded 20–28dp surfaces
  • subtle borders
  • no excessive gradients
  • clear GitHub-native hierarchy
  • compact metadata
  • readable descriptions
  • avatars where available
  • repository language/stars/forks when supplied by GitHub
  • issue/PR state where supplied
  • commit SHA/message/author/date where supplied
  • code path/repository context where supplied
  • topic chips where supplied

Every result must have a meaningful click action when the corresponding destination exists.

All-results presentation

For All, present heterogeneous results as clearly separated sections/cards rather than pretending every resource is a repository.

Only render sections with actual results.

Empty/loading/error states

Use distinct states:

  • Initial empty search
  • Recent searches
  • Searching
  • Results
  • No results
  • Rate limited
  • Authentication required
  • Permission denied
  • Network unavailable
  • Generic GitHub/API error
  • Loading more

Provide useful retry behavior where applicable.

Pagination

Use GitHub pagination metadata/results rather than assuming items.size == perPage when a more reliable API signal is available.

Prevent duplicate rows when loading additional pages.

Reset pagination whenever query changes, search scope changes, search is cleared, or a new search is submitted.

Architecture

Reuse:

  • existing GitHubRestApi
  • existing GitHubSearchRepository
  • existing authentication/session state
  • existing preferences
  • existing navigation
  • existing GitHub models where compatible

Do not introduce duplicate networking infrastructure.

Accessibility and interaction

  • Clear content descriptions for search, back, clear, retry and result actions.
  • IME Search action works.
  • Touch targets meet Android accessibility expectations.
  • Keyboard/focus behavior is predictable.
  • Screen-reader users can understand result type and metadata.
  • Respect reduced-motion preferences.
  • Do not interfere with the existing navigation-bar press/hold slide interaction.

Visual interaction

Use GitHub Rock motion conventions:

  • fast/quick feedback
  • restrained transitions
  • no bounce
  • no unnecessary full-screen animation

Icon system

Follow issue #302 and migrate this screen away from legacy androidx.compose.material.icons when implementing the change. Use the centralized GitHub Rock icon system.

Verification

Follow:

Audit → root cause → Fix → Build/Test → Verify → Commit → CI → Next issue

Verify real repository/user/topic search, every implemented scope, Clear Search, Clear history, history reuse, empty results, network/API failures, pagination, rapid query changes, scope switching, authentication/guest behavior, dark/light mode, accessibility, and existing navigation/repository-opening behavior.

Do not claim completion without an exact commit SHA and CI/build evidence.

Acceptance criteria

Search is complete when GitHub Rock provides a fast, native, real-data GitHub search experience with clear/reset behavior, useful history, truthful search scopes, robust states, pagination, accessible results, and no duplicate API architecture or fake data.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions