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

Trim Saga: Another batch of medium-sized files #6270

Merged
merged 7 commits into from Mar 26, 2022

Conversation

flibbles
Copy link
Contributor

I'd tag these for V5.2.2 myself if I could. Stop me if all this is a hassle.

Prettied up EditTemplate a bit since we can now.

<li>
<$list filter="[<__prefix__>addsuffix<__chunk__>is[shadow]] [<__prefix__>addsuffix<__chunk__>is[tiddler]]" variable="full-title">
<$list filter="[<full-title>removeprefix<__prefix__>]" variable="chunk">
<span>{{$:/core/images/file}}</span> <$macrocall $name="leaf-link" full-title=<<full-title>> chunk=<<chunk>>/>
<span>{{$:/core/images/file}}</span>&#32;<$macrocall $name="leaf-link" full-title=<<full-title>> chunk=<<chunk>>/>
Copy link
Contributor

@pmario pmario Feb 17, 2022

Choose a reason for hiding this comment

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

There are some tc-xxx-gap classes, that will allow you to add CSS gaps left, right and center if needed. So "artificial" spaces are not needed.

** Other utility classes

This gap here can be added to <$link to=<<__full-title__>>><$text text=<<__chunk__>>/></$link> in the leaf-link macro from line 4. Like so: <$link to=<<__full-title__>> class="tc-tiny-gap-left"><$text text=<<__chunk__>>/></$link>

The other elements may need an additional span for proper "spacing".

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is that the actual design preference to use those classes rather than &#32;? Or, as I saw used all over the place, &nbsp;? My aim when creating these PRs was to reduce changes to the resulting parse tree as much as possible, so a few deliberately placed spaces was better for that than introducing classes.

Is there a final decision on this? I was following Jeremolene's remarks from here, but I don't know if he remembered the classes at the time either. I hadn't known about them.

Copy link
Contributor

@pmario pmario Feb 17, 2022

Choose a reason for hiding this comment

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

The classes are not very old. They have been created, because whitespace shouldn't be used for styling. CSS should be used for styling. ...

IMO styled SPANs are semantically correct HTML code. Whitespace is not. We have a lot of these problems in the TW UI. They constantly cause problems, if someone wants to adjust or create new themes.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this a change we want to make while I'm converting over everything to use \whitespace trim? Or should it be done separately? I would argue separately.

  1. The use of these classes is a distinct design decision that would be on top of switching over to using trim.
  2. It would be easier to see where we need these classes once we have whitespace trim and &#32; scattered about.
  3. I'm having a hard enough time getting these changes merged as they are without compounding the number of judgement calls.

Copy link
Contributor

@pmario pmario Feb 17, 2022

Choose a reason for hiding this comment

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

OK. You are right. Let's make "baby steps" ;)

Copy link
Owner

Choose a reason for hiding this comment

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

I'm not convinced about the new spacing classes. It seems to me that using whitespace for certain purposes like separating controls from their text is perfectly reasonable because a unit of whitespace has a clear semantic meaning.

Using &#32; is clever, but existing code tends to use <$text text=" "/>. I've no objection to a blanket change, but again it would require care. In the meantime, we should try to be consistent, or at least not make the inconsistencies worse.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm OK if a space is used here, since it doesn't seem to cause problems, if users select and copy/paste content with an accidental white space.

The "gap" classes where invented, to separate tag-pill content. Eg: tag-icons where separated from tag-title-text with a space.

The "space" character caused problems if a tag-pill text was copy pasted. Most users accidentally also copied the space, which in turn caused problems if pasted into an other tag of a new tiddler. The new tag contained a leading space, which caused weird and hard to find problems.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@Jermolene, So no worries about <$text text=" "/>. They have all already been removed as a part of #5473. The only one that remains is on inside the "menubar" plugin, and it is literally having no effect (It's not being used with \whitespace trim).

@pmario, I hadn't considered the copy-paste implications of those spaces. That does seem an argument for removing them in favor of spacing classes, but I still of the opinion that it should be a separate issue from the "\whitespace trim" additions.

Copy link
Contributor

Choose a reason for hiding this comment

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

@flibbles You are right. I'm OK with &#32; here. I don't think, there is a copy paste side effect here.

@pmario
Copy link
Contributor

pmario commented Feb 17, 2022

I personally would like to have this PR out of the way, because I would like to change the core tabs-macro. Every PR that I create will cause a conflict for your PR or for mine, if yours is merged first.

@flibbles
Copy link
Contributor Author

Every PR that I create will cause a conflict for your PR or for mine, if yours is merged first.

I wouldn't let that stop you. I've touching nearly 20 files right now with my Trim stuff... and I don't know when or if any of it will merge in. Those 20 files can't be considered "locked". As long as you maintain the consistent use of "\whitespace trim", I can just resolve conflicts by merging in favor of your changes.

@flibbles
Copy link
Contributor Author

Are these waiting on anything? I see we're approaching another release cycle 5.2.3. Sooner or later, these whitespace fixes are going to go stale. I'd say either merge 'em or close 'em.

@flibbles
Copy link
Contributor Author

Ugh. That was a pain. Resolved a conflict on this. Required me to change my authtoken settings in github.

@flibbles
Copy link
Contributor Author

DOUBLE UGH. Someone wrote tests for that tabs file SINCE I wrote this PR.

Reconciled and ready to merge.

@Jermolene
Copy link
Owner

Thanks @flibbles

@Jermolene Jermolene merged commit 98a509d into Jermolene:master Mar 26, 2022
@flibbles flibbles deleted the trim3 branch March 26, 2022 18:17
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.

None yet

3 participants