Skip to content

fix/COMPASS-9739 limit collection title to 1 line#156

Merged
paula-stacho merged 1 commit intomainfrom
COMPASS-9739
Nov 3, 2025
Merged

fix/COMPASS-9739 limit collection title to 1 line#156
paula-stacho merged 1 commit intomainfrom
COMPASS-9739

Conversation

@paula-stacho
Copy link
Copy Markdown
Collaborator

@paula-stacho paula-stacho commented Oct 17, 2025

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

Screenshot 2025-10-17 at 15 28 57

Comment thread src/components/node/node.tsx Outdated
@@ -82,9 +82,11 @@ const NodeHeaderIcon = styled.div`
`;

export const NodeHeaderTitle = styled.div`
Copy link
Copy Markdown
Contributor

@lchans lchans Oct 20, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Copy Markdown
Collaborator Author

@paula-stacho paula-stacho Oct 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Collaborator Author

@paula-stacho paula-stacho Oct 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

RM always provide measured height

At the moment we do IIRC, let's go with the title as a node?

Copy link
Copy Markdown
Contributor

@lchans lchans left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@paula-stacho paula-stacho merged commit c473f4a into main Nov 3, 2025
5 checks passed
@paula-stacho paula-stacho deleted the COMPASS-9739 branch November 3, 2025 13:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants