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

Implement global header/footer design across w.org network #38

Closed
29 of 30 tasks
iandunn opened this issue Aug 12, 2021 · 11 comments
Closed
29 of 30 tasks

Implement global header/footer design across w.org network #38

iandunn opened this issue Aug 12, 2021 · 11 comments

Comments

@iandunn
Copy link
Member

iandunn commented Aug 12, 2021

After it's implemented for News in WordPress/wporg-news-2021#6, we'll need to roll the new header/footer out to all sites in the network. That can/should probably happen before News launches.

There are a lot of potential improvements we can make under the hood, to make the header easier to maintain across the various systems that implement it. It'd be nice to do at least some of that here, but we'll have to weigh the time/benefit tradeoffs for each one.

Pain Points

This file is used by wordpress.org static files including index-wporg.php. It is also used by the codex [and GlotPress, Trac, etc], based on a cron job set up to fetch header.php?wpcodex=1.

And, a lot of WordPress and bbPress themes include it.

Changes require global testing!

  • It’s a pain to include the header in local environments, since you have to curl w.org/header.php instead of having a dynamic file. It's easier to fork it, but those quickly become out of date.
  • Changes have to be manually copied to the hardcoded Genshi templates for Trac
  • It’s hard to test updates to Trac and the Codex before deploying.
  • Testing the changes across all sites is tedious, and it’s easy to miss something
  • wp4.css is massive, and changes have unintended consequences
  • footer strings have to be copied to pub/wporg/footer.php for localization

Potential solutions

We could:

  • Open source the files. We should do this if nothing else. Maybe make the global header a separate repo with completely self-contained styles, or just commit to meta.svn
  • I think the styles would be easier to maintain, and less fragile, if they were component-ized in the new design, rather than remaining a part of the wp4.css maze. That could still be used by the other themes/systems until they’re migrated to the new parent. We could remove the header/footer styles from wp4.css and move them to some shareable component.
  • create a REST API endpoint to get the HTML for the header/footer. that seems like a more modern version of how some sites will curl https://wordpress.org/header.php to import it.
  • To make global testing easier and more reliable, we could setup e2e screenshot comparisons or something. They might have to be post-deploy given the lack of dev environments for Trac etc, though.
  • Is there a reason Trac doesn’t <iframe> it, or curl-and-cache it like the Codex? Could the Codex <iframe> it for simplicity? probably because submenus/modals can't expand beyond fixed height of the iframe

Refine existing code

Add new features

Launch day

Tracked in #100

Post-launch iteration:

Tracked in #55

@iandunn
Copy link
Member Author

iandunn commented Oct 15, 2021

Now that WordPress/wporg-news-2021#6 is done, it'd be a good time to start thinking about this. It's a big chunk of work that's essential to the launch.

@dd32, do you have any thoughts on any of it? Are there any parts you'd like to do?

@dd32
Copy link
Member

dd32 commented Nov 2, 2021

Is there a reason Trac doesn’t <iframe> it, or curl-and-cache it like the Codex? Could the Codex <iframe> it for simplicity? probably because submenus/modals can't expand beyond fixed height of the iframe

I noted this is mentioned in https://github.com/WordPress/wporg-mu-plugins/blob/trunk/mu-plugins/blocks/global-header-footer/README.md too. It's not possible to iframe it and have a expanding menu that floats over existing content, without using some complicated JS to move the menu from within the iframe to the parent document.

Trac doesn't curl it as there's some complications in the way that Trac Genshi templates work, It's not a straight HTML include but rather a dynamic template language. We could build an endpoint that output the new header in a format that can be included via a curl, that generated something like wporg-head.html & wporg-header.php though.

It might be possible to simply have a JS embed though? So that the "header" is always built on the site via an inline <script src="//wordpress.org/header.php?js_embed=1"></script> that adds required elements to <head> and outputs the <div> directly?

create a REST API endpoint to get the HTML for the header/footer. that seems like a more modern version of how some sites will curl https://wordpress.org/header.php to import it.

This already exists, kind of, for rosetta localised sub-sites. https://de.wordpress.org/?fetch-custom-header=%2Fplugins%2F the Menu is generated on the "main localised site" and that menu (and therefor, all menu items) are then output on the sub-site. There's memcache involved in all that of course. The menu on Rosetta can't be built on a not-main/root-site as Nav Menu's (as used on Rosetta, rather than hard-coded links) can't be generated with a simple switch_to_site() correctly.

@zackkrida
Copy link
Member

Hi folks, chiming in to note that Openverse would also ideally use w.org/header.php and w.org/footer.php once they are updated. Inlined styles and scripts for these parts would be ideal for our use case. I'll keep an eye on things here and if details about our implementation would be useful just let me know.

@ryelle
Copy link
Contributor

ryelle commented Jan 21, 2022

These items are unchecked and don't have corresponding issues:

To make global testing easier and more reliable, we could setup e2e screenshot comparisons or something. They might have to be post-deploy given the lack of dev environments for Trac etc, though.

port any needed features from old footer.php - medium

update hardcoded strings in Learn footer, or make it so that they're not necessary. at the very least, make them DRY across sites. this may be unnecessary after internationalize new header/footer #46, or may be a post-launch thing

Are they still relevant? Are they needed for launch?

@iandunn
Copy link
Member Author

iandunn commented Jan 21, 2022

I just checked off the last two after closing #46. The first was an aspirational thing, but I don't think it's worth it right now.

@iandunn iandunn closed this as completed Jan 21, 2022
@fierevere
Copy link

thank you for completely breaking the UX for forums and translation system.
Very appreciated for making them unusable. Now i can see the global menu, everytime, instead of the content of the forum posts and translation strings. This is really important for all the contributors on the forums and the translators - PERMANENT ON SCREEN MENU!

Also on rosetta sites locale managers are unable to define custom menus, can only add extra items after global menus,
NO LINKS CHANGING, NO SORTING.
Decisions, not options! Truly WordPress way.

@Otshelnik-Fm
Copy link

I have been translating Gutenberg into Russian for several years. Now you have killed the interface. I quit using this service and being active until you remove the huge menu and return the styling of the service interface.

@tellyworth
Copy link
Contributor

Thanks for the feedback, and sorry this has caused issues for Translate! Do you mind posting some screenshots demonstrating the problems you're seeing? It seems that some of them are specific to particular screens and/or window sizes, and the more info we have the better we can fix it.

@tellyworth tellyworth reopened this Jan 24, 2022
@zackkrida
Copy link
Member

When viewing a list of translation strings like https://translate.wordpress.org/projects/wp/dev/dsb/default/?page=4, each translation has its own sticky header and menu:

CleanShot 2022-01-24 at 18 43 58@2x

These can be obscured by the sticky header, which is particularly frustrating on short (namely small laptop and ultrabook) displays:

before
CleanShot 2022-01-24 at 18 49 17@2x

after
CleanShot 2022-01-24 at 18 49 01@2x

@iandunn
Copy link
Member Author

iandunn commented Jan 25, 2022

I created #124 for the sticky element bug.

Closing this since the work that it tracked is done.

@iandunn
Copy link
Member Author

iandunn commented Jan 25, 2022

Some other Translate bugs were fixed in https://meta.trac.wordpress.org/ticket/6037 and https://meta.trac.wordpress.org/ticket/6046

@iandunn iandunn closed this as completed Jan 26, 2022
jazzsequence pushed a commit to jazzsequence/wporg-tools that referenced this issue Dec 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants