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

Add true "single tiddler mode" #3412

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open

Add true "single tiddler mode" #3412

wants to merge 33 commits into from

Conversation

Jermolene
Copy link
Member

@Jermolene Jermolene commented Aug 26, 2018

UPDATE 29th JUNE 2021: See this comment for the current status of this work.


As @twMat noted in #1938 nearly three years ago, the current "zoomin" storyview suffers from some annoying limitations/quirks. This PR adds a proper "single tiddler mode" to the core in which only a single tiddler is displayed in the story river.

The changes involved are:

  • Storyviews now expose a static "singleTiddlerMode" property to determine if they require single tiddler mode
  • Navigator widget adds a "singleTiddlerMode" attribute; when set to "yes", the story list is entirely replaced during navigation
  • Navigator widget now updates "list" field of $:/HistoryList with a more accessible version of the history list
  • Add a getstoryviewsingletiddlermode[] operator so that we can obtain the story view STM status for passing to the navigator widget
  • Add "History" sidebar tab because it is much more useful than the existing "Open" tab when in STM. However, I do not want to add another top level sidebar tab, so will need to find another way to handle this

There are still some issues to be resolved:

  • The story river isn't yet adjusted when switching to a story view with STM enabled
  • The usual zoomin animation is broken
  • $:/DefaultTiddlers isn't yet adjusted, so multiple tiddlers are currently being opened at startup

Update 20th January 2020:

These commits add a new "solo" storyview that presents a single tiddler at a time without any animation, making it much simpler to style than the "zoomin" storyview with its dynamic animations.

* Storyviews expose a static "singleTiddlerMode" property to determine if they require single tiddler mode
* Navigator widget adds a "singleTiddlerMode" attribute; when set to "yes", the story list is entirely replaced during navigation
* Navigator widget now updates "list" field of $:/HistoryList with a more accessible version of the history list
* Add a getstoryviewsingletiddlermode[] operator so that we can obtain the story view STM status for passing to the navigator widget
Much more useful than the "open" tab when in single tiddler mode
@Jermolene
Copy link
Member Author

There has been some discussion of these changes in this Google Groups thread.

Based on that feedback, I've posted an update to https://tiddlywiki.com/prerelease with a couple of further changes:

  • The tiddler 'close' button now navigates to the previous tiddler in the history stack
  • The "open" tab in the sidebar now mutates into a "history" tab when single tiddler mode is engaged

I consider this to be a major change to TiddlyWiki, and so would welcome feedback from everyone but I'll mention @giffmex @jdjdjdjdjdjd @telmiger as they may not be tracking this PR.

The questions I'm curious about:

  • What do people think of the new behaviour of the "open" tab? It doesn't feel like a great solution to me -- there's no precedent for tabs coming and going elsewhere. But equally, I didn't like having "history" as a separate tab
  • Is the navigating backwards action on "close tiddler" working as you'd expect?

It would also be interesting to test these changes against the kind of plugins and hacks that manipulate the story list.

@giffmex
Copy link
Contributor

giffmex commented Aug 31, 2018 via email

@giffmex
Copy link
Contributor

giffmex commented Aug 31, 2018 via email

@giffmex
Copy link
Contributor

giffmex commented Aug 31, 2018

oops, sorry, I hit reply in my work email and that adds the long and religious signature that some people do not appreciate.

@pmario
Copy link
Member

pmario commented Aug 31, 2018

@giffmex ... It's the "zooming" story view

@Jermolene
Copy link
Member Author

Jermolene commented Aug 31, 2018 via email

Export our filter functions
*/

