feat: derive connector gender for display (compute-only) - #3121
feat: derive connector gender for display (compute-only)#3121githappens wants to merge 2 commits into
Conversation
🤖 CodeAnt AI — Review Status
Updated in place by CodeAnt AI · last 5 reviews |
Thanks for using CodeAnt! 🎉We're free for open-source projects. if you're enjoying it, help us grow by sharing. Share on X · |
📝 WalkthroughWalkthroughAdds a pure connector-gender derivation utility, tests XLR and Speakon mappings plus unsupported cases, and displays derivable gender labels in port tooltips. ChangesConnector gender display
Estimated code review effort: 2 (Simple) | ~10 minutes Sequence Diagram(s)sequenceDiagram
participant PortTooltip
participant inferDirection
participant deriveGender
PortTooltip->>inferDirection: resolve port direction when needed
inferDirection-->>PortTooltip: return effective direction
PortTooltip->>deriveGender: pass connector type and direction
deriveGender-->>PortTooltip: return gender label or undefined
PortTooltip-->>PortTooltip: render gender row when label exists
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ESLint install timed out. The project may have too many dependencies for the sandbox. 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 |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/lib/components/PortTooltip.svelte`:
- Around line 108-110: Update the gender-label rendering block in PortTooltip to
compute getGenderLabel(port) once using Svelte’s {`@const`} tag, then reuse that
local value for both the conditional and displayed text.
🪄 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: af1a475a-ab22-42c3-bcd2-8015f2a73ea9
📒 Files selected for processing (3)
src/lib/components/PortTooltip.sveltesrc/lib/utils/port-utils.tssrc/tests/derive-gender.test.ts
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Bence Kovács <23636204+githappens@users.noreply.github.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Signed-off-by: Bence Kovács <23636204+githappens@users.noreply.github.com>
66fdffb to
76aad2f
Compare
|
Addressed the CodeRabbit note: |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/lib/components/PortTooltip.svelte`:
- Around line 102-108: Cache the result of getDirectionLabel(port) with a Svelte
{`@const`} declaration alongside genderLabel, then use that cached value for both
the conditional and rendered direction text in the port tooltip template.
🪄 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: 977ee77a-6e3f-431a-aa7c-b9393fccb6b9
📒 Files selected for processing (3)
src/lib/components/PortTooltip.sveltesrc/lib/utils/port-utils.tssrc/tests/derive-gender.test.ts
User description
Closes #1944.
Adds deriveGender(type, direction) beside inferDirection in port-utils, and a
gender row in PortTooltip. Computed only, per the spike #1927 resolution: no
schema field, no migration, no drift.
Conventions encoded:
without a resolved in/out direction (bidirectional/unset returns undefined).
directional - chassis connectors (NL4MP family) are male; the mating cable
end is female; a port models the chassis side.
(transmitters are female), so applying the XLR rule would display the wrong
gender. Happy to encode the DMX convention in a follow-up if wanted.
Heads-up: PR #3120 (signal_type) also touches PortTooltip.svelte (adds a
signal row in the same spot) and the same port-utils import line - whichever
merges second has a trivial both-sides conflict.
CodeAnt-AI Description
Show derived connector gender in the port tooltip
What Changed
Impact
✅ Clearer port details✅ Fewer wrong connector labels✅ Faster hardware setup checks💡 Usage Guide
Checking Your Pull Request
Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.
Talking to CodeAnt AI
Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:
This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.
Example
Preserve Org Learnings with CodeAnt
You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:
This helps CodeAnt AI learn and adapt to your team's coding style and standards.
Example
Retrigger review
Ask CodeAnt AI to review the PR again, by typing:
Check Your Repository Health
To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.