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

TabModel.title will omit special characters like '&' because we run it through lodash's startCase #3804

Closed
febbraiod opened this issue Oct 9, 2024 · 3 comments

Comments

@febbraiod
Copy link
Member

febbraiod commented Oct 9, 2024

This appears to happen by default when sourcing the title from the "id" provided in a config object through the TabContainerModel

@amcclain amcclain changed the title TabModel.title will omit special characters like '&' because we run it thought lodash's startCase TabModel.title will omit special characters like '&' because we run it through lodash's startCase Oct 22, 2024
@amcclain
Copy link
Member

Sounds like we would benefit from an updated version of genDisplayName()

export function genDisplayName(fieldName: string): string {

Could relocate out of this file and avoid the use of startCase there as well.

Although it looks to me like this only applies if you are not spec'ing a title and instead having the tab id be auto-processed into a display title. Do you have chars like & in your tab IDs also? That seems a bit weird to me, and potentially a source of bugs if you had routing enabled. Pls review and confirm when you have a chance?

@lbwexler
Copy link
Member

lbwexler commented Dec 30, 2024

Were y'all thinking we would just not call startCase() if certain characters like & are included or write a custom startCase()?

I guess the former is at least a better, less surprising heuristic heuristic for generating a default display name -- although in either case the answer is really for the app to be explicit about what it wants.

Not sure if this is a bug. @febbraiod -- did you just end up specing a title?

@lbwexler
Copy link
Member

Don and I discussed, and agreed that it was both strange for him to provide an id with special charachters, and easy for him to specify the title directly. Closing.

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

No branches or pull requests

3 participants