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

[docs] Refactor Pickers Localization documentation sections #11989

Merged
merged 15 commits into from
Feb 8, 2024

Conversation

LukasTy
Copy link
Member

@LukasTy LukasTy commented Feb 8, 2024

Resolve topics discussed in https://mui-org.slack.com/archives/C04U3R2V9UK/p1707325208275059

  • Consistently have Localization & Validation section in all Picker component pages
  • Add callouts in Customize the <x> format sections to the Custom format documentation section
    • Simplify demos by using defaultValue instead of controlled value
  • Make Validation section copyright consistent
  • Simplify Localization section copyright

@LukasTy LukasTy added docs Improvements or additions to the documentation component: pickers This is the name of the generic UI component, not the React module! labels Feb 8, 2024
@LukasTy LukasTy self-assigned this Feb 8, 2024
@@ -32,11 +32,14 @@ Learn more about the _Controlled and uncontrolled_ pattern in the [React documen

{{"demo": "CustomDateFormat.js"}}

:::info
Copy link
Member

Choose a reason for hiding this comment

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

IMHO this demo should either not exist or be inside the "Localization" section below
THis would help people understand that the custom date format is part of the the Localization in our doc

Copy link
Member Author

Choose a reason for hiding this comment

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

Initially, I was leaning towards that direction, but then I thought that the various custom formats for different components (date, time, and date-time) have lots of examples. If we want to provide at least a similar amount of demos in the Custom format section, it would be huge. 🤯
That's why I decided to keep the separate section. 🤔
WDYT?
Would moving those Customize the <x> format sections as sub-sections of Localization make more sense to you?

Copy link
Member Author

Choose a reason for hiding this comment

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

@flaviendelangle I've moved the Customize the format sections as subsections of Localization.
Let me know what you think. 😉

Copy link
Member

Choose a reason for hiding this comment

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

I can be a good trade-off 👌

Copy link
Member

Choose a reason for hiding this comment

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

This can be a great use-case for a switch like github does it on their webhook documentation:
Screenshot 2024-02-08 at 14 20 15

Copy link
Member

Choose a reason for hiding this comment

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

In the sense that you could provide a few options to select formats and then the fields will use that. WDYT?

Copy link
Member Author

Choose a reason for hiding this comment

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

That is a great suggestion, I'll explore that option. 👌

Copy link
Member Author

Choose a reason for hiding this comment

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

@michelengelen I've explored that possibility but felt that the increased complexity and worse demo code readability didn't help. 🤔
If we wanted it to be useful, we'd need to have an elaborate demo with code preview. 🙈
I think that for starters this improvement should be useful enough. 🤞

@@ -32,11 +32,14 @@ Learn more about the _Controlled and uncontrolled_ pattern in the [React documen

{{"demo": "CustomDateFormat.js"}}

:::info
Copy link
Member

Choose a reason for hiding this comment

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

I can be a good trade-off 👌

docs/data/date-pickers/date-field/date-field.md Outdated Show resolved Hide resolved
@LukasTy LukasTy added the needs cherry-pick The PR should be cherry-picked to master after merge label Feb 8, 2024
Copy link
Member

@michelengelen michelengelen left a comment

Choose a reason for hiding this comment

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

Apart from the comments already mentioned I have nothing more! Nice! 🎉 :shipit:

@LukasTy LukasTy enabled auto-merge (squash) February 8, 2024 15:32
@LukasTy LukasTy merged commit ee4f820 into mui:next Feb 8, 2024
15 checks passed
@LukasTy LukasTy changed the title [docs] Refactor Localization documentation sections [docs] Refactor Pickers Localization documentation sections Feb 8, 2024
@LukasTy LukasTy deleted the refactor-localization-docs branch February 8, 2024 21:10
thomasmoon pushed a commit to thomasmoon/mui-x that referenced this pull request Sep 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! docs Improvements or additions to the documentation needs cherry-pick The PR should be cherry-picked to master after merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants