Skip to content

feat(library): allow opening options panel from search bar#1489

Open
zeedif wants to merge 2 commits into
utkarshdalal:masterfrom
zeedif:feature/search-options-shortcut
Open

feat(library): allow opening options panel from search bar#1489
zeedif wants to merge 2 commits into
utkarshdalal:masterfrom
zeedif:feature/search-options-shortcut

Conversation

@zeedif

@zeedif zeedif commented May 29, 2026

Copy link
Copy Markdown
Contributor

This pull request introduces a shortcut to access the library options and filters panel directly from the active search bar interface.

Why is this needed?

Previously, if a user had a restrictive filter active (such as "Installed" games) and searched for an uninstalled title, they had to exit the search bar, open the options panel, modify or clear the filter, re-trigger the search, and re-type their query.

Adding an options button directly inside the search bar input simplifies this process, allowing users to adjust active filters or sorting criteria on the fly without losing their current search context.

What changed?

  • LibrarySearchBar.kt: Added an onOptionsClick callback parameter to LibrarySearchBar and SearchBarInput. Integrated an icon button (Icons.Default.Tune) next to the clear button to trigger this action.
  • LibraryScreen.kt: Wired the new callback within LibraryScreenContent to toggle the options panel visibility (onOptionsPanelToggle(true)).
  • Previews: Updated preview parameters to support the modified signatures.

Note: Since this addresses an internal issue, the specific tracker ID is not referenced. This implementation was prepared with the assistance of an AI tool.

Recording

Grabacion.2026-05-30.093818.mp4
Grabacion.2026-05-30.124142.mp4

Type of Change

  • Bug fix
  • Performance / stability improvement
  • Compatibility improvements
  • Other (Usability enhancement)

Checklist

  • If I have access to #code-changes, I have discussed this change there and it has been green-lighted. If I do not have access, I have still provided clear context in this PR. If I skip both, I accept that this change may face delays in review, may not be reviewed at all, or may be closed.
  • This change aligns with the current project scope (core functionality, stability, or performance). If not, it has been explicitly approved beforehand.
  • I have attached a recording of the change.
  • I have read and agree to the contribution guidelines in CONTRIBUTING.md.

Summary by CodeRabbit

  • New Features
    • The library search bar now shows a persistent options (tune) button; tapping it opens the options panel from the search overlay.
    • The search input UI was streamlined: the options control is always visible (replacing the previous clear/X control), improving access to search options.

- Expose an onOptionsClick callback from LibrarySearchBar.
- Add a "Tune" icon button in the search bar input area.
- Allow users to adjust filters and sorting without canceling their active search.
@zeedif zeedif requested a review from utkarshdalal as a code owner May 29, 2026 16:45
@coderabbitai

coderabbitai Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 07bd9572-0c78-4bf6-8b9f-9a699ce7eb97

📥 Commits

Reviewing files that changed from the base of the PR and between 96d978d and b08a90f.

📒 Files selected for processing (1)
  • app/src/main/java/app/gamenative/ui/screen/library/components/LibrarySearchBar.kt
💤 Files with no reviewable changes (1)
  • app/src/main/java/app/gamenative/ui/screen/library/components/LibrarySearchBar.kt

📝 Walkthrough

Walkthrough

The search bar replaces the clear (X) control with an always-visible Tune (options) button and threads a new onOptionsClick: () -> Unit callback from LibraryScreen through LibrarySearchBar into SearchBarInput; previews and imports are updated accordingly.

Changes

Search Options Button Feature

Layer / File(s) Summary
Callback contract and parameter threading
app/src/main/java/app/gamenative/ui/screen/library/components/LibrarySearchBar.kt
LibrarySearchBar and SearchBarInput signatures now include onOptionsClick: () -> Unit. Tune and TextOverflow imports are added, and the callback is passed from LibrarySearchBar to SearchBarInput.
Options button UI and styling
app/src/main/java/app/gamenative/ui/screen/library/components/LibrarySearchBar.kt
The conditional clear (X) button is replaced by an always-visible Tune icon button that invokes onOptionsClick(); a cursorColor assignment line is commented out.
Screen integration and preview updates
app/src/main/java/app/gamenative/ui/screen/library/LibraryScreen.kt, app/src/main/java/app/gamenative/ui/screen/library/components/LibrarySearchBar.kt
LibraryScreenContent wires onOptionsClick to onOptionsPanelToggle(true) at the call site. Both preview composables (Preview_LibrarySearchBar and Preview_LibrarySearchBar_Empty) are updated to supply the new callback.

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs:

  • utkarshdalal/GameNative#797: Modifies LibrarySearchBar/SearchBarInput interfaces (different callback additions) and may touch the same composable signatures.

🐰 A button for options fair,
Tune the search with thoughtful care,
Clear is gone, new paths appear,
Panel opens, loud and clear! 🎵

🚥 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 The title clearly and specifically describes the main change: adding a shortcut to open the options panel from the search bar.
Description check ✅ Passed The description covers required sections with clear context, motivation, technical changes, and recordings; however, one checkbox for 'I have attached a recording' is unchecked despite recordings being present in the description.
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

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 and usage tips.

@cubic-dev-ai cubic-dev-ai Bot left a comment

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.

No issues found across 2 files

Re-trigger cubic

@utkarshdalal

Copy link
Copy Markdown
Owner

Hey, recording please

@zeedif

zeedif commented May 30, 2026

Copy link
Copy Markdown
Contributor Author

Sure, I've already attached the recording in the PR description.

val textColor = MaterialTheme.colorScheme.onSurface
val hintColor = MaterialTheme.colorScheme.onSurfaceVariant.copy(alpha = 0.6f)
val cursorColor = MaterialTheme.colorScheme.primary
// val cursorColor = MaterialTheme.colorScheme.primary

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.

Just remove the line here if not used. We've got git history, so no need to comment out unused code :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Fixed in b08a90f

@phobos665

Copy link
Copy Markdown
Contributor

One suggestion, otherwise this looks pretty good!

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