-
Notifications
You must be signed in to change notification settings - Fork 675
Embeddings Panel Legend Margin #6318
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
WalkthroughUpdated EmbeddingsPlot legend positioning: legend.y is now conditional based on bounds.width ( Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant EmbeddingsPlot as EmbeddingsPlot (React)
participant Layout as Layout Calc
participant Plotly as Plotly Render
User->>EmbeddingsPlot: Mount / Resize
EmbeddingsPlot->>Layout: Get bounds (width, height)
Layout-->>EmbeddingsPlot: bounds
rect rgba(200,230,255,0.25)
note right of EmbeddingsPlot: legend.y calculation changed
EmbeddingsPlot->>EmbeddingsPlot: if bounds.width < 500 then\nlegend.y = 1 - 62 / bounds.height\nelse legend.y = 1
end
EmbeddingsPlot->>Plotly: Render with legend anchors\n(xanchor="right", yanchor="top", xref="paper", yref="paper")
Plotly-->>User: Plot displayed with adjusted legend
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Pre-merge checks (1 passed, 2 warnings)❌ Failed Checks (2 warnings)
✅ Passed Checks (1 passed)
Poem
Tip 👮 Agentic pre-merge checks are now available in preview!Pro plan users can now enable pre-merge checks in their settings to enforce checklists before merging PRs.
📜 Recent review detailsConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (8)
✨ Finishing Touches
🧪 Generate unit tests
Comment |
2de076a
to
01a49dd
Compare
01a49dd
to
4ef0ee6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (2)
app/packages/embeddings/src/EmbeddingsPlot.tsx (2)
141-142
: Drop legend.xref/yref — legend already uses paper coordinates; these props are likely ignored.Cleaner config and fewer confusing, non-functional props.
Apply this diff:
- yref: "paper", - xref: "paper",
138-140
: Extract magic numbers (500, 62) and optionally clamp for tiny heights.Improves readability and guards against negative y if height < 62.
Example:
const NARROW_WIDTH_PX = 500; const LEGEND_MENU_MARGIN_PX = 62; // ... y: bounds.width < NARROW_WIDTH_PX ? Math.max(0, 1 - LEGEND_MENU_MARGIN_PX / bounds.height) : 1,
📜 Review details
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
💡 Knowledge Base configuration:
- MCP integration is disabled by default for public repositories
- Jira integration is disabled by default for public repositories
- Linear integration is disabled by default for public repositories
You can enable these sources in your CodeRabbit configuration.
📒 Files selected for processing (1)
app/packages/embeddings/src/EmbeddingsPlot.tsx
(1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.{ts,tsx}
⚙️ CodeRabbit configuration file
Review the Typescript and React code for conformity with best practices in React, Recoil, Graphql, and Typescript. Highlight any deviations.
Files:
app/packages/embeddings/src/EmbeddingsPlot.tsx
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
- GitHub Check: test / test-python (ubuntu-latest-m, 3.12)
- GitHub Check: test / test-python (ubuntu-latest-m, 3.11)
- GitHub Check: test / test-python (ubuntu-latest-m, 3.9)
- GitHub Check: test / test-python (ubuntu-latest-m, 3.10)
- GitHub Check: e2e / test-e2e
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
Improve the Embeddings panel plot legend positioning. If the width of the panel is < 500px, the legend will have a new 62px margin to account for the menu.
Summary by CodeRabbit
New Features
Bug Fixes
Style