exports.getstoryviewsingletiddlermode = function(source,operator,options) {
Copy link
Member

Choose a reason for hiding this comment

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

wouldn't it be better to have a function "getstoryviewmode", that returns the mode name? ...

IMO we would need a new function for every other existing and future mode too!

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @pmario good point, I'll fix.

@giffmex
Copy link
Contributor

giffmex commented Aug 31, 2018

Ahh thank you, Mario and Jeremy. I assumed zoomin was going to continue being its own thing and that single tiddler mode was going to be separate. I have to run, but when I come back I will experiment and give feedback.

@@ -14,7 +14,7 @@ tc-page-container tc-page-view-$(storyviewTitle)$ tc-language-$(languageTitle)$

<$set name="storyviewTitle" value={{$:/view}}>

<$set name="tv-storyview-single-tiddler-mode" value={{{ [<storyviewTitle>getstoryviewsingletiddlermode[]] }}}>
<$set name="tv-storyview-single-tiddler-mode" value={{{ [<storyviewTitle>getstoryviewmode[singletiddlermode]] }}}>
Copy link
Member

Choose a reason for hiding this comment

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

I'm not sure, but I think the history-tab caption needs to be changed too?

Copy link
Member Author

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

ok

@giffmex
Copy link
Contributor

giffmex commented Aug 31, 2018

Feedback viewing on Windows laptop: great! 1) in other story views, the tiddlers slide to the top of the screen. I never liked before that sometimes tiddlers would open toward the bottom of the screen. 2) In Zoom only one tiddler open at a time, probably helps avoid the sluggishness of having a heap of tiddlers open at a time. And as probably everyone knows, zoomin is one of the first changes I make to a TW. 3) I do like the alternating between history and open when you change storyviews. However I had an idea: what about having only a history tab, where the first section is open tiddlers and below the open tiddlers is another list of 'recently opened' tiddlers? It would look similar to search results, which are similarly divided into two sections, title matches and all matches. That would avoid both problems: having two separate tabs, and having a tab change names, which could be confusing to new users. Regardless, I really like this new feature of single tiddler mode. Very nice!

@giffmex
Copy link
Contributor

giffmex commented Aug 31, 2018

Forgot to add: in my idea of having two sections in a history tab, in story view mode, the 'Open tiddlers' section at the top would only have one tiddler listed, and the 'Recently opened' tiddlers would be longer. In other modes, the 'Open tiddlers' section at the top would have more tiddlers, but usually not too many, and the 'Recently opened' tiddlers list would be shorter, only those tiddlers actively closed. And you could have a close all tiddlers at the top.

@Jermolene
Copy link
Member Author

Thanks @giffmex!

Feedback viewing on Windows laptop: great! 1) in other story views, the tiddlers slide to the top of the screen. I never liked before that sometimes tiddlers would open toward the bottom of the screen. 2) In Zoom only one tiddler open at a time, probably helps avoid the sluggishness of having a heap of tiddlers open at a time. And as probably everyone knows, zoomin is one of the first changes I make to a TW. 3) I do like the alternating between history and open when you change storyviews.

Great!

However I had an idea: what about having only a history tab, where the first section is open tiddlers and below the open tiddlers is another list of 'recently opened' tiddlers? It would look similar to search results, which are similarly divided into two sections, title matches and all matches. That would avoid both problems: having two separate tabs, and having a tab change names, which could be confusing to new users. Regardless, I really like this new feature of single tiddler mode. Very nice!

The first issue is that one list above the other makes it hard to find the second list if the first is long.

But the deeper problem is that the "open" list is still displayed when in single tiddler mode, and it's always going to be redundant: it'll never contain more than a single tiddler, and using the close button won't have the expected effect.

Meanwhile, I'd argue that the "history" list isn't useful when one is not in single tiddler mode because one can accomplish everything with the "open" tab and more (drag and drop, using the mini close buttons etc).

@giffmex
Copy link
Contributor

giffmex commented Aug 31, 2018

My second comment above was trying to say that the second list wouldn't be difficult to find if the first list is one tiddler in storyview mode. Also, while redundant, the one item open list might give a new user a comforting feeling that this tab works, because what he sees on the screen is what is in the open tiddlers list.

In other modes, I doubt that in one session of use of a file that the user will have either too many open tiddlers or too many recently closed tiddlers. Some users probably leave everything open, in which case the history list is not as needed, like you say. And other users may close most tiddlers except those they are working on, so the open list will be short and the recently closed list will be accesible. I understand your reserve, but I still think it is worth experimenting with.

@kookma
Copy link
Contributor

kookma commented Jan 21, 2020

@Jermolene
I cannot set tiddler to cover the whole screen. I am not sure if any new CSS classes is used for solo story view!

In the current zoomin story view, I set the below CSS to let a tiddler cover the whole screen! but
in solo story view this seems not work!

body.tc-body .tc-story-river {
  width:100%;
}

body.tc-body .tc-storyview-zoomin-tiddler{
top:0; left:0; margin:0;
width:100%;
}

body.tc-body .tc-tiddler-frame {
    border: 0;
    height:100vh;
}

@kookma
Copy link
Contributor

kookma commented Jan 21, 2020

@Jermolene

Also there seems the padding and margin setting for tiddler-frame, and tiddler-body, tc-story-river are different!
More important it seems the selector are also different.

