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

Improve page layout #4473

Open
Jermolene opened this issue Mar 6, 2020 · 47 comments
Open

Improve page layout #4473

Jermolene opened this issue Mar 6, 2020 · 47 comments

Comments

@Jermolene
Copy link
Owner

Jermolene commented Mar 6, 2020

UPDATE 6th June 2021:

I've now implemented this new layout as part of the work on the https://twpub-tools.org/ project. I plan to work on it more there, working towards a proposal for the core:

https://github.com/TWPUB/TWPUB-Tools


We have a number of long-standing problems with the layout of the story river, sidebar, position sticky headings and any toolbars:

  • The relationships between the window width, story river width and the sidebar width is confusing, and hard to customise
  • The scrollbars for the story river and the sidebar are both pushed to the far right of the screen, and are hard to distinguish
  • Sticky titles behind MenuBar #4471 - We can only use a fixed offset to move sticky titles below a top menu, even with dynamically sized top menu bars (like the new menubar plugin)
  • We have to use hacks to make sure that scrolling to the top of a tiddler takes into account any top menu bar

the current layout is the result of overlaying three independent components: the story river, the sidebar, and the new menu bar. Their layout is entirely independent: we just arrange margins and padding to try to stop them blotting each other out. That's the fundamental problem with the current layout that we keep running into: whenever we change the layout of one of those three page components we have to meticulously adjust the layout of the others.

It is proposed to explore an alternative layout based on CSS flexbox. It's entirely fluid, with the page components flowing to take up the available space. Flexbox gives us a lot of flexibility for how those components react to the screen size changing too.

As a first step, here's a mockup of TW5's layout built with flexbox: https://codepen.io/jermolene/pen/mdJBqGz

image

The implementation is pleasantly clean; there are no magic numbers, and everything lines up without having to do anything special. However, the required HTML structure is not compatible with the present page template.

The flexbox solution is adaptive; if one inserts another .toolbar beneath the closing </main> tag then one gets a toolbar fixed to the bottom of the window, with everything smoothly adjusting to make room. Additional sidebars can be added in the same way. CSS Grid requires the entire layout to specified in one place, and doesn't have that same adaptability. We need the adaptability because of the way that TW5 works: we want users to be able to add another horizontal bar by adding a new tiddler with the tag $:/tags/HorizBar (say), without having to fiddle with CSS as well. That's rather the point of this change, in fact

The way that the layout proposed here works is that first the screen is divided into horizontal strips, one for the toolbar and one for the story river and sidebars. The so-called "main" strip is automatically resized to fit all of the strips onto the screen at once.

Then the main strip is further divided into vertical strips: the difference between a sidebar and a story river is that the sidebars have fixed width and the story river(s) expand to fill the available space.

Applying all of this to TiddlyWiki, there would be new system tags for adding horizontal strips, and for adding vertical strips within the main strip. Some of the strips would themselves be composed from system tags -- for example, the menu bar is composed from system tags identifying menu items.

For the record, I also did some initial experimentation with a CSS grid implementation, and concluded:

  • CSS Grid doesn't work in IE11, and I don't think we're quite ready to totally break IE11 support
  • So, I don't think we can use CSS grid for the page layout, but it's important to note that the HTML layout required for flexbox would also be compatible with css grid.
@kookma
Copy link
Contributor

kookma commented Mar 6, 2020

@Jermolene
Please also take in account the animation effects and the way storyview like zoomin, classic and solo work!

I hope this PR could address also the odd behavior of those story views.
It should be possible to simply go to presentation mode (e.g. fullscreen + focused tiddler cover the whole viewport)

@kookma
Copy link
Contributor

kookma commented Mar 6, 2020

@Jermolene

The https://codepen.io/jermolene/pen/mdJBqGz resembles the single page layout which is quite useful to create website using Tiddlywiki.

@kookma
Copy link
Contributor

kookma commented Mar 6, 2020

@Jermolene
For having two scrollbars, I see the below template
https://colorlib.com/preview/#vcard2

Look at the very tiny scrollbar under description.

