Fix 0-point estimate treated as unestimated causing poker loop
All checks were successful
Build & Push Container Image / build (push) Successful in 10s
All checks were successful
Build & Push Container Image / build (push) Successful in 10s
Root cause: estimate field used || 0 which collapsed both null (never estimated) and 0 (estimated as zero) into the same value. The filter !estimate then matched both, so saving 0 points left the issue in the unestimated list and advanceToNext re-pokered it. Fix: use ?? null so 0 is a distinct valid estimate, and filter on == null to only match truly unestimated issues. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
4f5c71e811
commit
f17072116d
2 changed files with 7 additions and 7 deletions
|
|
@ -34,7 +34,7 @@ export default function Room({ room, user, dark, toggleDark, onBack }) {
|
|||
}
|
||||
|
||||
function startFirstUnestimated(issueList) {
|
||||
const issue = issueList.find((i) => !i.estimate || i.estimate === 0);
|
||||
const issue = issueList.find((i) => i.estimate == null);
|
||||
if (!issue) {
|
||||
finishSession();
|
||||
return;
|
||||
|
|
@ -75,13 +75,13 @@ export default function Room({ room, user, dark, toggleDark, onBack }) {
|
|||
|
||||
const currentKey = activeSessionRef.current.issue.key;
|
||||
const updated = issuesRef.current.map((i) =>
|
||||
i.key === currentKey ? { ...i, estimate, estimated: true } : i
|
||||
i.key === currentKey ? { ...i, estimate } : i
|
||||
);
|
||||
issuesRef.current = updated;
|
||||
setIssues(updated);
|
||||
setActiveSession(null);
|
||||
|
||||
const next = updated.find((i) => !i.estimated && (!i.estimate || i.estimate === 0));
|
||||
const next = updated.find((i) => i.estimate == null);
|
||||
if (!next) {
|
||||
finishSession();
|
||||
return;
|
||||
|
|
@ -90,7 +90,7 @@ export default function Room({ room, user, dark, toggleDark, onBack }) {
|
|||
setTimeout(() => startSessionForIssue(next), 300);
|
||||
}, []);
|
||||
|
||||
const estimatedCount = issues.filter((i) => i.estimated || (i.estimate && i.estimate > 0)).length;
|
||||
const estimatedCount = issues.filter((i) => i.estimate != null).length;
|
||||
const totalCount = issues.length;
|
||||
|
||||
if (loading) {
|
||||
|
|
@ -120,7 +120,7 @@ export default function Room({ room, user, dark, toggleDark, onBack }) {
|
|||
<p className="text-sm text-slate-600 dark:text-slate-400 m-0 mt-0.5 truncate">{issue.title}</p>
|
||||
</div>
|
||||
<span className="font-bold text-purple-600 dark:text-purple-400 shrink-0">
|
||||
{issue.estimate || 0} pts
|
||||
{issue.estimate ?? '–'} pts
|
||||
</span>
|
||||
</li>
|
||||
))}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue