Skip to content

fix(search): local fuzzy document search returns non-document results - #2242

Merged
gbirman merged 7 commits into
mainfrom
gab/fix/document-search
Mar 27, 2026
Merged

gbirman merged 7 commits into
mainfrom
gab/fix/document-search

Conversation

@gbirman

@gbirman gbirman commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@gbirman
gbirman requested a review from a team as a code owner March 27, 2026 21:49
@coderabbitai

coderabbitai Bot commented Mar 27, 2026 •

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: cc7df432-2ce8-4306-8678-f604a90d8354

📥 Commits

Reviewing files that changed from the base of the PR and between 948f167 and 7bb43d7.

📒 Files selected for processing (1)
  • js/app/packages/app/component/next-soup/soup-view/soup-view-tabs.tsx

📝 Walkthrough

Summary by CodeRabbit

  • New Features

    • Added a "Documents & Files" filter option for improved content organization.
  • Bug Fixes

    • Updated document tab presets so Owned, Shared, Attachments, and All tabs show documents and files correctly.
    • Improved view-state restoration so active tab and filters are applied more reliably across sessions.

Walkthrough

Added a document-or-file client filter, swapped several tab presets to use it instead of not-task, and made SoupView persisted state version-aware so stale persisted states may trigger applying tab presets instead of directly restoring filters.

Changes

Cohort / File(s) Summary
Filter definitions & sidebar presets
js/app/packages/app/component/next-soup/filters/configs.ts, js/app/packages/app/component/app-sidebar/soup-filter-presets.ts
Added a document-or-file filter (matches documents while excluding tasks) and replaced and: ['not-task'] with and: ['document-or-file'] for owned, attachments, all; updated shared to and: ['document-or-file', 'shared-entity'].
SoupView persistence & restore
js/app/packages/app/component/next-soup/soup-view/soup-view.tsx
Introduced PERSISTED_STATE_VERSION and optional version on persisted state; restore now checks staleness and may apply tab presets for stale states instead of unconditionally restoring persisted filters; persisted saves include version.
Tab preset application API
js/app/packages/app/component/next-soup/soup-view/soup-view-tabs.tsx
applyTabPreset signature changed to return boolean indicating whether a preset was found and applied (previously void).
Dev tooling update
js/app/package.json
Bumped dev dependency @biomejs/biome from 2.2.6 to 2.4.7.

Possibly related PRs

🚥 Pre-merge checks | ✅ 1 | ❌ 1

❌ Failed checks (1 inconclusive)

Check name Status Explanation Resolution
Description check ❓ Inconclusive No description was provided by the author, making it impossible to assess relevance to the changeset. Add a pull request description explaining the changes, why they were made, and how they address the issue of non-document results in document search.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title follows conventional commits format with 'fix:' prefix and is under 72 characters, clearly describing the fix for document search returning non-document results.

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


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions

github-actions Bot commented Mar 27, 2026 •

Copy link
Copy Markdown

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@js/app/packages/app/component/next-soup/soup-view/soup-view.tsx`:
- Around line 655-673: When restoring a stale persisted state that has
activeTab, guard against applyTabPreset silently failing: change the logic
around isStale && isListViewID(contentId) && initialPersistedState.activeTab to
call applyTabPreset(contentId, initialPersistedState.activeTab) and check its
success (have applyTabPreset return boolean or detect no-op); if it fails, run
the fallback batch that initializes soup.filters (soup.filters.set),
setQueryFilters and setActiveTab using the same values as the existing else
branch (use props.initialClientFilters when isStale, otherwise
initialPersistedState.filters, and queryFilters/activeTab from
initialPersistedState) so filters are never left uninitialized.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 94a78bd2-b524-476c-ba51-acbd17012eb3

📥 Commits

Reviewing files that changed from the base of the PR and between 058512b and 69e8854.

📒 Files selected for processing (3)
  • js/app/packages/app/component/app-sidebar/soup-filter-presets.ts
  • js/app/packages/app/component/next-soup/filters/configs.ts
  • js/app/packages/app/component/next-soup/soup-view/soup-view.tsx

@coderabbitai coderabbitai 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@js/app/packages/app/component/next-soup/soup-view/soup-view-tabs.tsx`:
- Around line 109-112: The function applyTabPreset reads VIEW_TAB_PRESETS[view]
then accesses config.tabs without checking config exists; add a guard to ensure
config is defined before accessing config.tabs (e.g., if (!config) return false)
so non-tabbed ListView values won't cause a runtime crash; update applyTabPreset
to check VIEW_TAB_PRESETS[view] (the local variable config) prior to using
config.tabs and only proceed to resolve resolver when config is present.
🪄 Autofix (Beta)

✅ Autofix completed


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: abaeae68-2308-473b-905e-cced38619281

📥 Commits

Reviewing files that changed from the base of the PR and between 69e8854 and 63171ea.

⛔ Files ignored due to path filters (1)
  • js/app/bun.lock is excluded by !**/*.lock, !**/bun.lock
📒 Files selected for processing (3)
  • js/app/package.json
  • js/app/packages/app/component/next-soup/soup-view/soup-view-tabs.tsx
  • js/app/packages/app/component/next-soup/soup-view/soup-view.tsx

@coderabbitai

coderabbitai Bot commented Mar 27, 2026 •

Copy link
Copy Markdown
Contributor

Note

Autofix is a beta feature. Expect some limitations and changes as we gather feedback and continue to improve it.

Fixes Applied Successfully

Fixed 1 file(s) based on 1 unresolved review comment.

Files modified:

  • js/app/packages/app/component/next-soup/soup-view/soup-view-tabs.tsx

Commit: 948f1671a6e9bafdf14569b471c5d6f493bf9b20

The changes have been pushed to the gab/fix/document-search branch.

Time taken: 2m 44s

coderabbitai Bot and others added 2 commits March 27, 2026 22:20
Fixed 1 file(s) based on 1 unresolved review comment.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
@gbirman
gbirman merged commit 6853546 into main Mar 27, 2026
22 checks passed
@gbirman
gbirman deleted the gab/fix/document-search branch March 27, 2026 22:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant