fix(smartlink): redirect to CRE page directly when only one CRE is linked#906
Conversation
7ff08fa to
fe2e5ce
Compare
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
🚧 Files skipped from review as they are similar to previous changes (2)
Summary by CodeRabbit
WalkthroughAdds a fast-path in the Changessmartlink Single-CRE Direct Redirect and Code Maintenance
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ 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 |
382e45c to
fe2e5ce
Compare
533b157 to
15207f3
Compare
|
@coderabbitai review |
✅ Action performedReview finished.
|

Summary
Fixes #486
What changed
When
smartlinkresolves to a standard node (e.g. CWE/611) that hasexactly one connected CRE, the user is now redirected directly to
/cre/{id}instead of stopping at the intermediate/node/...page.The CRE page already contains all the information the node page shows,
so the extra click was unnecessary friction.
If zero or multiple CREs are linked, the existing behavior is preserved.
How it works
In
web_main.py → smartlink(), after finding the node, we filternodes[0].linksfor CRE-typed documents. If exactly one is found,we extract its
idand redirect to/cre/{id}.Tests
test_smartlinkassertions to expect the new/cre/{id}redirect for single-CRE nodesconfirming the fallback to the node page still works