Template talk:Diary

From GodWiki
Jump to: navigation, search

This is the talk page for discussing improvements to the Template:Diary page.

  • Be polite
  • Assume good faith
  • No personal attacks
  • Do not bite the newcomers
  • Respond in a mature manner
  • Be welcoming
  • Maintain civility at all times

Can the ability to center these be added, or move them to the right? --Naturalblondechick 03:05, 20 November 2012 (GMT)

Tick.png Done and I've also made sure that the title text is centered (before, even when the width of the box was made large the title text would still stick to the left of it, well not any more now). --Spode 18:32, 20 November 2012 (GMT)

I removed the float. In other words, now text doesn't wrap around the diary boxes. Instead, text just starts on the next line. The float was causing text blocks to become very difficult to read. --BlueStapler 06:03, 22 March 2013 (GMT)

New "default"/"superhero" format, virtually identical to Godville browser interface

OK, just like with Template:Diaryquest, I've created a new style="default" mode for this template (also called style="superhero", and not actually yet the default) which is virtually identical to the current Godville browser interface. In the course of doing this, the old colored styles (sunny, emerald, violet, divine, nightly) — which as far as I can tell were never used — were deprecated, and if they are used anywhere they'll now use the new "superhero" style instead.

All other parameters are respected as documented. Please kick the tires, I'd like to make both of these diary templates the actual default soon, and relegate the current default to explicit style="hero" calls if anyone really wants to keep using it. -- FeRDNYC (talk) 05:54, 21 May 2018 (UTC)

