Having the +/- on the left side seems like the natural place for showing/hiding a sub-tree. However, when you do this, the + is left aligned with sub-trees at the same depth. This is fine if all sub-trees have descendents, and thus a +/-. But, if a sub-tree without descendents is above a sub-tree with descendents at the same level it appears as though the lower sub-tree is a descendent of the upper instead of a sister. For example, if the following are at the same level it looks like this:
Re: Great subject[^19] 24 hours ago [him] +/-Re: Great subject(1) 11 hours ago [her]
But it would be more natural if the subjects at the same depth were aligned like this:
Re: Great subject[^19] 24 hours ago [him] +/-Re: Great subject(1) 11 hours ago [her]

Replies are listed 'Best First'.
Re: Recent threads - Show toggle on the left: indentation
by kcott (Archbishop) on Mar 08, 2024 at 07:52 UTC

    G'day Danny,

    Problem (discovered after previewing): I tested all of the markup below in my scratchpad before composing this response. All of it worked fine there and the dot points disappeared from the rendering; however, the nodethreads ID has a problem here as you can see — I don't know if that would also be a problem on the RAT page (and have no way to check it).

    Anomaly (discovered after posting): When previewing, the text <div id="nodethreads"> was rendered; after posting, it's no longer rendered. In both cases, it appears to make no difference to the visibility of the dot points.

    Here's a very rough reproduction of the current markup:

    <div id="nodethreads"> <h3><u>+/-</u><u>Section</u> <u>(Top)</u></h3> <ul> <li> <u>Title</u> info<u>+/-</u> <u>author</u> <ul> <li> <u>Re: Title</u> info<u>+/-</u> <u>author</u> <ul> <li> <u>Re^2: Title</u> info<u>+/-</u> <u>author</u> <ul> <li> <u>Re^3: Title</u> info <u>author</u> </li> </ul> </li> </ul> </li> </ul> </li> </ul> </div>

    which renders like this:

    +/-Section (Top)

    • Title info+/- author
      • Re: Title info+/- author
        • Re^2: Title info+/- author
          • Re^3: Title info author

    As you can see, the header has the +/- link on the left while all the entries have that link on the right. This is inconsistent and would be better, as you suggest, if these were moved to the right. I'd make a few other changes:

    • Add whitespace around the +/- link.
    • Reduce the size of the +/- link.
    • Reduce the size of the (Top) link.
    • Indent leaf entries with CSS. I fudged it (for demo purposes) with a series of &nbsp;s.

    Here's how the markup might now look. Again, a very rough reproduction.

    <div id="nodethreads"> <h3><small><small><u>+/-</u></small></small> <u>Section</u> <small><sm +all><u>(Top)</u></small></small></h3> <ul> <li> <small><u>+/-</u></small> <u>Title</u> info <u>author</u> <ul> <li> <small><u>+/-</u></small> <u>Re: Title</u> info <u>author</u> <ul> <li> <small><u>+/-</u></small> <u>Re^2: Title</u> info <u>author</u> <ul> <li> <small>&nbsp;&nbsp;&nbsp;&nbsp;</small> <u>Re^3: Title</u> info <u>aut +hor</u> </li> </ul> </li> </ul> </li> </ul> </li> </ul> </div>

    which renders like this:

    +/- Section (Top)

    • +/- Title info author
      • +/- Re: Title info author
        • +/- Re^2: Title info author
          •      Re^3: Title info author

    It's extremely rare for me to collapse sections of RAT so I'm not particularly fussed if you do this or not; it's just a suggestion.

    I've fudged a few other things purely for demonstration purposes. All of the <small> tags would probably be better handled with CSS. I've simply used <u> tags to simulate links. The RAT markup already has a nodethreads ID; duplicate IDs are technically illegal in normal HTML, I don't know if that holds for PM-HTML.

    — Ken

Re: Recent threads - Show toggle on the left: indentation
by LanX (Saint) on Mar 07, 2024 at 21:51 UTC
    I noticed this too, that's why I have the toggle on the right side. But I suppose you are already aware of this "Page setting" in RAT.

    If you know an easy CSS and/or HTML patch to fix that, without sabotaging toggles to the right or other settings, feel free to suggest it here. ( No guarantees whatsoever, though =)

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    see Wikisyntax for the Monastery

      It would seem most straightforward to prepend lines without the +/- with some non-breaking space or a <div> of a certain width or a left margin etc on the server side.
        > the +/- with some non-breaking space or a <div> of a certain width or a left margin etc on the server side.

        For the record

        • it should be a span, not a div
        • the +/- are already inside a span with a dedicated CSS-class nnt-toggle , use your browsers console to investigate further
        • a clean solution would (may) try to prepend an "empty" (or &middot; · ?) span for "leaf" nodes, but with the same toggle class. Like that the width of indentation is consistently controlled for all lines.
        • probably best with em units, to fit font size
        • the code in question has around 1330 lines to cover all possible config options for RAT, not counting code of "subroutines" called from within
        • there -> handle_threaded_nodes
        • various generations of gods left their mark in the code, without making it more readable (surprise)
        • it's easy to identify where the +/- are added to the left, but not so much where not
        • Update: it must be taken care that all view-modes render well with said indentation.
        As I already mentioned, we have more urgent problems, but you or others could apply for pmdev and provide a patch.

        HTH :)

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        see Wikisyntax for the Monastery

        I had no time to look into the design yet, might be table based, tho I seem to remember <dl> nesting.

        Anyway what you propose must be hidden, in case the toggle is switched to the right.

        Only to mention one complication.

        Disclaimer: we have more urgent problems, I won't be able to provide a patch for that.

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        see Wikisyntax for the Monastery