Skip to content

fix(search): preserve whitespace for English locale search filtering - #650

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:release/eaglefrom
GongHeng2017:202609041102-re-eagle-fix
Sep 4, 2026
Merged

deepin-bot[bot] merged 1 commit into
linuxdeepin:release/eaglefrom
GongHeng2017:202609041102-re-eagle-fix

Conversation

@GongHeng2017

@GongHeng2017 GongHeng2017 commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Previously all whitespace was removed from search text regardless of locale, breaking multi-word searches in English. Extract the filtering logic into a shared helper and only strip whitespace for non-English locales.

Log: 修复英文环境下搜索多词内容时空格被过滤导致搜索失败的问题
PMS: BUG-373531
Influence: 英文环境下多词搜索结果正常返回,非英文环境行为不变

Summary by Sourcery

Preserve whitespace in English search input while maintaining locale-specific filtering for other languages.

Bug Fixes:

  • Preserve spaces in English locale search queries so multi-word searches return the expected results while retaining existing non-English behavior.

Enhancements:

  • Centralize search text filtering and apply consistent locale-aware processing across keyword searches, live search, and title-bar completion.

Previously all whitespace was removed from search text regardless of
locale, breaking multi-word searches in English. Extract the filtering
logic into a shared helper and only strip whitespace for non-English
locales.

Log: 修复英文环境下搜索多词内容时空格被过滤导致搜索失败的问题
PMS: BUG-373531
Influence: 英文环境下多词搜索结果正常返回,非英文环境行为不变
@GongHeng2017
GongHeng2017 force-pushed the 202609041102-re-eagle-fix branch from 2f4ddf9 to d64bf3d Compare September 4, 2026 05:54

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: GongHeng2017, lzwind

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@GongHeng2017

Copy link
Copy Markdown
Contributor Author

/forcemerge

@sourcery-ai

sourcery-ai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Reviewer's Guide

Search text filtering is now shared across all search entry points and preserves whitespace for English locales, allowing multi-word searches while retaining the previous whitespace-stripping behavior elsewhere.

Sequence diagram for locale-aware search filtering

sequenceDiagram
    participant User
    participant WebWindow
    participant SearchManager

    User->>WebWindow: onSearchContentByKeyword(keyword)
    WebWindow->>WebWindow: filterSearchText(keyword)
    alt English locale
        WebWindow->>SearchManager: searchContent(searchKey with spaces)
    else Non-English locale
        WebWindow->>SearchManager: searchContent(searchKey without whitespace)
    end
Loading

File-Level Changes

Change Details Files
Centralize search-input normalization and make whitespace handling locale-dependent.
  • Added a shared helper that removes line breaks for all locales and other whitespace only for non-English locales.
  • Detected English system locales using QLocale.
  • Replaced duplicated filtering logic in keyword search, delayed search updates, and title-bar completion handling.
src/view/web_window.cpp

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@deepin-bot

deepin-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

This pr force merged! (status: unstable)

@deepin-bot
deepin-bot Bot merged commit 8ab4aff into linuxdeepin:release/eagle Sep 4, 2026
13 of 14 checks passed
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