Skip to content

Feat: hide search#103

Open
acharyarupak391 wants to merge 12 commits intoprem-k-r:mainfrom
acharyarupak391:feat-51/hide-search
Open

Feat: hide search#103
acharyarupak391 wants to merge 12 commits intoprem-k-r:mainfrom
acharyarupak391:feat-51/hide-search

Conversation

@acharyarupak391
Copy link

@acharyarupak391 acharyarupak391 commented Dec 12, 2025

📌 Description

Added a new setting item to hide the search section entirely(as requested on #51).
Enabling this will

  • hide the search bar and the search engine section
  • show the motivational element (unless it is hidden)
  • disable the "Hide Search Engines" setting

🎨 Visual Changes (Screenshots / Videos)

output_1440p.mp4

🔗 Related Issues

✅ Checklist

  • I have read and followed the Contributing Guidelines.
  • My code follows the project's coding style and conventions.
  • I have tested my changes thoroughly to ensure expected behavior.
  • I have verified compatibility across Chrome and Firefox (additional browsers if applicable).
  • I have attached relevant visual evidence (screenshots/videos) if applicable.
  • I have updated the CHANGELOG.md under the appropriate categories with all my changes in this PR.
  • New Features

    • Added a new "Hide Search" setting in Settings that hides the search bar and the "Search With" (search engines) section entirely. The preference is persisted to localStorage and applied on load.
  • Behavioral details

    • When "Hide Search" is enabled:
      • search bar, search-with container, shortcut switch, mic icon, and search suggestions controls are hidden/disabled.
      • the existing "Hide Search Engines" option is disabled/synchronized.
      • motivational quotes remain visible unless the separate "Motivational Quotes" setting is disabled.
    • Visibility is coordinated in scripts/search.js and scripts/quotes.js; an event listener updates UI state when the new checkbox changes.
  • UI / i18n / styling

    • index.html: added the new settings block (checkbox id hideSearchCheckbox) in the Search settings.
    • locales/en.js: added translation keys hideSearch and hideSearchInfo.
    • style.css: added .searchbar.hiddenByOption and a responsive rule to adjust small-screen behavior (<=500px) to preserve layout while hiding.
  • Changelog

    • CHANGELOG.md updated to note the new setting under Unreleased -> Added.
  • Notes / outstanding issues

    • PR is marked work-in-progress / changes-requested. Reviewer reported:
      • inactive hide mic option,
      • unchecked/inactive search suggestions option,
      • layout issue at screen widths ≤500px (weather pill moves up).
    • Contributor acknowledged the issues and intends to push fixes; visual evidence is attached in the PR and compatibility across Chrome/Firefox was tested.
  • Files touched (high level)

    • index.html, locales/en.js, scripts/search.js, scripts/quotes.js, style.css, CHANGELOG.md

@coderabbitai
Copy link

coderabbitai bot commented Dec 12, 2025

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a "Hide Search" setting and UI checkbox that hides the search bar and search engine sections, updates localization, stylesheet, and JavaScript to persist and apply the setting and to integrate its state with motivational-quote visibility logic.

Changes

Cohort / File(s) Summary
Changelog
CHANGELOG.md
Added Unreleased → Added entry documenting the new hide search setting.
HTML / UI
index.html
Inserted a "Hide Search" settings block with helper text and a hideSearchCheckbox input before the "Hide Microphone Icon" block.
Localization
locales/en.js
Added hideSearch and hideSearchInfo translation keys.
Search JS
scripts/search.js
Added handleSearchVisibility(isChecked), initialization from localStorage, and event wiring to persist and apply the hide-search preference; syncs related controls (search bar, search-with container, shortcut switch, mic, suggestions).
Quotes JS
scripts/quotes.js
Updated updateMotivationalQuotesState() and listeners to consider hideSearchCheckbox state when showing/hiding motivational quotes and the search-with container.
Styles
style.css
Added .searchbar.hiddenByOption rules (including responsive override for <=500px) to support toggling search bar visibility without breaking layout.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant UI as UI (Checkbox)
    participant Search as scripts/search.js
    participant Quotes as scripts/quotes.js
    participant Storage as localStorage

    User->>UI: Toggle hideSearchCheckbox
    UI->>Search: change event
    activate Search
    Search->>Storage: set hideSearch
    Search->>Search: handleSearchVisibility(isChecked)
    Search->>UI: show/hide search bar & search-with container
    Search->>UI: update shortcut switch / mic / suggestions
    deactivate Search

    UI->>Quotes: change event (or notify)
    activate Quotes
    Quotes->>Quotes: updateMotivationalQuotesState()
    Quotes->>UI: show/hide quotes and adjust search-with visibility
    deactivate Quotes
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested labels

ui/ux, i18n/l10n

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed Title 'Feat: hide search' directly and clearly summarizes the main feature addition: a new setting to hide the search functionality.
Description check ✅ Passed PR description covers all required template sections with clear explanation of changes, visual evidence, linked issue reference, and completed checklist items.
Linked Issues check ✅ Passed Code changes successfully implement the feature requested in issue #51: a UI control to hide the search box entirely, providing a cleaner interface for users who don't use the built-in search.
Out of Scope Changes check ✅ Passed All changes are scoped to the hide search feature implementation: UI elements, styling, localization, and state management for toggling search visibility.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.

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


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.

Copy link

@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: 4

Caution

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

⚠️ Outside diff range comments (1)
scripts/quotes.js (1)

288-339: Add null-guards for hideSearchCheckbox (and minor semicolon nit).

If the element isn’t present for any reason, hideSearchCheckbox.checked / .addEventListener will throw. Also Line 288 is missing a semicolon.

-    const hideSearchCheckbox = document.getElementById("hideSearchCheckbox")
+    const hideSearchCheckbox = document.getElementById("hideSearchCheckbox");
...
-        const isHideSearchChecked = hideSearchCheckbox.checked;
+        const isHideSearchChecked = !!hideSearchCheckbox?.checked;
...
-    hideSearchCheckbox.addEventListener("change", () => {
-        updateMotivationalQuotesState();
-    });
+    hideSearchCheckbox?.addEventListener("change", updateMotivationalQuotesState);
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 4a3ee0a and e160b69.

📒 Files selected for processing (5)
  • CHANGELOG.md (1 hunks)
  • index.html (1 hunks)
  • locales/en.js (1 hunks)
  • scripts/quotes.js (4 hunks)
  • scripts/search.js (1 hunks)
🧰 Additional context used
🪛 LanguageTool
CHANGELOG.md

[grammar] ~26-~26: Ensure spelling is correct
Context: ...ng completely hiding the search bar and searh engines section ## [v3.3](https://gith...

(QB_NEW_EN_ORTHOGRAPHY_ERROR_IDS_1)

🔇 Additional comments (1)
locales/en.js (1)

63-64: New translation keys look consistent with the UI toggle.

Copy link

@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: 0

🧹 Nitpick comments (1)
index.html (1)

1563-1574: Consider grouping "Hide Search" with other search-related settings for improved UX clarity.

The "Hide Search" toggle is currently placed after weather settings (line 1563), while other search-related controls ("Hide Search Engines" at line 1407, "Motivational Quotes" at line 1420) are grouped ~150 lines earlier. Relocating "Hide Search" to that section (e.g., after line 1430) would improve cognitive grouping for users navigating settings—since disabling one affects the other.

This is optional and depends on your menu organization strategy, but worth considering for a cleaner UX.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e160b69 and cc9573d.

📒 Files selected for processing (3)
  • CHANGELOG.md (1 hunks)
  • index.html (1 hunks)
  • scripts/search.js (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (2)
  • CHANGELOG.md
  • scripts/search.js
🔇 Additional comments (1)
index.html (1)

1563-1574: HTML structure is correct and follows established patterns.

The new "Hide Search" setting is properly structured, uses the correct IDs for JavaScript integration, and has been moved out of the weather settings group (previous review concern resolved). The checkbox, label, and text elements align with the pattern used for other toggles throughout the settings menu.

However, verify that the JavaScript implementation in scripts/search.js and scripts/quotes.js correctly:

  1. Listens to #hideSearchCheckbox change events
  2. Hides/shows the #searchbar and search engine dropdown based on the toggle state
  3. Manages #motivationalQuotesCont visibility (showing unless separately hidden)
  4. Disables/enables the #shortcut_switchcheckbox ("Hide Search Engines") appropriately

You can confirm this works as expected by testing the cross-feature interactions described in the PR objectives.

@acharyarupak391
Copy link
Author

@prem-k-r just pinging u for your attention to this :-P

@prem-k-r
Copy link
Owner

Sorry, I’ve been busy lately. I’ll try to review it this weekend.

@prem-k-r prem-k-r added the enhancement New feature or request label Dec 21, 2025
Relocated the 'Hide Search' toggle section higher
Copy link
Owner

@prem-k-r prem-k-r left a comment

Choose a reason for hiding this comment

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

For screen width 500px-, weather pill is moving up

image

Can you please have a look?

@acharyarupak391
Copy link
Author

For screen width 500px-, weather pill is moving up

image Can you please have a look?

Sure I'll have a look at my time and update.

Copy link
Owner

@prem-k-r prem-k-r left a comment

Choose a reason for hiding this comment

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

We need to inactive the Hide mic option when hide search is on

image

@prem-k-r
Copy link
Owner

Hi @acharyarupak391, are you still working on this?
Just need to fix some small things like inactive hide mic option, uncheck and inactive search suggestions option, and layout for <=500px

@acharyarupak391
Copy link
Author

hey @prem-k-r so sorry.
I've been super busy lately.
Haven't gotten any time to look at this.

I'll try to push within this week.

@prem-k-r
Copy link
Owner

No worries, I can understand. Take your time

@prem-k-r prem-k-r added the changes-requested Review feedback provided. Updates are required before this can be merged. label Jan 27, 2026
@prem-k-r prem-k-r mentioned this pull request Jan 27, 2026
6 tasks
@prem-k-r prem-k-r added the work-in-progress Under active development or being worked on by the assignee. Not ready to close or merge yet label Jan 27, 2026
@acharyarupak391
Copy link
Author

image image

@prem-k-r
Made those changes and pushed.
Attached screenshots as well.

Sorry just got back from a long travel.
Let me know what else feedbacks u have.

Copy link

@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: 2

🤖 Fix all issues with AI agents
In `@style.css`:
- Around line 2013-2019: The rule for ".searchbar.hiddenByOption" inside the
"@media screen and (max-width: 500px)" block currently sets "display: block;
opacity: 0" which hides visually but still reserves layout space; update the CSS
to match the intended behavior: if the search bar should be removed from flow
use "display: none" for ".searchbar.hiddenByOption" (or set "height: 0;
overflow: hidden" to animate collapse), or if it should remain occupying space
use "visibility: hidden" instead; change the declaration for the selector
".searchbar.hiddenByOption" in that media query accordingly so the weather pill
no longer shifts unexpectedly.
- Around line 2008-2019: The CSS block uses a non-kebab class and has lint
violations: rename the selector from .searchbar.hiddenByOption to
.searchbar.hidden-by-option (and update any JS that toggles "hiddenByOption" to
use "hidden-by-option"), remove the dead rule opacity: 1 inside the display:
none rule, change the media query syntax from (max-width: 500px) to the modern
range notation (width <= 500px), and remove the blank line before opacity: 0 in
the mobile rule so the declaration list has no empty line.

@prem-k-r prem-k-r removed the work-in-progress Under active development or being worked on by the assignee. Not ready to close or merge yet label Feb 15, 2026
@prem-k-r prem-k-r added the under-review Currently being reviewed. Please wait for feedback. label Feb 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changes-requested Review feedback provided. Updates are required before this can be merged. enhancement New feature or request under-review Currently being reviewed. Please wait for feedback.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Search box hide button

2 participants