fix/COMPASS-9739 limit collection title to 1 line#156
Conversation
| @@ -82,9 +82,11 @@ const NodeHeaderIcon = styled.div` | |||
| `; | |||
|
|
|||
| export const NodeHeaderTitle = styled.div` | |||
There was a problem hiding this comment.
The collection name wrap was an intentional change for Relational Migrator - Since we show a relational diagram, these tend to have tables which have identical prefixes (ie: crm_2016_customer_profile, crm_2016_customer_address, etc). We've found that it's more clearer for the customer to have a wrap-around title which fully qualifies the name. Wondering if this particular PR is something which is absolutely needed by Compass? If so we could reach some sort of happy middle ground. cc: @spikefuchaoyuan
See the Figma here: https://www.figma.com/design/326swPiGgJEJN5AqtaslPo/FY26Q1-Small-Design-Stories?node-id=328-17786&m=dev
There was a problem hiding this comment.
Hi @lchans , do you have something in mind for the middle ground? The aim of this is to ensure the node height (and field position) calculation works. It is more important for the field-to-field edges we've switched to, but also the floating edges depend on this when the edge is missing calculatedHeight - leading to flickers as the diagram re-renders.
As an alternative, we could calculate to how many rows the title will span, but this would be much simpler (and probably more future proof)
There was a problem hiding this comment.
@paula-stacho Apologies for not replying earlier - It would be better to keep this functionality in, since this was a decision which was agreed upon by stakeholders (We had a discussion with Julia and Ben) - https://jira.mongodb.org/browse/EXPO-4879 - Could we calculate the span of the row title instead?
There was a problem hiding this comment.
Should we let the client decide how they want to render the node title? The change to the node type
name?: string; // This will be used as html `title` prop
title: React.ReactNode; // This will be shown as the node title
This would enable us (Compass) to show warning sign in the title without passing more data to diagramming and computing that here.
There was a problem hiding this comment.
I've looked into calculating the num of lines, but there are too many variables that this depends on (not only font size, any css that can affect the final space for the text, including the optional action buttons), I'm afraid it'd just be too brittle.
We can provide the title as a node, but this also means we're giving up on the node height calculation working reliably.
@lchans does RM always provide measured height?
There was a problem hiding this comment.
@lchans I'll check with Julia and Ben, from the description it seems to me like the focus back then was on the zoomed-out titles, but ofc it's hard to get the full context from notes
There was a problem hiding this comment.
RM always provide measured height
At the moment we do IIRC, let's go with the title as a node?
lchans
left a comment
There was a problem hiding this comment.
Sorry about the run-around on this PR! Given the discussion in https://mongodb.slack.com/archives/C08KETBQ2QN/p1761842838874009 I'm happy to approve this PR.
4995f1f to
9236ab9
Compare
External Links
Description
This ensures a consistent node height (avoiding calculations that'd have to account for the length of the title and how it'll wrap when rendered). The full title can still be viewed on hover.
📸 Screenshots/Screencasts
After