this.openLinkFromInsideRiver = this.getAttribute("openLinkFromInsideRiver","top");
this.openLinkFromOutsideRiver = this.getAttribute("openLinkFromOutsideRiver","top");
this.singleTiddlerMode = this.getAttribute("singleTiddlerMode","no") === "yes";
this.relinkOnRename = this.getAttribute("relinkOnRename","no").toLowerCase().trim() === "yes";
this.setVariable("tv-story-list",this.storyTitle);
Copy link
Member

Choose a reason for hiding this comment

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

this is all super ugly! IMO it shouldnt be that way

Copy link
Member Author

Choose a reason for hiding this comment

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

This is consistent with how all the core widgets manage their attributes.

Copy link
Member

@pmario pmario Jan 21, 2020

Choose a reason for hiding this comment

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

Yes, but that's not the point I wanted to make. ... The navigator widget shouldn't be responsible to handle views. It's the story and storyviews in combination, which need to handle the stuff.

So If an event wants to pass any parameter through, it need to be dynamic and not hardcoded like this one.

We do have the paramObject which can hold any additional parameters the users and plugin authors may want to send to the navigator event handler.

I want the stuff to be dynamic and there shouldn't be a core PR necessary if new parameters like this one are needed by a new function.

It's OK if you make it. It gets merged, but if anyone else wants new params the chance is way to low. ... So I do want a solution, similar to the linkcatcher that I used for the new "story manager stuff" I'm creating. see: https://github.com/pmario/TiddlyWiki5/blob/dbf32fdef66196fb389ad55665b2f2c84991b65f/core/modules/widgets/linkcatcher.js#L75

linkcatcher has parameters that are OK, but can't be used for the new tm-load-story message. I needed different params. With the mechanism I propose it will be simple, to create new tm-xxx plugins without the need to modify linkcatcher or navigator. They just pass through the paramObject

also see: https://github.com/wikilabs/plugins/blob/8b85e7b8d66b0b4dd7c7f3fc213a22501e633f44/wikilabs/wltm-open-story/tiddlers/open-story.js#L42 where the paramObject defined above AND sent by a user can be used.

Usage can be seen at: https://github.com/wikilabs/editions/blob/eca970252a441c2612239453c01d406da7519d75/wltm-open-story/tiddlers/%24__core_ui_AdvancedSearch_Story_Tabs_template.tid#L8

and: https://github.com/wikilabs/editions/blob/eca970252a441c2612239453c01d406da7519d75/wltm-open-story/tiddlers/%24__core_ui_SideBar_Stories.tid#L20

I think, that's the mechanism we should use to add unknown future parameters to navigator and story related widgets.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @pmario I think you're proposing a mechanism whereby widgets that dispatch events can specify the paramObject hashmap by using unknown attributes. Why wouldn't one use the action-sendmessage widget in such situations?

I don't quite understand how the proposal would be applied in this case? Which message is involved?

@Jermolene
Copy link
Member Author

Hi @kookma the zoomin storyview uses some intricate CSS to make the animations work. The new solo storyview uses the same CSS as the classic storyview; it's exactly like classic storyview, except there are no animations, and the storylist is restricted to only hold a single tiddler.

@kookma
Copy link
Contributor

kookma commented Jan 21, 2020

Hi @kookma the zoomin storyview uses some intricate CSS to make the animations work. The new solo storyview uses the same CSS as the classic storyview; it's exactly like classic storyview, except there are no animations, and the storylist is restricted to only hold a single tiddler.

@Jermolene
Is there any reason History replaced Open tab?
Is there any plan to use History tab for all story view?

I am using solo and it seems it works much better than zoomin! However I uses $:/StoryList and $:/HistoryList for navigation, which does not work with solo.

