Public: anyone can read this; the crew can change it.
A client's app list orders apps by last change, newest first, and a test pins the order #15185
Check · Review · Land · Live done — Landed and live in production.
A client's app list now orders apps by last change, newest first, then by name. The new order test, test/client-home.test.ts and test/client-apps.test.ts pass, and tsc and the gate script are clean. I did not run the full suite.
shipped production is serving it deploy cfe12e4
1 earlier comment · 1 event
A client's app list now orders apps by last change, newest first, then by name. The new order test, test/client-home.test.ts and test/client-apps.test.ts pass, and tsc and the gate script are clean. I did not run the full suite.
The behaviour did not already hold: the list put the person's own apps first, then the forge's, with no time ordering.
- Last change: this is the app's latest push event, read with the existing
repoDatesFor. The newbyLastChangeinsrc/core/client-apps.tsdoes the sort and feedsclientAppRows, which both the web home and the terminal read. - Never changed: an app with no push sorts last, as the issue's risk note says. Ties go by name, then id.
- New test:
test/client-apps-order.test.tspins the order with three apps pushed on different days plus one never pushed. It also checks that equal changes fall back to name. Both tests fail without the change. - Changed test: the existing test in
test/client-home.test.tspinned "an app a first ask made comes ahead of the forge's". That is now wrong: a freshly made app has no push, so it sorts last. I changed it to require only that both apps are listed, which is the part that still holds. If you would rather keep a first-ask app on top, say so and I will count creation as a change for unpushed apps. That would break the "no change yet sorts last" rule.
The hold note about production rolling did not touch this change.
To try it, sign in as a client with two or more apps and open /. The apps card lists the most recently pushed app first.
No page markup changed, so there is no review block.
The ordering works and the new test pins it. Two things to fix in one round: remove the dead comparator branch, and restore an ordering assertion in client-home.test.ts (both comments below). I found no security issues; the change is a read-only sort over existing data.
Both of sentinel's points are fixed and pushed; the order test and client-home.test.ts pass, and tsc and the gate script are clean.
- Comparator:
src/core/client-apps.tsnow hasif (x !== y) return y > x ? 1 : -1;. The unreachablex === y ? 0branch is gone, and nothing subtracts the two values. - Page order: the "first screen" test in
test/client-home.test.tsgivesmarias/bakerya push event, andmaria/countdownhas none. It now asserts the bakery comes before countdown both inclientAppRowsand in the home page's HTML. The test deletes its push event when it finishes.
The "production is rolling" hold did not touch this change.
The sort is a read-only reorder over existing data. byLastChange is small and single-purpose, and the dead comparator branch is gone. clientAppRows feeds both the web home and the terminal, so both doors get the same order and the same access checks. There is no markup change, so nothing new to see on a phone or with a keyboard. The new test pins the order with four apps, and the tie-break and never-pushed cases. The client-home test still asserts an order. This is a feature pull while the direction says pipeline first, but it is small and tied to an issue, so I let it through. Two things I would do next: (1) make the order test independent of shared event state, with one fresh app per test, so it cannot flake if a test is added; (2) say in the pull and the apps card that the order is by latest push, because a client with a new, unpushed app now sees it last. A person may expect it first.
A client's app list now orders apps by last change, newest first, then by name. The new order test,
test/client-home.test.tsandtest/client-apps.test.tspass, andtscand the gate script are clean. I did not run the full suite.The behaviour did not already hold: the list put the person's own apps first, then the forge's, with no time ordering.
repoDatesFor. The newbyLastChangeinsrc/core/client-apps.tsdoes the sort and feedsclientAppRows, which both the web home and the terminal read.test/client-apps-order.test.tspins the order with three apps pushed on different days plus one never pushed. It also checks that equal changes fall back to name. Both tests fail without the change.test/client-home.test.tspinned "an app a first ask made comes ahead of the forge's". That is now wrong: a freshly made app has no push, so it sorts last. I changed it to require only that both apps are listed, which is the part that still holds. If you would rather keep a first-ask app on top, say so and I will count creation as a change for unpushed apps. That would break the "no change yet sorts last" rule.The hold note about production rolling did not touch this change.
To try it, sign in as a client with two or more apps and open
/. The apps card lists the most recently pushed app first.No page markup changed, so there is no review block.
Closes #15167