Skip to content

docs(docs-infra): fix the global layout of the site #58831

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

Closed
wants to merge 2 commits into from

Conversation

Ahmed-Hakeem
Copy link
Contributor

@Ahmed-Hakeem Ahmed-Hakeem commented Nov 22, 2024

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Fixes #52648
Issue Number: #52648

Currently we are not taking the full available space for the main content of the page

image
image
image
image

What is the new behavior?

Take the full width of the page unless needed

image
image
image
image

Does this PR introduce a breaking change?

  • Yes
  • No

Other information

@pullapprove pullapprove bot requested a review from alxhub November 22, 2024 20:59
@angular-robot angular-robot bot added the area: docs-infra Angular.dev application and infrastructure label Nov 22, 2024
@ngbot ngbot bot added this to the Backlog milestone Nov 22, 2024
@Ahmed-Hakeem
Copy link
Contributor Author

Commit body!

f2492fb708eebb8cba1b02312be5d0e3

Copy link

github-actions bot commented Nov 22, 2024

Deployed adev-preview for ccecd71 to: https://ng-dev-previews-fw--pr-angular-angular-58831-adev-prev-klmq8unx.web.app

Note: As new commits are pushed to this pull request, this link is updated after the preview is rebuilt.

@Ahmed-Hakeem
Copy link
Contributor Author

The compiler unlike locally didn't replace the :host with its convenient attr ..... instead emited it as the native host selector in :host{ &.docs-with-TOC{}} .... I will change that to use another way to target the host element

@angular-robot angular-robot bot added the area: docs Related to the documentation label Nov 22, 2024
@JeanMeche
Copy link
Member

Could you mention the dedicated issue in your commit : #52648
Thank you.

@Ahmed-Hakeem
Copy link
Contributor Author

The compiler unlike locally didn't replace the :host with its convenient attr ..... instead emited it as the native host selector in :host{ &.docs-with-TOC{}} .... I will change that to use another way to target the host element

That's my bad, didn't notice that the deployed code has ViewEncapsulation:none! 

Anyway, I have used another way to target the element.

Also, I have added some enhancements to the global layout, and will push it shortly.

@Ahmed-Hakeem
Copy link
Contributor Author

Could you mention the dedicated issue in your commit : #52648 Thank you.

Sure : ) ....Didn't even know there's a dedicated issue already for this =D ... nice ❤️

@Ahmed-Hakeem Ahmed-Hakeem force-pushed the fix/global-layout branch 2 times, most recently from ded2b80 to 08af746 Compare November 25, 2024 04:53
@Ahmed-Hakeem Ahmed-Hakeem changed the title fix(docs-infra): fix the global layout of the site docs(docs-infra): fix the global layout of the site Nov 28, 2024
@Ahmed-Hakeem
Copy link
Contributor Author

I'll remove the cli ref and api ref components' changes..... since it's pointless after merging this one #58610

@Ahmed-Hakeem
Copy link
Contributor Author

I've integrated with the new design of API pages ... I guess we're ready now : ) .... what do you think ?

@thesmiler
Copy link
Contributor

I have to say, I am a bit torn. I work on a wide screen and the new layout is a bit extreme at times:
Screenshot 2024-12-09 15 07 05
https://ng-dev-previews-fw--pr-angular-angular-58831-adev-prev-by29p6vr.web.app/guide/templates/ng-template

Reading such paragraphs is difficult in a focused way.

This is also mentioned in: #52648 (comment)

However of course the current layout is also extreme in the other way, so I wonder if there is a middle ground - and perhaps moving the text more in the middle as mentioned. But I am not a UX person.

@Ahmed-Hakeem
Copy link
Contributor Author

I have to say, I am a bit torn. I work on a wide screen and the new layout is a bit extreme at times:

Screenshot 2024-12-09 15 07 05

https://ng-dev-previews-fw--pr-angular-angular-58831-adev-prev-by29p6vr.web.app/guide/templates/ng-template

Reading such paragraphs is difficult in a focused way.

This is also mentioned in: #52648 (comment)

However of course the current layout is also extreme in the other way, so I wonder if there is a middle ground - and perhaps moving the text more in the middle as mentioned. But I am not a UX person.

Yeah it needs a better way especially in pages that has no aside table of contents menu .... I believe it'd be better in large sizes if we put the content in the center of the page while having a fixed max-width like angular.io

And at the same time keeping pages that doesn't have articles inside it with the full width like: api list overview ... cli list ... tutorials overview

@Ahmed-Hakeem
Copy link
Contributor Author

@thesmiler it's fixed now .... @JeanMeche @alxhub please let me know if you have any comments

For large screens:

image

image

for laptops:

image

@thePunderWoman
Copy link
Contributor

@Ahmed-Hakeem Can you take a look and resolve these conflicts for us?

