Monorepo for Tangled tangled.org

Pull request page - paging inconsistent #611

Open oppi.li
Open opened by oppi.li

when a pr is a stack, the pulls page lists the top pull of the stack, with the rest of the stack as “child pulls” which need to be expanded to see.

However all of the child pulls count towards the paging total.

This leads to odd behaviour where one pulls page may show less pulls.

yeah child pulls count to the paging count!

Is that expected behaviour of a side effect?

its expected behavior... but i don't think it is good behavior. i can't think of the "right way" to do this, even when passing limits to jj log, you tend to get branches that are cut off (when we eventually introduce branching PRs). its tricky to paginate!

Oh I see, that does sound tricky to paginate 🫣

I wonder if the pulls row in the DB could have a root field that points to the first pull that's created as part of the stack? Then querying for pulls could use that root to select the distinct most recent of a stack, which would give you a full page of pulls.

Then fetching all of the other pulls with the root from the DB after.

It'll mean 2 lookups and fetching more than the page size in total though 😔

Sign up or Sign in to add to the discussion.