One more thing is: The TW page layout shall adjust itself fluently to mobile/tablet/desktop/widescreen size devices.

@Jermolene
Copy link
Owner Author

Hi @kookma

Please also take in account the animation effects and the way storyview like zoomin, classic and solo work!

The issues you've run into are largely due to the way that the current page layout requires the story river to be sized explicitly, rather than just filling its container.

It should be possible to simply go to presentation mode (e.g. fullscreen + focused tiddler cover the whole viewport)

If the DOM representation of a tiddler in full screen mode required deletion and recreation as part of the refresh cycle then it would pop out of full screen mode. So, as I think we've discussed elsewhere, it's better to put the entire window into full screen mode, and use the new solo with the sidebars/toolbars hidden by CSS.

For having two scrollbars, I see the below template. Look at the very tiny scrollbar under description.

The problem isn't that there two scrollbars, it's that the positioning of them is currently wrong.

@Jermolene
Copy link
Owner Author

I've updated the original post with some notes about CSS grid.

@kookma
Copy link
Contributor

kookma commented Mar 6, 2020

@Jermolene
Thank for clarification. By the way what I expect is in a page layout overhaul, those issues and drawbacks already addressed should be take in account. Also the layout should dynamically lend itself to different device sizes nowadays are used.

Thank you again!

@kookma
Copy link
Contributor

kookma commented Mar 6, 2020

Hi @kookma

Please also take in account the animation effects and the way storyview like zoomin, classic and solo work!

The issues you've run into are largely due to the way that the current page layout requires the story river to be sized explicitly, rather than just filling its container.

True!

If the DOM representation of a tiddler in full screen mode required deletion and recreation as part of the refresh cycle then it would pop out of full screen mode. So, as I think we've discussed elsewhere, it's better to put the entire window into full screen mode, and use the new solo with the sidebars/toolbars hidden by CSS.

That is right! I hope we could have solo final release soon.

@twMat
Copy link
Contributor

twMat commented Mar 7, 2020

I'm very much in favour of a css overhaul.

Suggestion: Make a Holy Grail layout as default but with left sidebar and footer inactive/empty.

Or, considering that...

One obvious conclusion is that the required HTML structure is not compatible with the present page template.

...maybe there could be multiple page templates? Might this simplify designing futher Story Views?

Somewhat off-topic: I hope a Stylesheet overhaul will take the opportunity to chunk up the stylesheet monoliths into tiddlers.

@AnthonyMuscio
Copy link
Contributor

Folks, I applaud your work on this but would ask if you can consider the following

  • Make the page template (more) plugable and selectable, this could allow others to innovate
  • Perhaps a page template could revert to a default on a particular browser eg IE11?
  • a special view that highlights each area and the tags required to have content appear there would facilitate use, even if this is provided as a separate plugin, or utility edition.
  • A special view that provides interactive resizing of the relationship between various page elements may be as good or better than developing a whole new page layout, as long as we have catered for all possible elements including floating ones.

Regards
Tony

@Jermolene
Copy link
Owner Author

Hi @AnthonyMuscio

Make the page template (more) plugable and selectable, this could allow others to innovate

We will probably make the page template switchable, but I'm not sure what else you're thinking of here.

Perhaps a page template could revert to a default on a particular browser eg IE11?

That would be theoretically possible but I'd be very concerned that it would introduce inconsistencies that would make support and subsequent development much more difficult.

a special view that highlights each area and the tags required to have content appear there would facilitate use, even if this is provided as a separate plugin, or utility edition.

I think it would be much easier to do that as an illustration, it would be very complicated to try to integrate those labels into the layout without disrupting it.

A special view that provides interactive resizing of the relationship between various page elements may be as good or better than developing a whole new page layout, as long as we have catered for all possible elements including floating ones.

Again, you'd have to explain this a little more.

To explain things another way, the current layout you see on the prerelease is the result of overlaying three independent components: the story river, the sidebar, and the new menu bar. Their layout is entirely independent: we just arrange margins and padding to try to stop them blotting each other out.