Next planned item (sticking it here so I don't forget): Create a Template:Diary/entry to generate formatted entries inside the diary box. I'm thinking something like:
{{Diary|style=superhero|entries=
  {{Diary/entry|time=HH:MM|text=This is my diary entry}}
  {{Diary/entry|time=HH:MM|text=This is another one}}
}}
...that would properly align the text alongside the time, instead of wrapping under like it does now. -- FeRDNYC (talk) 06:16, 21 May 2018 (UTC)
Looks great, much closer to the real thing! You can check another use case at my user page.
As you were typing your note above about making {{Diary/entry}} I was typing a comment here saying the time column indentation (and possibly white space between diary entries not being a full newline) was the only remaining deviation from the true diary! I'll be glad to test that template if it makes the leap from to-do to done. --Djonni (talk) 06:31, 21 May 2018 (UTC)
Nice, I never even thought of using Template:Diary for non-Diary content, but it seems to work well. Thanks! -- FeRDNYC (talk) 18:38, 21 May 2018 (UTC)

'position' parameter behaving as described, but not behaving as expected

This seems to affect all styles. The documentation states that setting the position parameter to 50% would sit the box "in the middle". Now, that wording is semantically ambiguous, and I read it to mean the same as centred, which is definitely does not. Example:

{{diary | style=superhero | title = Hero's Diary | width=80% | position=50% | text = 07:22 Felt a burning desire to open the gift of fate. Found inside something unbelievable — a scroll with instructions on how to get a premature level up!}}

!Hero's Diary
07:22 Felt a burning desire to open the gift of fate. Found inside something unbelievable — a scroll with instructions on how to get a premature level up!

Now, sure, if I'm using the template I can apply a little brainpower, if I've set width to 80% I should set position to 10%. But that doesn't help if the template is using the default minimum width (as in the superhero style), or being rendered on mobile screens etc, and I can't be certain that my width setting will hold true:

{{diary | style=superhero | title = Hero's Diary | width=10% | position=45% | text = 07:22 Felt a burning desire to open the gift of fate. Found inside something unbelievable — a scroll with instructions on how to get a premature level up!}}

!Hero's Diary
07:22 Felt a burning desire to open the gift of fate. Found inside something unbelievable — a scroll with instructions on how to get a premature level up!

This is especially the case if I'm trying to manually right-align the box on both desktop and mobile screen widths:

{{diary | style=superhero | title = Hero's Diary | width=30% | position=70% | text = 07:22 Felt a burning desire to open the gift of fate. Found inside something unbelievable — a scroll with instructions on how to get a premature level up!}}

!Hero's Diary
07:22 Felt a burning desire to open the gift of fate. Found inside something unbelievable — a scroll with instructions on how to get a premature level up!

It's also flat impossible to correctly align anything with a width specified in px.

Could one simply have an align parameter, with values left, center, and right? This parameter is common to most templates in use in the Godwiki--Djonni (talk) 06:54, 21 May 2018 (UTC)

Yeah, I really hate the current position= logic, it makes no sense to me. I suspect it's also something that's not actually used anywhere, especially since the default "hero" style actually ignored it until yesterday. But the mechanics of it confound me as much as they do you.
Fortunately, because it is controlled via the oddly-named parameter "position", there's no reason that a separate align= parameter can't be provided to enable a more expected left/right/center/none type alignment. (In my thinking, a left- or right-aligned Diary would have its max-width constrained, probably to something like 50-60% — at least by default, though maybe with an override — and text would be allowed to flow alongside it. center- or none-aligned (the default) would not allow text to flow alongside, and they would be center- and left-justified, respectively.) Would that work? (No promises on an implementation timeframe, but I figure if we get the concept nailed down then it's halfway there.) -- FeRDNYC (talk) 18:14, 21 May 2018 (UTC)
(And I didn't even think about how poorly position= would play with mobile rendering. I suspect that wasn't as much of a consideration when it was originally written, but you're right that it makes it even more broken. That being said, any sort of align= is of questionable use on mobile, where it'll probably be pointless in most cases as the box is likely to fill the entire display width.) -- FeRDNYC (talk) 18:17, 21 May 2018 (UTC)

a left- or right-aligned Diary would have its max-width constrained, probably to something like 50-60% — at least by default, though maybe with an override — and text would be allowed to flow alongside it.

I may also have to rethink this, in the context of mobile. Unfortunately, without accesss to modify the site CSS, the options for responsive, media-aware styling are limited; you can't do that sort of logic with inline styles alone. -- FeRDNYC (talk) 18:23, 21 May 2018 (UTC)

──────────────────────────────────────────────────────────────────────────────────────────────────── I went looking at the contribution history of User:Naturalblondechick, who requested the position= parameter, on and after 20 November 2012, and as far as I can tell none of those pages even use it. So, it's possible that position= is not actually used anywhere because of these issues. And I'm tempted to remove it, due to the fact that it works so badly and is doomed to be forever broken on mobile. -- FeRDNYC (talk) 20:47, 21 May 2018 (UTC)

Hmmmmm. Yeah, in fact, speaking of mobile... I'd changed the diary entries in the Herowin article to width=60% because, on the desktop, it formatted better and let the right-aligned images flow alongside the diary entries. But on mobile, the problem is that the width=60% is still respected, as-is. Which sucks, because it creates a situation where you've got a diary box that randomly takes up only 60% of the screen width.
Now, that particular situation can be "solved" (or at least made slightly less bad) by using a fixed pixel width that'd roughly serve to fill the width on mobile screens, but not on the desktop — but that gets into all sorts of shenanigans with different screen resolutions and whatnot. But even just the fact that there's a situation where, say, width=600px might look better than width=60% illustrates the problematic nature of managing width/alignment on desktop vs. mobile. -- FeRDNYC (talk) 23:14, 21 May 2018 (UTC)
I think that, for now at least, being able to specify an align value will be an improvement. The issue of prettifying width for both desktop and mobile can be split off as a separate issue for manyana. FWIW, the same width-on-mobile issue affects Diaryquest. --Djonni (talk) 00:42, 22 May 2018 (UTC)
Well, except they're sort of related, as align= is only meaningful if the box is narrower than the page width (for something that's full-width, all of the alignments reduce to the same thing), and the problem is that width= is mostly-broken on mobile, at least for Template:Diary.
For Template:Diaryquest it's different, because those boxes are meant to be fixed-width. And in fact I just updated it to specify the box width as fixed pixels in all modes, rather than using percentages, because I took a look at it on mobile and you're right — the previous width=30% was completely broken. But that was only because the width was being specified improperly, which was easy enough to fix: here's the before/after comparison in the Android app browser. With a (now) fixed-as-in-repaired, fixed-width diaryquest box, a simple align=none/left/center/right would make sense, and can mostly work as expected.
But with Template:Diary, where the width can be extremely variable, in an ideal situation we'd want to handle the box width/placement more like the mobile skin does for images. If you go to say Herowin in a desktop browser, switch to "Mobile view" using the link at the bottom, then play with the width of the browser, you can see that the images in § Distinctive Features or § The Mayor are smart about their placement — they stay aligned right and allow text to flow left of them when the browser is wide enough, then when it gets too narrow they automatically snap to center alignment with no next alongside. The Template:Diary boxes, OTOH, always occupy the specified 60% of the width, no matter what that width is, which starts to look pretty bad when the window gets narrow.
The images are able to be smart because the Minerva skin (used on mobile browsers, or in the "Mobile view" mode on the desktop) contains responsive CSS that manages the placement and alignment of images based on the device width. Ideally we'd want to do something similar with the Diary and Diaryquest boxes. They'd respect their supplied width and/or alignment parameters as long as the display area is wide enough, then automatically shift to occupying the full width on narrower displays. (Same thing for the infobox at the top, which you may notice tries to be sorta-responsive, but does weird things at narrow widths.)
Without the ability to be responsive to device width, I'm not sure how smart it is to even provide align= for Template:Diary, since anywhere it's used will likely look pretty bad on mobile devices. There isn't a lot of point to providing a parameter if you have to tell people, "You shouldn't use this because it will screw up the mobile rendering." (And in fact I'll probably take the width=60% out of those Herowin diary boxes soon, now that I've seen what that looks like on my phone.) -- FeRDNYC (talk) 08:26, 27 May 2018 (UTC)