-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: Improved Page and History names #4908
feat: Improved Page and History names #4908
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.
Thank you for contributing @zvolcsey :) !
@@ -86,6 +91,11 @@ export const ViewPickerDropdown = () => { | |||
) : ( | |||
<IconList size={theme.icon.size.md} /> | |||
)} | |||
<PageTitle |
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 think this logic could be moved up to ViewBar
which seems to be the parent component among all view components
<PageTitle | ||
title={`${ | ||
currentViewWithCombinedFiltersAndSorts?.name ?? 'All' | ||
} - ${capitalize(objectNamePlural)}`} |
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.
'All' - ${capitalize(objectNamePlural)}
does not work so well here if objectNamePlural is equal to ''
which is possible in theory. But with the logic moved with ViewBar you will not have to worry about this since objectPluralName is defined for sure there
@@ -36,6 +37,7 @@ export const NotFound = () => { | |||
|
|||
return ( | |||
<> | |||
<PageTitle title="Page Not Found" /> |
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 am not 100% sure it is what we would want here. @Bonapara ?
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 for the 404?
Page Not Found | Twenty maybe?
@@ -86,6 +91,11 @@ export const ViewPickerDropdown = () => { | |||
) : ( | |||
<IconList size={theme.icon.size.md} /> | |||
)} | |||
<PageTitle | |||
title={`${ | |||
currentViewWithCombinedFiltersAndSorts?.name ?? 'All' |
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.
Not mandatory but I think we could also add a PageTitle
within RecordIndexPage to handle "All Companies - Companies" (or maybe just "Companies"). In practice that will always be overwritten by the title logic in ViewBar
because in today's setup RecordIndexPage always has ViewBar as a child component but it could easily stop being the case (what if we want to have a read-only view that would not feature the ViewBar to edit it?).
Ideally all the records titling logic would be at the same place in RecordIndexPage using useGetCurrentView
to fetch the view information but the hook is not usable as is in RecordIndexPage at the moment so let's not make things complex.
@@ -19,13 +19,39 @@ export const getPageTitleFromPath = (pathname: string): string => { | |||
case AppPath.OpportunitiesPage: | |||
return 'Opportunities'; | |||
case `${AppBasePath.Settings}/${SettingsPath.ProfilePage}`: | |||
return 'Profile'; | |||
return 'Profile - Settings'; |
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 think we only want to have the values Appearance - Settings
, Profile - Settings
(for all children pages of Profile, except Appearance that is in the product not a child of Profile but that seems to be by the path: settings/profile/appearance), Accounts - Settings
(for all children pages of Accounts: Emails, Calendars..).
We don't need more granularity that could be hard to maintain as we add more pages/components
@@ -90,6 +91,9 @@ export const SettingsObjectDetail = () => { | |||
|
|||
return ( | |||
<SubMenuTopBarContainer Icon={IconSettings} title="Settings"> | |||
<PageTitle |
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.
As said in my above comment in title-utils I don't think we want that granularity in those components
@ijreilly Hi! Thank you for the review! I fixed the things mentioned above.
|
@zvolcsey thank you for your great work and for being so responsive. |
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.
thx @zvolcsey !
Hi! I improved page and history names.
Closes #4684
page-title.mp4
settings.mp4
Page Title of Workspace objects
I added the
PageTitle
component to theViewPickerDropdown
component. If the user changes the view, then the page title is updated.All Comapnies - Companies
Best ones - Companies
By Stage - Oppurtunites
Object Singular
I added the
PageTitle
component to theRecordShowPage
component.Settings (and Tasks page)
I added the paths from
SettingsPath
to thetitle-utils.ts
.https://github.com/twentyhq/twenty/blob/main/packages/twenty-front/src/modules/types/SettingsPath.ts
For example:
Except:
For these paths, I added the
PageTitle
component to the corresponding Route component.Object Name
- SettingsObject Name
- Settingsnumber
NewObject Name
Field - SettingsAPI Key Name
API Key - SettingsDBName
Database - Settings,Airtable Database - Settings
Connection Name
Connection - SettingsNew Airtable Connection - Settings