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
[Table] Turn off text truncation by default and raise fixed truncation limit #1656
Conversation
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.
This is a breaking change; we may want to modify the defaults, but we shouldn't do that until we hit a major release, so we can call it out without breaking semver.
I believe this is a UX change, but no different than a UX change like adding reorder handles to the columns without an interaction bar - it's a change, but one we believe is better for everyone. This should not disrupt any users. We will call it out in release notes clearly so if anyone wants to opt in to This column is too long for it's current width, but not so long that it can't reasonably be displayed, so we do not truncate. |
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.
Ok, I thought about this some more and it's a reasonable UX change to make if we have high conviction that the old UX was fairly broken (I think we do). As @tgreenwatts said, we'll call it out in release notes clearly.
I played with this in the dev preview and think the default was a little too low, so up-ed it to 2000. |
Actually fix lintPreview: documentation | table |
@@ -31,10 +31,11 @@ export interface IJSONFormatProps extends ITruncatedFormatProps { | |||
|
|||
export class JSONFormat extends React.Component<IJSONFormatProps, {}> { | |||
public static defaultProps: IJSONFormatProps = { | |||
detectTruncation: true, | |||
detectTruncation: false, |
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.
Can delete this line and fall back to the default props defined in TruncatedFormat
.
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.
Wouldn't this be true for showPopover
as well? it's default here is showPopover: TruncatedPopoverMode.WHEN_TRUNCATED,
which is the default
omitQuotesOnStrings: true, | ||
showPopover: TruncatedPopoverMode.WHEN_TRUNCATED, | ||
stringify: (obj: any) => JSON.stringify(obj, null, 2), | ||
truncateLength: 2000, |
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.
Same
@@ -66,8 +66,8 @@ export interface ITruncatedFormatProps extends IProps { | |||
/** | |||
* Number of characters that are displayed before being truncated and appended with the | |||
* `truncationSuffix` prop. A value of 0 will disable truncation. This prop is ignored if | |||
* `detectTruncation` is `true`. | |||
* @default 80 | |||
* `detectTruncation` is `false`. |
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.
Hmm, should this have changed? See https://github.com/palantir/blueprint/pull/1656/files#diff-820e3fef53ee313553edff37ddbf4737R116. By that logic, we'll never refer to the truncateLength
if detectTruncation
is true
.
our inevitable return to that prior state from which the vast | ||
majority have never stirred? | ||
`; | ||
const str = createStringOfLength(TruncatedFormat.defaultProps.truncateLength + 1); |
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.
Beau-tee-ful!
@@ -71,11 +57,11 @@ describe("Formats", () => { | |||
majority have never stirred? | |||
`; | |||
|
|||
const style = { height: "200px", position: "relative" }; | |||
const style = { height: "300px", width: "300px", position: "relative" }; |
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.
I'd love a comment here.
// fix the container's width and height to ensure this test passes
// regardless of the page's dimensions.
@tgreenwatts - Wait wait, did you see my requested changes? Would like to see those implemented before merging. Reverting. |
-How we do it:
— Change the default from detectTruncation to fixedTruncation
— Choose sane default
— Write good release notes
I may have missed spots