Coder Social home page Coder Social logo

Comments (8)

rmunn avatar rmunn commented on June 2, 2024 1

There would be an interaction between this and the limit attribute. Currently even if limit is present, the list widget calculates the entire list anyway even if it's only going to show, say, the first 3 items. But I have some work planned in #7811 that would allow the list widget to be "lazy" and stop calculating list items once the limit is reached. In order for that to be possible, we'd need to define the interaction between total-count and limit to say "If limit is present, total-count will never be greater than limit, though of course it might be less." I.e. if you have five tiddlers tagged with Todo and you do <$list filter="[tag[Todo]]" limit=3 total-count="items"> then the value of items would become 3, not 5.

I believe this is what you would want anyway: in any scneario I've come up so far, you would want to know how many list items the list is actually going to display, not how many it potentially could have displayed. But it's definitely worth clarifying that iteraction now, before anyone actually encounters it in practice.

from tiddlywiki5.

saqimtiaz avatar saqimtiaz commented on June 2, 2024 1

There are performance considerations to the proposal. See #5867 for a prior discussion that includes implementation ideas.

from tiddlywiki5.

AnthonyMuscio avatar AnthonyMuscio commented on June 2, 2024

I do not have knowledge of the javascript but the existing feature "<counter-variable-name>-last is set to yes for the last entry in the list, no for the others" is theoretically already taking this into account.

from tiddlywiki5.

AnthonyMuscio avatar AnthonyMuscio commented on June 2, 2024

@saqimtiaz I( need to leave performance considerations to others, but I would have thought the logic needed to provide the <counter-variable-name>-last would already have impacted the performance and making the total items only a matter of returning it.

  • To not have this feature, the same filter needs to be run with a count operator to get the total which seems a more costly way

from tiddlywiki5.

saqimtiaz avatar saqimtiaz commented on June 2, 2024

@AnthonyMuscio the reason for the performance impact is discussed in the linked issue.

from tiddlywiki5.

AnthonyMuscio avatar AnthonyMuscio commented on June 2, 2024

@AnthonyMuscio the reason for the performance impact is discussed in the linked issue.

As I said, I looked and cant understand or provide any input.

from tiddlywiki5.

AnthonyMuscio avatar AnthonyMuscio commented on June 2, 2024

I note that the existing count widget, and count operator may already have code in relation to the total items after the limit[] operator. thus may be related to any resulting fix.

from tiddlywiki5.

AnthonyMuscio avatar AnthonyMuscio commented on June 2, 2024

I believe what I proposed is correct and I don't understand the arguments at the link I was directed to.

I have since stored the total count in behind a custom widget for list reports.

from tiddlywiki5.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.