fix(player): marks are weighed when answered, lit and pressed hold under the pointer, and Restart is one glyph
The watched toggle weighed its own click at click time against marks stamped when the server answered, so the late answer of its previous click overruled the newer one; it now holds its word while any of its writes is on the way, is stamped at the answer, and drops a refused write. The hosts return the write. In a live search the feed's own answered writes stand down over the rows, which carry the marks, so a newer mark from the related list reaches a card the feed touched earlier. A lit mode cycle got the hover layer, and a variant's hover colour outranked the pressed and lit colours: the state layer stands down on [data-lit] and those colours are important. The menus' Play from the beginning wears RotateCcw like the card's Restart, Reset wears Eraser and Redownload the retry arrow (DESIGN decision log). Tests pin the toggle's orders, the Watch later mark at its call sites, the live-search overrides, the hover exemptions and the menu glyphs.
This commit is contained in:
@@ -10,7 +10,6 @@ import {
|
||||
PinOff,
|
||||
Play,
|
||||
RotateCcw,
|
||||
SkipBack,
|
||||
Star,
|
||||
} from "lucide-react";
|
||||
import { qk } from "../../lib/queryKeys";
|
||||
@@ -195,7 +194,7 @@ function useHomeCardMenu({
|
||||
{
|
||||
id: "restart",
|
||||
label: t("card.restartTitle"),
|
||||
icon: <SkipBack className="w-4 h-4" />,
|
||||
icon: <RotateCcw className="w-4 h-4" />,
|
||||
onSelect: () => onPlay(target, 0),
|
||||
},
|
||||
]
|
||||
@@ -837,7 +836,8 @@ export default function Home() {
|
||||
// A full refetch, unlike the feed's stale-mark: these rails are two dozen rows, and marking
|
||||
// something watched genuinely changes what the page should answer (it can retire the hero).
|
||||
// The feed avoids this because it would refetch ten infinite-query pages per click.
|
||||
void writeVideoState(qc, id, status)
|
||||
const write = writeVideoState(qc, id, status);
|
||||
void write
|
||||
.then(() => {
|
||||
return qc.invalidateQueries({ queryKey: qk.discover() });
|
||||
})
|
||||
@@ -849,6 +849,7 @@ export default function Home() {
|
||||
// would describe a state the user can see is untrue, over a fully populated page whose
|
||||
// invalidations never even ran (they sit inside `.then`).
|
||||
.catch((e: unknown) => notifyActionError(e, t("home.actionFailed")));
|
||||
return write;
|
||||
},
|
||||
[qc, t],
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user