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

tabs-missing-explicitState-added #8108

Draft
wants to merge 9 commits into
base: master
Choose a base branch
from

Conversation

pmario
Copy link
Member

@pmario pmario commented Mar 26, 2024

This PR will allow us to "copy / paste" tabs macro definitions into new tiddlers, without the need to adjust the "explicitState" parameter in the macro.

  • It will be used from the tiddler field.
  • Since it is a field it can be dynamically changed by user code or 3rd party plugins.
  • It will also allow us to read the "needed" state from fields instead using regexps to read it from the macro parameter

Copy link

vercel bot commented Mar 26, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
tiddlywiki5 ✅ Ready (Inspect) Visit Preview Apr 21, 2024 2:00pm

@Jermolene
Copy link
Member

That's a great idea, thanks @pmario

@pmario
Copy link
Member Author

pmario commented Apr 21, 2024

@Jermolene -- Improved readability and did some more testing. Is ready to be reviewed now

@pmario pmario marked this pull request as draft April 21, 2024 13:47
@pmario
Copy link
Member Author

pmario commented Apr 21, 2024

uups forgot the tw function prefix tf. ... switched it draft again

@pmario pmario marked this pull request as ready for review April 21, 2024 13:57
@pmario
Copy link
Member Author

pmario commented Apr 21, 2024

@Jermolene -- once Vercel built the preview it should be ready for review

@pmario pmario changed the title tabs-missing-explicitState-added-wip tabs-missing-explicitState-added Apr 22, 2024
Copy link
Member

@Jermolene Jermolene left a comment

Choose a reason for hiding this comment

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

Thanks @pmario

tags: $:/tags/Global

<!-- This global function can be used when the eexplicitState parameter is used with tabs-macros -->
\function tf.getExplicitState() [<currentTab>get[explicitState]] ~[<currentTiddler>get[explicitState]] ~[<thisTiddler>get[explicitState]]
Copy link
Member

Choose a reason for hiding this comment

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

Why is this cascade needed? It feels like it could very confusing.

I don't like having to introduce such a specific core function. It doesn't seem particularly useful outside the core.

Copy link
Member Author

Choose a reason for hiding this comment

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

Why is this cascade needed? It feels like it could very confusing.

It is necessary. Consider the following configuration. The story river contains

With the code in the PR all 3 tabs show the same "selected tab" -- all visible tiddlers can be used to switch tabs. All of them use the right explicitState value.

If ~[<thisTiddler>get[explicitState]] is missing from the cascade, the "New Tiddler" will be disconnected, which is not what we want.

Copy link
Member Author

@pmario pmario Sep 9, 2024

Choose a reason for hiding this comment

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

I don't like having to introduce such a specific core function. It doesn't seem particularly useful outside the core.

At the moment this "function" is a bit "lonely". But I would like to be able to do this:

<<switch-to-tab root:"$:/ControlPanel" path:"Info/Advanced/Cascades/View Template Title">> and the tab should be selected in the $:/ControlPanel tiddler.

Every tiddler that contains a "tabs" macro will probably need more meta-data, but the functionality will be globally useful for everyone, that uses the tabs-tiddlers with that configuration.

Copy link
Member Author

Choose a reason for hiding this comment

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

So after calling an action or a button it should look like this:

image

@pmario pmario marked this pull request as draft September 9, 2024 12:20
@pmario
Copy link
Member Author

pmario commented Sep 9, 2024

Converted this one to a draft again, since I would like to rename and move the "global function" tiddler.

@pmario
Copy link
Member Author

pmario commented Sep 9, 2024

A side effect if a mechanism like this one <<switch-to-tab root:"$:/ControlPanel" path:"Info/Advanced/Cascades/View Template Title">> works is:

We should be able to globally search for parameters in the control panel and we should be able to select the right tab. -- But that's a completely different topic :)

Copy link

netlify bot commented Nov 16, 2024

Deploy Preview for tiddlywiki-previews ready!

Name Link
🔨 Latest commit 61af938
🔍 Latest deploy log https://app.netlify.com/sites/tiddlywiki-previews/deploys/673913a4e626500008f32a44
😎 Deploy Preview https://deploy-preview-8108--tiddlywiki-previews.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@pmario
Copy link
Member Author

pmario commented Nov 17, 2024

@Jermolene -- I did some more experiments, if the whole PR is worth it. -- I think it is. This PR would be the first "baby step"


As I wrote at: #8108 (comment)

Every tiddler that contains a "tabs" macro will probably need more meta-data, but the functionality will be globally useful for everyone, that uses the tabs-tiddlers with that configuration.

If we add most of the hardcoded variables into the tiddler fields eg: How the tabsList is created, we do have enough information in the fields, that we can connect all configurations together and show them in different ways (templates).

Show Experimental "ControlPanel/Appearance" Code

title: $:/core/ui/ControlPanel/Appearance
tags: $:/tags/ControlPanel
caption: {{$:/language/ControlPanel/Appearance/Caption}}
explicitState: $:/state/tab--1963855381
toc-filter: [all[shadows+tiddlers]tag[$:/tags/ControlPanel/Appearance]!has[draft.of]]

\whitespace trim
{{$:/language/ControlPanel/Appearance/Hint}}

<div class="tc-control-panel">
	<$macrocall $name="tabs"
		tabsList=<<tf.tabs-getListFilter>>
		default="$:/core/ui/ControlPanel/Theme"
		explicitState=<<tf.tabs-getExplicitState>>
	/>
</div>

Possibilities:

  • A long list of all settings (See screenshot below)
  • Creating a Tabbed TOC-like view, where the tabs are on the left side (see screenshot below)
  • Filtering will be extremely tricky because all texts are "<<lingo ..>>" (not sure if it is doable)
    • What always works is - Native browser search, if everything is shown in a loooooong list
  • Probably much more, which I did not think of

The following info is highly related to: [IDEA] Enable listing of all controlpanel settings #7117

Experimental TOC Screenshot

image

One more thing

It seems to be backwards compatible

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.

2 participants