I also appreciate to advise me how different are stylesheets (e.g selectors) from classic story view. I need to modify these stylesheet to get the desired behavior for Tiddlyshow plugin (like covering the whole screen, ...

@Jermolene
Copy link
Member Author

Is there any reason History replaced Open tab?

There's a lot of discussion further up this thread: the "open" tab is useless when using a single tiddler mode story view, because it would only ever show a single tiddler. The History tab is offered as an alternative means of navigating.

Is there any plan to use History tab for all story view?

We have considered it, but it seems confusing to have both tabs present at once.

I am using solo and it seems it works much better than zoomin! However I uses $:/StoryList and $:/HistoryList for navigation, which does not work with solo.

I don't follow: all story views use $:/StoryList and $:/HistoryList.

I also appreciate to advise me how different are stylesheets (e.g selectors) from classic story view. I need to modify these stylesheet to get the desired behavior for Tiddlyshow plugin (like covering the whole screen, ...

The "solo" storyview uses the same CSS as the "classic" storyview.

@kookma
Copy link
Contributor

kookma commented Jan 21, 2020

@Jermolene
Many thanks for all your clarification! So, all css are as the same as the classic story view and this makes life much easier.
I will update you how solo works with Tiddlyshow

@kookma
Copy link
Contributor

kookma commented Jan 21, 2020

Is there any reason History replaced Open tab?

There's a lot of discussion further up this thread: the "open" tab is useless when using a single tiddler mode story view, because it would only ever show a single tiddler. The History tab is offered as an alternative means of navigating.

Is there any plan to use History tab for all story view?

We have considered it, but it seems confusing to have both tabs present at once.

I am using solo and it seems it works much better than zoomin! However I uses $:/StoryList and $:/HistoryList for navigation, which does not work with solo.

I don't follow: all story views use $:/StoryList and $:/HistoryList.

I mean for navigation using shortcut keys I use $:/StoryList to find a specific tiddler to navigate to it! It seems in solo story view it is not work the same as $:/StoryList in zoomin!
Following to your reply, I will look close to see what is wrong in my script.

One more question:
In solo story view if I want the opened tiddler occupies the whole screen what are the correct css settings? I confused with tc-tiddler-frame, tc-tiddler-view , tc-story-river

Thank you

@Jermolene
Copy link
Member Author

In solo story view if I want the opened tiddler occupies the whole screen what are the correct css settings? I confused with tc-tiddler-frame, tc-tiddler-view , tc-story-river

I don't know, but I would expect to need to target tc-tiddler-frame along the lines suggested by @pmario above.

@kookma
Copy link
Contributor

kookma commented Jan 21, 2020

In solo story view if I want the opened tiddler occupies the whole screen what are the correct css settings? I confused with tc-tiddler-frame, tc-tiddler-view , tc-story-river

I don't know, but I would expect to need to target tc-tiddler-frame along the lines suggested by @pmario above.

Thanks! by the way I cannot see any comment by @pmario on css!

@kookma
Copy link
Contributor

kookma commented Jan 21, 2020

Some findings: These have been previously raised in the forum or Gihub

Solo story view

i.

  • click create new tiddler button
  • save it as Test
  • There is still missing "Draft of New Tiddler 1" in the History tab

ii.

  • assume you are in solo story view
  • only one tiddler is open at a time
    -new click on the new tiddler button
    -save the new tiddler you just created
    -NOW solo shows two tiddlers at a time

@kookma
Copy link
Contributor

kookma commented Jan 25, 2020

Hi Jeremy,

These are some comments by Mat

I downloaded the attached zip and extracted, getting two files: empty and index.

First trying out empty. I open it, go to ctrlpanel and select Solo storyview (for testing purposed it would probably make more sense to have this pre-set). Anyway, OK I close ctrlpanel so I only have GetingStarted and now click "+" to create a new tid. It opens in edit mode along with the already active GettingStarted. (Maybe I misunderstood the whole premise but I was expecting it to be only one tiddler open at a time? But OK, maybe it's not only one becaseu one is in view mode and one is in edit mode so maybe the latter "doesn't count"...)

After I've saved the tiddler I note that the sidebar tab is not named Open but History. And it lists: New Tiddler, Draft of 'New Tiddler', GettingStarted. I would think that second title should not be there. Clicking it confuses things even more.

If I create yet another "New Tiddler 1", I get the same issue with a missing Draft showing in the History list.

If I reload the wiki and forget to set the Solo storyview but instead first click "+" to create a new tiddler but realize my mistake so I cancel the editview tiddler and then go to ctrlpanel and activate Solo, then upon closing the ctrlpanel the missing Draft pops up (hm!) and clicking "+" right away saves it as an existing tiddler but named "Draft of 'New Tiddler'".

OK, deciding that the empty version is not quite ready for prime time I go to "index".

This starts up with the usual default tiddlers open. I go to ctrpanel and note that Solo is pre-set. Closing the ctrlpanel... every tiddler closes/disappears. Actually what happened what that when I went to ctrlpanel, those default closed but I didn't see it because they were below the ctrlpanel. Not sure how to ideally handle that.

As with empty, the drafts seem to be listed in the History tab. I'd suggest that only existing drafts are actually listed - or is there a thought behind it? This time, clicking "+" does not seem to save it though but instead a "New Tiddler" is opened in draft mode and the History list is updated accordingly. (This makes me wonder if empty and index don't actually have the same version of the machanism...)

openLinkFromOutsideRiver: this.getAttribute("openLinkFromOutsideRiver","top")
});
}
this.wiki.addToStory(title,fromTitle,this.storyTitle,{
Copy link
Member

@pmario pmario Jan 25, 2020

Choose a reason for hiding this comment

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

@pmario
Copy link
Member

pmario commented Jan 25, 2020

This PR will invalidate PR #4200 "Remove dependency on wiki.js for story-startup and navigator" where we don't have a decision yet.

PR #4200 tries to fix a problem, that is also discussed in issue: #4180. Which links to many other issues, which are closed, but not resolved.

Proposal: make navigator.js + friends "multi - story" aware. #4354 also discusses several elements that this PR touches. ... I would like to discuss the main mechanism first.

@Jermolene
Copy link
Member Author

Hi @pmario I'm in no hurry to merge this PR, I think it needs quite a lot more work.

@kookma
Copy link
Contributor

kookma commented Feb 1, 2020

@Jermolene
I have tested the new story view and asked other people to do so!
The comments are given in above posts!

I would appreciate to have a look! I also wish to give some priority to this PR. It makes presentation simple and more semantic.

Thank you

@Jermolene
Copy link
Member Author

Hi @kookma I'm currently still finishing up the big refactoring of the client-server implementation (see #4373), and once that's merged I'll come back to this.

@kookma
Copy link
Contributor

kookma commented Feb 1, 2020

Many thanks @Jermolene!

@kookma
Copy link
Contributor

kookma commented Feb 29, 2020

Hi @kookma I'm currently still finishing up the big refactoring of the client-server implementation (see #4373), and once that's merged I'll come back to this.

Hi @Jermolene
I hope we could have the solo finalized soon!

This is a small reminder.

Thank you

@Jermolene
Copy link
Member Author

Just to say that I don't propose to merge this for v5.1.22 because we haven't resolved the issues around the handling of the "Open" sidebar tab.

@kookma
Copy link
Contributor

kookma commented Apr 2, 2020

@Jermolene
No problem, 5.1.22 introduces alot of new features! I will wait sometimes to see this in 5.1.23!

Thank you

@kookma
Copy link
Contributor

kookma commented Jan 6, 2021

Just to say that I don't propose to merge this for v5.1.22 because we haven't resolved the issues around the handling of the "Open" sidebar tab.

Hi @Jermolene - This is mild reminder.
By the way I am not sure with respect to #4473 you prefer to add solo story view or not! Any way I think the solo can be used instead of zoomin and has a positive impact on the performance.

@ght
Copy link

ght commented Jun 19, 2021

(I don't mean to nag, sorry if this is being worked on and just takes its time. I was just combing through old open issues and PRs and this seemed stale)

Quick summary:

Does this, and the above-mentioned #4473, mean this PR is obsolete?
The branch also seems to decay, having several merge conflicts already.

@Jermolene
Copy link
Member Author

(I don't mean to nag, sorry if this is being worked on and just takes its time. I was just combing through old open issues and PRs and this seemed stale)

Good catch! This issue is one of those threads that once I started pulling, more and more inter-related stuff popped out. As sometimes happen, it will be a multi-year journey to get things right.

Does this, and the above-mentioned #4473, mean this PR is obsolete?

Pretty much, yes. I've ended up exploring #4473 as part of my work on https://github.com/TWPUB/TWPUB-Tools (see https://twpub-tools.org). You can see there a sketch of the multi-column architecture. I'm currently working on bringing up a new implementation of the basic story river architecture that is entirely implemented in wikitext, without the complex encapsulated logic of the <$navigator> widget. This is essentially #3967.

@pmario
Copy link
Member

pmario commented Jul 27, 2022

@Jermolene ... Can you remember, why this PR wasn't merged at the end?

@kookma
Copy link
Contributor

kookma commented Jul 27, 2022

I was waiting for long time to see this merged! Solo ;-)

@Jermolene
Copy link
Member Author

Hi @pmario @kookma I think my earlier comments still apply:

  • The way that the "open" tab switches into a "history" tab when the solo view is engaged is not entirely satisfactory
  • I'm still working on revamping navigation into wikitext as part of https://github.com/TWPUB/TWPUB-Tools

But I guess it might make sense to revisit this for the next release.

@Jermolene
Copy link
Member Author

But I guess it might make sense to revisit this for the next release.

By which I meant the release after v5.2.3

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

Successfully merging this pull request may close these issues.

9 participants