Skip to content
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

🔨 change fallback chain for display.name and titlePublic #3016

Merged
merged 3 commits into from
Dec 21, 2023

Conversation

danyx23
Copy link
Contributor

@danyx23 danyx23 commented Dec 12, 2023

This PR changes the fallback chain for title-ish strings according to #3017

@danyx23 danyx23 linked an issue Dec 12, 2023 that may be closed by this pull request
Copy link
Member

@sophiamersmann sophiamersmann left a comment

Choose a reason for hiding this comment

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

Looks good to me!

Just a few minor comments about how to show the extra fields in Grapher's data tabels.

For table captions, the extra fields and the unit are both shown in grey and not separated from each other, which is a bit weird:

Screenshot 2023-12-15 at 11 00 47

The extra fields make column names a bit crowded, not sure we want to show it here? If there's been a lot of discussion this, please ignore me.

Screenshot 2023-12-15 at 11 23 53

attributionShort: this.def.presentation?.attributionShort,
titleVariant: this.def.presentation?.titleVariant,
}
: { title: this.display?.name ?? this.name ?? "" }
Copy link
Member

Choose a reason for hiding this comment

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

|| instead ?? would be better here because sometimes display.name is an empty string, and then the title would be empty

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah nice catch!

attributionShort: this.def.presentation?.attributionShort,
titleVariant: this.def.presentation?.titleVariant,
}
: { title: this.display?.name ?? this.name ?? "" }
}

@imemo get nonEmptyDisplayName(): string {
Copy link
Member

@sophiamersmann sophiamersmann Dec 15, 2023

Choose a reason for hiding this comment

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

After your changes, this is the only place where nonEmptyDisplayName is used now:

(slug) => this.inputTable.get(slug).nonEmptyDisplayName

I think it would make sense to replace this with titlePublicOrDisplayName and then delete nonEmptyDisplayName

@danyx23 danyx23 force-pushed the change-display-name-vs-title-public-fallbacks branch from e1fa94b to ec5ae70 Compare December 21, 2023 18:28
@danyx23
Copy link
Contributor Author

danyx23 commented Dec 21, 2023

Thanks a lot, @sophiamersmann, very good points. I left the table as is for now since we kinda need the additional fragments with the title public but maybe we can tweak it some time soon with Marwa.

@danyx23 danyx23 merged commit 107ebe4 into master Dec 21, 2023
15 checks passed
@danyx23 danyx23 deleted the change-display-name-vs-title-public-fallbacks branch December 21, 2023 22:03
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.

Update fallbacks for display.name and friends
2 participants