Deleplace/programming-idioms

[BUG] Right bar: Cheatsheet doesn't show up

Closed this issue · 2 comments

When a user comes to an impl detail page in language X from a search engine and this is their first visit, the link the "Cheatsheet X" is not displayed.

On first visit, a user doesn't have any favlang cookie yet.

The sequence is:

  • the impl page is generated and served, taking into account the current (empty) favlang list from the (nonexistent) cookie
  • then some JS adds the language X of the current impl in the user's cookies
  • then subsequent pageviews take X into account when producing the rightbar Cheatsheets section.

The rightbar is currently server-side rendered. We should either (a) tell the server to explicitly take the "current page" context into account, or (b) add some JS processing to inject things into the rightbar after the initial render.

(a) is preferred.

(a) would mess a little with the favlang bar, so (b) was implemented