@thePunderWoman thePunderWoman requested review from JeanMeche and removed request for alxhub April 2, 2025 13:40
@JeanMeche JeanMeche force-pushed the fix/global-layout branch 2 times, most recently from 4e686f6 to 6bd62e2 Compare April 2, 2025 15:58
.page {
@use '@angular/docs/styles/media-queries' as mq;

::ng-deep adev-update-guide{
Copy link
Member

Choose a reason for hiding this comment

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

That ::ng-deep looks suspicious

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah looks so ... couldn't rememer why I made it that way... I believe :host is sufficient in this case

@thesmiler
Copy link
Contributor

Hey Ahmed, I just reviewed again and agree - this looks good on both a laptop and on a very wide desktop screen now! Thanks so much for this contribution!

Just one question - Now when scaling the window to become wider, the transition is a bit weird as the content first becomes wider and wider and then suddenly gets narrower again when it moves to a fixed width. Is there a reason for this, that the widest non-fixed width is wider than the fixed one?

@JeanMeche
Copy link
Member

I'd say let's merge this one for now and improve incrementaly !

Thoughts @thesmiler & @hawkgs ?

take the full width of the page for all the pages that use docs-viewer, also reserve an area for table of contents on-demand

Resolves: angular#52648
@JeanMeche JeanMeche force-pushed the fix/global-layout branch from 6bd62e2 to ccecd71 Compare May 2, 2025 11:10
@hawkgs
Copy link
Member

hawkgs commented May 6, 2025

Sure, I am for merging this. I like the idea!

However, I noticed that the API reference pages are still on the left hand side of the screen. Is this intentional? I think we should update them as well.

@thesmiler
Copy link
Contributor

I like it too

@JeanMeche JeanMeche added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels May 9, 2025
@alxhub
Copy link
Member

alxhub commented May 9, 2025

This PR was merged into the repository by commit 108043f.

The changes were merged into the following branches: main, 19.2.x, 20.0.x

alxhub pushed a commit that referenced this pull request May 9, 2025
take the full width of the page for all the pages that use docs-viewer, also reserve an area for table of contents on-demand

Resolves: #52648

PR Close #58831
alxhub pushed a commit that referenced this pull request May 9, 2025
alxhub pushed a commit that referenced this pull request May 9, 2025
take the full width of the page for all the pages that use docs-viewer, also reserve an area for table of contents on-demand

Resolves: #52648

PR Close #58831
alxhub pushed a commit that referenced this pull request May 9, 2025
@alxhub alxhub closed this in 20fdeab May 9, 2025
alxhub pushed a commit that referenced this pull request May 9, 2025
@Ahmed-Hakeem
Copy link
Contributor Author

Hey everyone @JeanMeche @thePunderWoman @hawkgs @thesmiler @alxhub

really my apologies everyone, I just had a major release in the comp + my working as FE instructor so I hadn't even had the chance to check Github acc ....

Thank you for your suggestion @JeanMeche ❤️ .... I'll work on this one and open a PR to make it consistent and ensure no issues with it ..... cuz I could see a lot has changed which made the new layout I've made need to be reviewed to integrate it correctly with the new work

Thank you so much for your understanding ❤️

@JeanMeche
Copy link
Member

Yeah, we can incrementally improve our docs. Thanks for helping us with this !

@Ahmed-Hakeem
Copy link
Contributor Author

Hey Ahmed, I just reviewed again and agree - this looks good on both a laptop and on a very wide desktop screen now! Thanks so much for this contribution!

Just one question - Now when scaling the window to become wider, the transition is a bit weird as the content first becomes wider and wider and then suddenly gets narrower again when it moves to a fixed width. Is there a reason for this, that the widest non-fixed width is wider than the fixed one?

Hi @thesmiler ..... thank you so much for your lovely words ❤️

I got your point ....what's happening is
-we are making the layout of the main content flexible (its width scale up to take the full available width ) until we reach a specific window size
-when we reach this size scaling up the main content will be messy (will be like a long lines of text ) ..... so I've made it with a specific fixed width (80ch)

so we have two solutions to this one
1- let the content scales up until that fixed size (so it will gets bigger and bigger but not bigger than this fixed size = (80ch ~= 808px))

2- let the content scales up until that fixed size as well but increase the fixed size to be (~=1070px) the same as the size before breaking to smaller fixed size

image

@Ahmed-Hakeem
Copy link
Contributor Author

Yeah, we can incrementally improve our docs. Thanks for helping us with this !

It's my pleasure 😊 ❤️ .... Thank you

@Ahmed-Hakeem
Copy link
Contributor Author

I believe now it's well integrated and has no UI issues

please check this PR: #61256

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
action: merge The PR is ready for merge by the caretaker adev: preview area: docs Related to the documentation area: docs-infra Angular.dev application and infrastructure target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

docs: widescreen mode needs <3
6 participants