That's the fundamental problem with the current layout that we keep running into: whenever we change the layout of one of those three page components we have to meticulously adjust the layout of the others.

That's what changes with the proposed new layout: it's entirely fluid, with the page components flowing to take up the available space. Flexbox gives us a lot of flexibility for how those components react to the screen size changing too.

@kookma
Copy link
Contributor

kookma commented Mar 11, 2020

That's what changes with the proposed new layout: it's entirely fluid, with the page components flowing to take up the available space. Flexbox gives us a lot of flexibility for how those components react to the screen size changing too.

This is great! while I am note sure flexbox or modern grid option, BUT I propose the page should have all essential element even if all of them are not used in the current release.

I mean this layout

  • Header (or top bar)
  • Footer (or bottom bar)
  • Left sidebar
  • Right sidebar
  • Story river (main body)

This way one can customize the design and choose UI elements and create a blog, a website or a wiki or a noteApp, ...

What is proposed now has only top and right bar and a story river

@twMat
Copy link
Contributor

twMat commented Mar 12, 2020

@kookma - what you describe is known as The Holy Grail layout (because).

I just realized that the ideal might be two right sidebars. One with the usual tools and one empty/collapsed. It is not all uncommon that the user wants a right side public menu (after he hides the tool sidebar).

@pmario
Copy link
Contributor

pmario commented Mar 12, 2020

I'd like to have several story rivers. 3 or 4 make a nice fit for ultra-wide screens

@Jermolene
Copy link
Owner Author

Hi @twMat @kookma @pmario I'm not doing a good job of explaining things!

The whole point of this layout is that one can just drop in additional toolbars, story rivers and sidebars and the layout just adapts automatically. You can experiment directly in CodePen, but perhaps I should add some JS buttons to make things a bit more obvious.

Also, the "holy grail layout" is not really any help because in it's classic form the page scrolls as a whole, they don't usually have our approach of separately scrolling the sidebar(s)/river(s).

@kookma
Copy link
Contributor

kookma commented Mar 12, 2020

@Jermolene

Question: does it mean no left sidebar/footer(bottom bar) will be available in new page layout? Or it means, these can be done by intermediate users.
Here I dont want to have holy grid in view, but I mean just placeholders, on demand can be revealed and used.

I love the current right sidebar and fluid storyriver, but in some applications like software tutorial e.g

one likes to have left sidebar and a footer. Or when a website is made using TW.

Similar solution by JD

But these are not straight forward to customize and they overwrite several core tiddlers.

@Jermolene
Copy link
Owner Author

Hi @kookma

Question: does you it mean no left sidebar/footer(bottom bar) will be available in new page layout? Or it means, these can be done by intermediate users.

No, I just mean that the various "holy grail layouts" that you find on the web are not actually suitable for TiddlyWiki because they scroll the page, rather than independently scrolling the story river and sidebar as we do.

I love the current right sidebar and fluid storyriver, but in some applications like software tutorial e.g

Yes, the layout proposed here supports arrangements like a left sidebar and a footer.

@Jermolene
Copy link
Owner Author

I've updated the CodePen with buttons to create/delete page components.

image

@Jermolene
Copy link
Owner Author

In case you want to experiment without the CodePen paraphernalia, here's a plain HTML version.

layout.html.zip

@kookma
Copy link
Contributor

kookma commented Mar 12, 2020

@Jermolene
This is absolutely great! With this layout one can make different web apps.

@kookma
Copy link
Contributor

kookma commented Mar 12, 2020

@Jermolene

I did some experiments. It is really cool!
Good to add ''Remove All Story rivers" just when playing :-). It is full of fun!

I love the immobilize header/footer/sidebar. I intentionally do not use sticky!
With this layout making software tutorial/manual like Sphinex is a piece of cake.

@AnthonyMuscio
Copy link
Contributor

Sorry, I am a jhonny come lately, I tried to express this in a GG thread.

The layout example is great, and two stories has much potential, if same or different.

I found a layout for printed pages which provides an even more comprehensive set of locations If the rows and columns are defined correctly the page responds when content is present only. With such a layout I doubt there would be any missing positions.

