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

Sidebar-resizer: change $:/themes/... tiddlers #8663

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

Conversation

BurningTreeC
Copy link
Contributor

@BurningTreeC BurningTreeC commented Oct 4, 2024

This PR uses the same mechanism as #8644 but changes the $:/themes/tiddlywiki/vanilla/metrics/... tiddlers directly.
Note that in fixed-fluid mode the story-river actually changes its width but the tiddlerwidth remains fixed width as there was no discussion yet how we handle this. I just made the tiddlers adapt to the story-river if the story-river-width goes below the tiddlerwidth.

There are some design questions:

  • should it be possible to make the story-river overlap the sidebar / the slider?
  • should the tiddlerwidth in fixed-fluid mode be updated? (keeping the gap between sidebar and story-river)

I haven't yet added the ControlPanel configurations used for storyminwidth and sidebarminwidth.
This PR is just for completeness, I will update it so that we can compare with other possible solutions.


In the meantime this PR has been updated quite a bit, I've put a current build here:

https://sidebar-resizer-config.tiddlyhost.com/

Copy link

stackblitz bot commented Oct 4, 2024

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

github-actions bot commented Oct 4, 2024

Confirmed: BurningTreeC has already signed the Contributor License Agreement (see contributing.md)

@BurningTreeC
Copy link
Contributor Author

@Jermolene @saqimtiaz @pmario

sorry for tagging you 😸
But if you have time, could you test?
Especially fixed-fluid mode needs testing.
This here now works with pixel and percentage values.
It updates the $:/themes/... tiddlers directly.
In fixed-fluid mode it updates storyright and storyleft.
There's also the option to slide using ctrl in fixed-fluid mode. ctrl makes it possible to move the sidebar further to the left if there's a gap between story and sidebar. To test that, maybe set the storyright to 75% and the storywidth to 45% and the tiddlerwidth to 100% ... it becomes easier to understand like that.

The calculations are now done in wikitext in the procedures.
One thing I had to limit to not become less than 0 which is the storyleft.

@BurningTreeC
Copy link
Contributor Author

This works now with all absolute css metrics:

Bildschirmfoto vom 2024-10-06 10-41-34

Including percentage, which is easy to calculate.
If a metric was for instance "pt" or "%" before starting to resize, it will be updated as "pt" / "%" and so on.

The internal calculations are all done in pixel, so this first converts everything to pixel, then calculates, then converts back to the corresponding value.

I don't know if this can also support other relative css metrics...

@BurningTreeC
Copy link
Contributor Author

As I said above, in fixed-fluid mode I'm not settled about how the gap between story-river and sidebar should be handled.
This implementation however can be modified easily in that regards

@pmario
Copy link
Member

pmario commented Oct 6, 2024

@BurningTreeC -- I did checkout this branch and did run it, but I can not find any resizer. I think I'm missing something

@BurningTreeC
Copy link
Contributor Author

It seems there is a problem with the "edit-resizer" and new tiddlers with no or just a bit of text in it.

image

Hi @pmario - this should be fixed now

@BurningTreeC
Copy link
Contributor Author

@BurningTreeC
Copy link
Contributor Author

for the edit-resizer there's one part missing: clamping the values when the tiddler width gets very low

@pmario
Copy link
Member

pmario commented Oct 31, 2024

Cool stuff. I really like it.

@Jermolene
Copy link
Member

Hi @BurningTreeC I just had a play with the preview, the edit resizer works great.

@BurningTreeC
Copy link
Contributor Author

https://sidebar-resizer-config.tiddlyhost.com/

I've updated the preview. I decided to go with 0px minwidth for editor and preview

@Jermolene
Copy link
Member

Thanks @BurningTreeC while you are iterating so fast, do you think it would be worth exploring the pointer capture idea? I think @saqimtiaz has some ideas about the implementation.

@BurningTreeC
Copy link
Contributor Author

Hi @Jermolene - yes it's surely worth exploring the pointer capture idea.
Let's see what saq says!

@pmario
Copy link
Member

pmario commented Nov 1, 2024

@BurningTreeC -- It would be nice, if you would be a bit more specific with your "update" commit messages. With "updates" we (the other devs) are forced to "reverse engineer" the code to see what's going on. That's time consuming.

@BurningTreeC
Copy link
Contributor Author

@BurningTreeC -- It would be nice, if you would be a bit more specific with your "update" commit messages. With "updates" we (the other devs) are forced to "reverse engineer" the code to see what's going on. That's time consuming.

Sorry @pmario - I made a little change that made me change more little things at different parts
Basically it's the sidebarminwidth and the storyminwidth which were not the same (visually) in fixed-fluid and fluid-fixed
Now they're same looking

@BurningTreeC
Copy link
Contributor Author

Here's the current build: https://sidebar-resizer-config.tiddlyhost.com/

@BurningTreeC
Copy link
Contributor Author

But I'm not yet happy with how the storypaddingleft and storypaddingright values work
I need some time to figure them out correctly

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.

7 participants