Suggestions for more functionality
arunnbabu81 opened this issue Β· 17 comments
I have been using tiddlywiki for the last 6 months regularly and i mostly use Krystal plug in for the story view. Here are some of the things which i observed during my regular use that may help to increase the functionality
- Clicking on the link in a tiddler when it is in the maximised state should return the tiddler back to the default state as mentioned by you in this comment #13 (comment)
- Keyboard shortcut for going into and coming out of the maximised state of a tiddler. I dont know whether this is possible since it may be difficult to find which is the active tiddler when all tiddlers are in view-mode.
- Dropdown option for the header tools especially the "Open" tiddler which shows the currently open tiddlers. I am asking this because when 4 or more tiddlers are open simultaneously, it is slightly difficult to see and compare two non-adjacent tiddlers. For example, if I want to see 3rd and 5th tiddler side-by-side, what i do now is click open the "Open" tool from header and drag and drop 3, 5 tiddlers into 1st and 2nd tiddler position. If there is a dropdown option for "Open" tool in the header, i can drag and drop from there itself and help speed up my workflow. The workaround i am using now takes up little more time and i will lose the flow of note taking. Check this link to see a similar dropdown implementation
- "Close tiddlers to the right" - When this option in the settings is set to yes, clicking on the first link in a tiddler will open the link to the right. Any more links you click from the same tiddler will open that link to the right after replacing the previously opened tiddler on the right. I would like to over-ride this behavior if i use "shift clicking" a link instead of "just clicking" the link. That is if i shift click the links, it should keep on opening to the right without closing the already opened tiddler on the right side.
- Alt or Ctrl clicking on a link in a tiddler should open that link in the maximised state rather than in the default state.
Sorry for the lengthy post. I think i have mentioned these things in some other places also. I am posting all these together here for easy reference. If you can start the "Discussion" thread of github, i can shift this to discussions.
Hi, thanks for your suggestions.
I think i have mentioned these things in some other places also. I am posting all these together here for easy reference.
Great, you tidied it up for me :)
If you can start the "Discussion" thread of github, i can shift this to discussions.
I think with Discussions we would move this "problem" to a different place. It'd be better to create a new issue for every point in your list or at least for every cluster (maximized state + shortcuts, dropdown for open tiddlers, close tiddlers the right).
That way it'd be easier to have a discussion for every topic independently. But, you can leave those here. I'd like to ask you to do it for any future cases, thanks :)
I'll leave the feedback for your list here soon.
- Dropdown option for the header tools especially the "Open" tiddler
I think this should not be part of the plugin as you can add this easily manually.
- create new tiddler (any name is good)
- add following content:
<$button popup="$:/OpenTiddlersPopupState" class="tc-btn-invisible tc-tiddlylink">Open</$button>
<$reveal type="popup" state="$:/OpenTiddlersPopupState">
<div class="tc-drop-down">
{{$:/core/ui/SideBar/Open}}
</div>
</$reveal>
- add tag
$:/plugins/rmnvsl/krystal/header
- add field
list-before
with value$:/plugins/rmnvsl/krystal/headertools
- Remove tag
$:/tags/SideBar
from$:/core/ui/SideBar/Open
tiddler
Some styling should be udpated, but this should help.
EDIT: udpated field value in 4th point.
@crazko Thanks for the reply. Next time i will make sure, i report each issue separately. I asked you to shift this to Discussions because these are actually suggestions or ideas more than issues.
- Dropdown option for the header tools especially the "Open" tiddler
I think this should not be part of the plugin as you can add this easily manually.
- create new tiddler (any name is good)
- add following content:
<$button popup="$:/OpenTiddlersPopupState" class="tc-btn-invisible tc-tiddlylink">Open</$button> <$reveal type="popup" state="$:/OpenTiddlersPopupState"> <div class="tc-drop-down"> {{$:/core/ui/SideBar/Open}} </div> </$reveal>
- add tag
$:/plugins/rmnvsl/krystal/header
- add field
list-before
with value$:/plugins/rmnvsl/krystal/search
- Remove tag
$:/tags/SideBar
from$:/core/ui/SideBar/Open
tiddlerSome styling should be udpated, but this should help.
Thanks for the tips. I tried this, it worked except that it appeared to the right of the search bar in the header. Also can you suggest some sample styling and where to insert the code (i dont have much hold in coding).
I tried this, it worked except that it appeared to the right of the search bar in the header.
Sorry, bad list-before
field value, should be $:/plugins/rmnvsl/krystal/headertools
. I'll update my original comment for future visitors.
Also can you suggest some sample styling and where to insert the code
This could be a good starting point :)
- Create a new tiddler
- Add tag
$:/tags/Stylesheet
- Add following content
.krystal-header .tc-sidebar-tab-open a,
.krystal-header .tc-sidebar-tab-open button {
display: initial;
padding: 0;
width: auto;
}
.krystal-header .tc-sidebar-tab-open > div {
padding: 0 14px;
}
Update: do not affect other dropdowns in the header, add padding
Thanks for the prompt reply. Dropdown now works perfectly.
I have one problem after i started using the code for dropdown menu for Open tiddlers. I use projectify plug-in by nicolas petton in my wiki. It has a page control schedule button which is shown in the header tools of krystal. This button shows the schedules for today as a dropdown on clicking. After adding the code for dropdown for Open tiddler, the contents of the projectify's schedule button dropdown are arranged horizontally instead of actual vertical alignment. Can you suggest what to do for this? Or should i ask this to nicolas petton?
I have attached two demos - one with issue and other without.
Github.zip
Also when the current active tiddler is in maximized state, dropdown option of the page control buttons like palette selection button and βopenβ tiddlers gets hidden behind the maximized tiddler.
I have one problem after i started using the code for dropdown menu for Open tiddlers...
Thanks for the source files. I've updated the CSS snippet above; please update it in your TiddlyWiki.
Also when the current active tiddler is in maximized state, dropdown option of the page control buttons like palette selection button and βopenβ tiddlers gets hidden behind the maximized tiddler.
Update Krystal to version 0.3.3
, I fixed that.
@crazko Dropdown works fine now. Thanks for the update.
I have been using tiddlywiki for the last 6 months regularly and i mostly use Krystal plug in for the story view. Here are some of the things which i observed during my regular use that may help to increase the functionality
- Clicking on the link in a tiddler when it is in the maximised state should return the tiddler back to the default state as mentioned by you in this comment Stacking of tiddlers on the left side doesn't reveal tiddlers title unlike one the right side [Safari browser] #13 (comment)
- Keyboard shortcut for going into and coming out of the maximised state of a tiddler. I dont know whether this is possible since it may be difficult to find which is the active tiddler when all tiddlers are in view-mode.
- Dropdown option for the header tools especially the "Open" tiddler which shows the currently open tiddlers. I am asking this because when 4 or more tiddlers are open simultaneously, it is slightly difficult to see and compare two non-adjacent tiddlers. For example, if I want to see 3rd and 5th tiddler side-by-side, what i do now is click open the "Open" tool from header and drag and drop 3, 5 tiddlers into 1st and 2nd tiddler position. If there is a dropdown option for "Open" tool in the header, i can drag and drop from there itself and help speed up my workflow. The workaround i am using now takes up little more time and i will lose the flow of note taking. Check this link to see a similar dropdown implementation
- "Close tiddlers to the right" - When this option in the settings is set to yes, clicking on the first link in a tiddler will open the link to the right. Any more links you click from the same tiddler will open that link to the right after replacing the previously opened tiddler on the right. I would like to over-ride this behavior if i use "shift clicking" a link instead of "just clicking" the link. That is if i shift click the links, it should keep on opening to the right without closing the already opened tiddler on the right side.
- Alt or Ctrl clicking on a link in a tiddler should open that link in the maximised state rather than in the default state.
Sorry for the lengthy post. I think i have mentioned these things in some other places also. I am posting all these together here for easy reference. If you can start the "Discussion" thread of github, i can shift this to discussions.
Any updates on these feature requests?
Not really. I've only played with some of the implementations, but haven't had enough time to finish any of them.
I have been using tiddlywiki for the last 6 months regularly and i mostly use Krystal plug in for the story view. Here are some of the things which i observed during my regular use that may help to increase the functionality
- Clicking on the link in a tiddler when it is in the maximised state should return the tiddler back to the default state as mentioned by you in this comment Stacking of tiddlers on the left side doesn't reveal tiddlers title unlike one the right side [Safari browser] #13 (comment)
- Keyboard shortcut for going into and coming out of the maximised state of a tiddler. I dont know whether this is possible since it may be difficult to find which is the active tiddler when all tiddlers are in view-mode.
- Dropdown option for the header tools especially the "Open" tiddler which shows the currently open tiddlers. I am asking this because when 4 or more tiddlers are open simultaneously, it is slightly difficult to see and compare two non-adjacent tiddlers. For example, if I want to see 3rd and 5th tiddler side-by-side, what i do now is click open the "Open" tool from header and drag and drop 3, 5 tiddlers into 1st and 2nd tiddler position. If there is a dropdown option for "Open" tool in the header, i can drag and drop from there itself and help speed up my workflow. The workaround i am using now takes up little more time and i will lose the flow of note taking. Check this link to see a similar dropdown implementation
- "Close tiddlers to the right" - When this option in the settings is set to yes, clicking on the first link in a tiddler will open the link to the right. Any more links you click from the same tiddler will open that link to the right after replacing the previously opened tiddler on the right. I would like to over-ride this behavior if i use "shift clicking" a link instead of "just clicking" the link. That is if i shift click the links, it should keep on opening to the right without closing the already opened tiddler on the right side.
- Alt or Ctrl clicking on a link in a tiddler should open that link in the maximised state rather than in the default state.
Sorry for the lengthy post. I think i have mentioned these things in some other places also. I am posting all these together here for easy reference. If you can start the "Discussion" thread of github, i can shift this to discussions.
Can you please implement the suggestion numbered as β1β. Itβs ok if other suggestion take more time to implement. Atleast the first one needs to be implemented. Currently I have to come out of the maximized state to see the newly opened links or tiddlers
Can you please implement the suggestion numbered as β1β.
Until the feature you're asking is implemented, here's a solution you can try. Didn't do extensive testing, but seems OK... Create a tiddler called "mystartup.js" with the following body:
/*\
title: mystartup.js
type: application/javascript
module-type: startup
Sets plugin behavior
\*/
(function () {
const MAXIMIZED_TIDDLER_CLASS = "krystal-tiddler__frame--maximized";
exports.after = ["render"];
exports.startup = function () {
$tw.hooks.addHook("th-navigating", restoreFromTiddler);
};
function tiddlerRestoreSize(tiddlerTitle) {
const tiddler = document.querySelector(
`div[data-tiddler-title="${tiddlerTitle}"]`
);
if (tiddler) {
tiddler.classList.remove(MAXIMIZED_TIDDLER_CLASS);
}
}
function restoreFromTiddler(event) {
const navigateFrom = event.navigateFromTitle;
if (!event.navigateSuppressNavigation && navigateFrom !== undefined) {
tiddlerRestoreSize(navigateFrom);
}
return event;
}
})();
You also need to:
- change type of this tiddler to
application/javascript
- add a new field module-type with the value
startup
- save and reload your wiki
Hope this helps.
That was awesome. It works nicely. Would you also extend this functionality to work when a tiddler link is opened from the "Recent" and "Open" dropdown menus in the header while another tiddler is in maximised state.
Try this one. Replace your "mystartup.js" tiddler content with the following:
/*\
title: mystartup.js
type: application/javascript
module-type: startup
Sets plugin behavior
\*/
(function () {
const MAXIMIZED_TIDDLER_CLASS = "krystal-tiddler__frame--maximized";
exports.after = ["render"];
exports.startup = function () {
$tw.hooks.addHook("th-navigating", restoreMaximizedTiddler);
$tw.hooks.addHook("th-new-tiddler", restoreMaximizedTiddler);
};
function restoreMaximizedTiddler(event) {
const tiddler = document.querySelector(
`div[class~="${MAXIMIZED_TIDDLER_CLASS}"]`
);
if (tiddler) {
tiddler.classList.remove(MAXIMIZED_TIDDLER_CLASS);
}
return event;
}
})();
Again, not tested extensively. The code assumes there will be at most one maximized tiddler at any time. It will restore the maximized tiddler to the default size on any navigation and new-tiddler events. If you find more instances needing this functionality, try to see if you can add a hook (or event listener) in exports.startup()
. For more info, search for "hook" in TiddlyWiki's developer documentation.
I have been using tiddlywiki for the last 6 months regularly and i mostly use Krystal plug in for the story view. Here are some of the things which i observed during my regular use that may help to increase the functionality
- Clicking on the link in a tiddler when it is in the maximised state should return the tiddler back to the default state as mentioned by you in this comment Stacking of tiddlers on the left side doesn't reveal tiddlers title unlike one the right side [Safari browser] #13 (comment)
- Keyboard shortcut for going into and coming out of the maximised state of a tiddler. I dont know whether this is possible since it may be difficult to find which is the active tiddler when all tiddlers are in view-mode.
- Dropdown option for the header tools especially the "Open" tiddler which shows the currently open tiddlers. I am asking this because when 4 or more tiddlers are open simultaneously, it is slightly difficult to see and compare two non-adjacent tiddlers. For example, if I want to see 3rd and 5th tiddler side-by-side, what i do now is click open the "Open" tool from header and drag and drop 3, 5 tiddlers into 1st and 2nd tiddler position. If there is a dropdown option for "Open" tool in the header, i can drag and drop from there itself and help speed up my workflow. The workaround i am using now takes up little more time and i will lose the flow of note taking. Check this link to see a similar dropdown implementation
- "Close tiddlers to the right" - When this option in the settings is set to yes, clicking on the first link in a tiddler will open the link to the right. Any more links you click from the same tiddler will open that link to the right after replacing the previously opened tiddler on the right. I would like to over-ride this behavior if i use "shift clicking" a link instead of "just clicking" the link. That is if i shift click the links, it should keep on opening to the right without closing the already opened tiddler on the right side.
- Alt or Ctrl clicking on a link in a tiddler should open that link in the maximised state rather than in the default state.
Sorry for the lengthy post. I think i have mentioned these things in some other places also. I am posting all these together here for easy reference. If you can start the "Discussion" thread of github, i can shift this to discussions.
For the second suggestion about a keyboard shortcut for going in and out of maximized state of currently active tiddler, i experimented with the keyboard navigation shown in this link by BTC
I created a tiddler titled "$:/core/ui/KeyboardShortcuts/maximize" and tagged it with "$:/tags/KeyboardShortcut" with the below wikitext in the text field.
<$navigator story="$:/StoryList" history="$:/HistoryList"> <$action-sendmessage $message="tm-maximize" $param={{$:/HistoryList!!current-tiddler}}/> </$navigator>
Also add a field called "key" with "alt-M" as content.
This works well in my short testing. I have attached a demo wiki