To help even further these can be used when printing as well using the media styles etc...

page-layout

@kookma
Copy link
Contributor

kookma commented Mar 13, 2020

@Jermolene

In case you want to experiment without the CodePen paraphernalia, here's a plain HTML version.

layout.html.zip

I played a bit more with this layout and found on small screen the footer is better to stick at the bottom of story river so I may suggest:
Story river is good to have a footer (bottom bar). This is good when TW is used on small screen (or even lower resolution screen) and it is better on scroll bottom bar move!

I think the next ingredient is to see how layout is responsive on different screen size!

@Jermolene
Copy link
Owner Author

Hi @AnthonyMuscio I'm not sure what you're proposing; that illustration appears to be a naming scheme for areas of a page margin, I'm not sure why that is relevant?

@Jermolene
Copy link
Owner Author

Hi @kookma I'm glad you're enjoying it!

I played a bit more with this layout and found on small screen the footer is better to stick at the bottom of story river so I may suggest:

Sticky footers are actually quite hard to use on iPhones because touching the bottom of the screen usually causes the browser toolbar to appear, which shifts the footer up the screen.

I think the next ingredient is to see how layout is responsive on different screen size!

Yes indeed. With this layout we'll be able to selectively hide the sidebar for small screens and have everything else flow to take up the space.

@BurningTreeC
Copy link
Contributor

This layout is very fun to play with, thanks @Jermolene for the pen and the mockup html 😄

What I'm wondering is if navigation needs a big overhaul? I tried to apply the styles to an empty tiddlywiki with an edited pagetemplate and noticed that navigation didn't work anymore

@BurningTreeC
Copy link
Contributor

I thought it's probably the pagescroller that needs to get the correct scrolling element

@Jermolene
Copy link
Owner Author

Hi @BurningTreeC that's correct, rather than using CSS overflow: scroll we need to use a <$scrollable> widget.

@BurningTreeC
Copy link
Contributor

Nice to read that there's a plan @Jermolene 👍

@AnthonyMuscio
Copy link
Contributor

AnthonyMuscio commented Mar 13, 2020 via email

@Jermolene
Copy link
Owner Author

Hi @AnthonyMuscio I'd really like to understand what you're proposing. Perhaps some sketches would help?

The way that the layout proposed here works is that first the screen is divided into horizontal strips, one for the toolbar and one for the story river and sidebars. The so-called "main" strip is automatically resized to fit all of the strips onto the screen at once.

Then the main strip is further divided into vertical strips: the difference between a sidebar and a story river is that the sidebars have fixed width and the story river(s) expand to fill the available space.

Applying all of this to TiddlyWiki, there would be new system tags for adding horizontal strips, and for adding vertical strips within the main strip. Some of the strips would themselves be composed from system tags -- for example, the menu bar is composed from system tags identifying menu items.

@joshuafontany
Copy link
Contributor

joshuafontany commented Mar 13, 2020 via email

@AnthonyMuscio
Copy link
Contributor

Jeremy,

Hi @AnthonyMuscio I'd really like to understand what you're proposing. Perhaps some sketches would help?

The image I shared earlier was as much of a sketch I can think of giving you.

I think the essence of my argument is not being happy with a simple bar header/footer, but pre-provisioning all the elements in the page in the image I gave, whether they are used or not. But dividing both headers and footers and left and right sidebar into 5 elements perhaps with the central element by default fixed on scrolling it is possible to reproduce the current tiddlywiki layout.

Each of these elements could be given default css so they are practical to use, such as top and bottom centres being centred, left and right inner and corners text aligned right, the left and right centre items fixed on scrolling etc...

I imagine a config panel tab with this layout diagram where one could click to activate each element. and set its width or hight (or leave it to respond to the content).

The ultimate would be if you could choose additional rows or columns, for example two header rows, the top using left and right elements and logo in the centre one, then a second header row using only the centre element containing the site name or main menu. Two columns on the left would be a double side bar one of which appears on hover etc...

The diagram is comprehensive but we could add above story and below story as elements and the top and bottom of the story river(s).

