fix: highlight ancestor nodes whose labels match the search query#245
fix: highlight ancestor nodes whose labels match the search query#245R-Hart80 wants to merge 2 commits into
Conversation
When a project is webhook-driven, the four GitHub integration input
fields (repo owner, repo name, branch, file path) were already marked
readOnly and visually styled as disabled on the inputs themselves.
This commit extends the visual treatment to their labels by applying
opacity-60 when isWebhookDriven is true, and moves the explanatory
note ("Repository fields are managed by the GitHub integration.")
to appear after all four fields so it clearly covers the whole group.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
mergePathsIntoTree now accepts a query string and marks any node isSearchMatch when its label contains the query (case-insensitive), not only the leaf IRIs returned by the backend. Plumbed searchQuery from useTreeSearch through UseFilteredTreeOptions into the merge. Four new tests cover: ancestor highlight, case-insensitivity, empty query no-op, and non-matching ancestor stays unhighlighted. Fixes CatholicOS#209. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Warning Rate limit exceeded
You’ve run out of usage credits. Purchase more in the billing tab. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (5)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Problem
Closes #209.
Searching the Class tree highlighted only the leaf nodes that the backend's search endpoint returned. If an ancestor's label also contained the query string, it was rendered without the
<mark>highlight ortree-search-matchclass — even though it's an equally valid match from the user's perspective.Example with query
document:Root cause
mergePathsIntoTree(lib/hooks/useFilteredTree.ts) only added IRIs from the backend response tomatchIris. Ancestor nodes were inserted into the tree withisSearchMatch: falseregardless of their labels.Fix
Four files changed:
lib/hooks/useFilteredTree.ts—mergePathsIntoTreenow accepts an optionalqueryparameter (default""). For every node inserted or updated, it checksitem.label.toLowerCase().includes(q)in addition tomatchIris.has(item.iri). AddedsearchQuery?: stringtoUseFilteredTreeOptions; the hook passes it down to the merge.components/editor/standard/StandardEditorLayout.tsx— passessearchQuerytouseFilteredTree.components/editor/developer/DeveloperEditorLayout.tsx— same.__tests__/lib/hooks/useFilteredTree.test.ts— four new tests:Testing
useFilteredTree/mergePathsIntoTreetests pass (including 4 new ones)LanguagePicker.test.tsx, unrelated)EntityTreeNode.tsxalready respectsnode.isSearchMatch— no changes needed there🤖 Generated with Claude Code