Skip to content

feat: use full path in location search#1511

Open
lpiepiora wants to merge 1 commit into
sysadminsmedia:mainfrom
lpiepiora:feat/full-path-in-loc-search
Open

feat: use full path in location search#1511
lpiepiora wants to merge 1 commit into
sysadminsmedia:mainfrom
lpiepiora:feat/full-path-in-loc-search

Conversation

@lpiepiora

Copy link
Copy Markdown
Contributor

What type of PR is this?

  • feature

What this PR does / why we need it:

This PR is including treeString in location search. The reason for that is, that if you have like me locations that are following some pattern, e.g. "Rack 1 > Shelf 1", "Rack 2 > Shelf 1", etc. it's impossible currently to search particular Shelf. Searching "Shelf 1" will return multiple results. Especially on a mobile phone, the usability is low.

This PR additionally includes treeString in the search, so searches like "Rack 1 > Shelf 1" or "Shelf 1 Rack 1" can be performed. The drawback is that search for "Rack 1" will now also return sub-categories, but I think it's an acceptable drawback, as the "Rack 1" should be shown first anyway (being more specific).

Which issue(s) this PR fixes:

I have not created an issue for this.

Testing

I tested it manually, by running searches in a running application.

PS. Sorry I closed this original PR, because I thought it was merged 15cdd6d (but now I can't find it)

@coderabbitai

coderabbitai Bot commented May 24, 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: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4c5ba8d5-0531-43cd-890a-466ab5276f73

📥 Commits

Reviewing files that changed from the base of the PR and between eb75987 and 116b68a.

📒 Files selected for processing (1)
  • frontend/components/Location/Selector.vue

Summary by CodeRabbit

  • Bug Fixes
    • Location search now matches against both the location name and its position within the hierarchy, providing more comprehensive search results.

Walkthrough

The Location Selector component's fuzzy search now searches both location name and tree path fields simultaneously. The fuzzysort configuration is updated from a single-field key: "name" to a multi-field keys: ["name", "treeString"] approach, broadening match coverage without altering core filtering logic.

Changes

Location Selector Search Enhancement

Layer / File(s) Summary
Multi-field fuzzy search configuration
frontend/components/Location/Selector.vue
The filteredLocations computed property reconfigures fuzzysort to search both name and treeString fields by switching from a single key option to a keys array, enabling location matches on tree path hierarchy in addition to name.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Security Recommendations

  • No security impact identified: This change only expands the search scope to existing component data fields with no new dependencies or external input handling introduced. The fuzzy search remains scoped to internal location data without authentication or authorization changes.

Poem

🌳 A location seeker, twice as keen,
Now finds the name and the tree's green,
Fuzzy paths untangle with ease,
Selector thrives—hierarchy to please! ✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: enabling full path search in location selection, which aligns with the core modification to include treeString in fuzzysort filtering.
Description check ✅ Passed The description comprehensively addresses all required sections: PR type (feature), detailed explanation of what the change does and why, issue reference status, and testing methodology. Well-structured and informative.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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
✨ Simplify code
  • Create PR with simplified code

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.

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.

1 participant