Have I made this any clearer for you Jeremy?
I could produce a detailed specification if you would like

Thanks for your patience.

I am inspired by what you have already shared.

@AnthonyMuscio
Copy link
Contributor

PS, If multiple stories are available I can imagine being able to have a fixed or scrollable left / centre / right element at the top/bottom of each story "window".

@Jermolene
Copy link
Owner Author

Hi @AnthonyMuscio I don't see a way to square your suggestion with the way that the layout proposed here works. As discussed above, it uses flexbox to divide the window into horizontal slices, the main one of which is also divided into vertical strips. That's fundamentally different than your diagram, and provides much more flexibility. Note that there's nothing to stop one subdividing the slices/strips further into the 5 chunks you propose, again one would use flexbox for this.

@dubiouscript
Copy link

scanningg through the above and trying to grock 'wtf is flexbox'

i found this (Full-Screen Layout using Flexbox)

http://bl.ocks.org/jfsiii/5380802#aGrail

@AnthonyMuscio
Copy link
Contributor

Jeremy,

Note that there's nothing to stop one subdividing the slices/strips further into the 5 chunks you propose, again one would use flexbox for this.

Your codepen example is great, I am just asking if we can take the headers and sidebars a little further to pre-provision "all possible" page design elements.

I am not dictating the method. I am suggesting doing this five element model vertically and horizontally even if is an alternate configuration. The idea is to make the whole thing responsive as I expect flex box would.

In effect I am proposing to pre-provision the elements just as we use above story etc... which are hidden unless they contain content. If designed well one could use the centre header element and set it to 100% to match your code pen example

The idea is the element will not be displayed if it has no content. By simply choosing which elements have content will describe the wikis overall layout. This model is comprehensive and would also lend itself to responding to mobile screens and if choosing to print the window. The centre horizontal and centre vertical would move with the scroll of the story, if you want a fixed sidebar you use the fixed element,

I would be tempted to add

  • another header row that scrolls away under fixed top row.
  • another footer that is at the bottom of the story (unlike a sticky on on the screen)

Whilst you see my example of positions on the page, as margins. I am looking at them as left and right sidebars, and headers and footers that allow page left (on top of left sidebar), top left of story, Top centre of story, top right of story, page top right sidebar, and similar vertically and in the footer.

More advanced issues are if you permit additional stories then they could have independent Left Centre Right fixed and sticky headers and footers that appear only if they contain content.

I hope my idea is clearer.

Reagrds
Tony

@twMat
Copy link
Contributor

twMat commented Apr 16, 2020

Here's something I wish to be possible with a new layout, even if not implemented right away:

Toggle some kind of "change layout" mode and the page elements become drag'n drop that snap to different places as you drag them around. E.g you grab the sidebar and move it to the left page side. Or you grab a sidebar tab and move it into another position among the tabs.

This would be a very user friendly "high-level hacking" approach to customize ones wiki.

@rmunn
Copy link
Contributor

rmunn commented Dec 1, 2020

Found a couple very interesting side effects of anchor links in the new layout demo from #4473 (comment). Basically, anchor links will scroll down to bring the new item into view (at the correct position) but won't scroll up. Tested on Firefox and Chromium on Linux, both by clicking links and by typing the appropriate hash part into the URL (e.g., I edited my URL bar to read "layout.html#heading2" and pressed Enter). I won't have time to pin it down and create repro steps until a couple weeks from now, at which point I'll add screenshots and a proper repro.

@bimlas
Copy link
Contributor

bimlas commented Dec 3, 2020

Although this is only partly related to the topic, see if it can give you ideas:

I created a theme that, instead of using a single large CSS, loads CSS components that only perform a specific task. Components can use settings, the interface required for this is defined by the component itself. I store the current settings in a theme tiddler that lists what components it uses and includes the component settings in its fields so we can easily store and switch between different "sets". Exporting a theme actually means exporting theme ("set") tiddler and component tiddlers, so if someone imports it into their own wiki, they can use those components again in other theme in different combination.

I would find it a good idea if the page components would work similarly. Currently, there is no way to easily turn stylsheet tiddlers on and off (the only way to turn them off is to remove the system tag), based on this, it is likely that page components would work similarly, making it difficult for users to they can easily try different combinations. The importance of easy modification is told by Brad Victor in Inventing on Principle.

@kookma
Copy link
Contributor

kookma commented Dec 3, 2020

@bimlas
Your modular approach is highly appreciated. TW itself is modular, see how simple one can add a sidebar tab by assigning proper tag to a tiddler. Why not having this for theme!
Right now the Tiddlywiki Theme hacking is out of knowledge of most beginner and intermediate users, one reason is the complexity of css is used. So I recommend your approach and hope we could have a similar design for core themes.

@rmunn
Copy link
Contributor

rmunn commented Dec 4, 2020

@bimlas -

Just posted a comment on your wiki, but got a notice saying that Disqus comments are "currently in maintenance mode" so I'm not sure you saw it. So I'll reproduce it below.

Although I do have a Disqus account, I'm starting to think it's a bad idea to use Disqus due to privacy concerns (they're an ad company and use what you post to figure out how to target ads to you, and they have sold user data without users' consent). See https://markosaric.com/remove-disqus/ for the problem and https://ourcodeworld.com/articles/read/1265/top-7-best-open-source-self-hosted-comment-system-alternatives-to-disqus for some alternatives. I haven't explored any of them yet, but https://github.com/schn4ck/schnack looks like the best alternative for a TiddlyWiki comment system as it's written in nothing but Javascript and CSS.

@offray
Copy link

offray commented Jan 2, 2021

Although this is only partly related to the topic, see if it can give you ideas:

I created a theme that, instead of using a single large CSS, loads CSS components that only perform a specific task. Components can use settings, the interface required for this is defined by the component itself. I store the current settings in a theme tiddler that lists what components it uses and includes the component settings in its fields so we can easily store and switch between different "sets". Exporting a theme actually means exporting theme ("set") tiddler and component tiddlers, so if someone imports it into their own wiki, they can use those components again in other theme in different combination.

* Demo: https://bimlas.gitlab.io/tw5-modular-theme-maple-palette/

* GG thread: https://groups.google.com/g/tiddlywiki/c/p98mltuihyI

Thanks for those, which are pretty timely as the whole discussion, as I was exploring a mobile friendlier TiddlyWiki.

Do you know Bricks? I think that the approaches on Bricks Studio and yours are complementary, as both are modularizing CSS in TW, but Bricks if focused on speed, yours on live modifiability and the flex based TW of this issue opening a door for both. I wonder if we could have a live modifiable Modular theme in Bricks Studio that "compiles" to a pretty fast theme, for site delivery and offline reading.

I would find it a good idea if the page components would work similarly. Currently, there is no way to easily turn stylsheet tiddlers on and off (the only way to turn them off is to remove the system tag), based on this, it is likely that page components would work similarly, making it difficult for users to they can easily try different combinations. The importance of easy modification is told by Brad Victor in Inventing on Principle.

I really like that talk. Recently I was playing trying to bridge Pharo and TiddlyWiki as both are two pretty powerful self referential metasystems with live modification support. The idea is to combine them with Fossil to build a "Pocket Infrastructures" toolkit to create and deliver hypertextual content in places with low/intermittent Internet connectivity.

@BurningTreeC
Copy link
Contributor

I got this new layout working 👍
@Jermolene, we could add this as a second page layout, what do you think?

@pmario
Copy link
Contributor

pmario commented Jun 6, 2021

Is there a demo?

@Jermolene
Copy link
Owner Author

I got this new layout working 👍
@Jermolene, we could add this as a second page layout, what do you think?

I've already implemented the layout in the OP in TWPub:

https://twpub-tools.org/

I plan to work on it more within TWPub, but it will eventually become a core proposal.

@BurningTreeC
Copy link
Contributor

perfect @Jermolene, I didn't know about your TWPub project 👍

@Jermolene
Copy link
Owner Author

perfect @Jermolene, I didn't know about your TWPub project 👍

No worries, I'll update the OP.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests