Skip to content

Conversation

@hannesrudolph
Copy link
Collaborator

@hannesrudolph hannesrudolph commented Jan 7, 2026

Changes:

  • Add usehooks-ts dep.
  • Migrate Runs filters + tool group persistence to useLocalStorage() (Runs()).
  • Migrate Run details groupByStatus + New Run form persisted settings to useLocalStorage().
  • Add tolerant deserializers + tool group helpers (deserializeToolGroups()) + tests.

Testing:

  • cd apps/web-evals && pnpm run lint
  • cd apps/web-evals && pnpm run check-types
  • cd apps/web-evals && npx vitest run

Important

Migrate UI state persistence to useLocalStorage using usehooks-ts and add deserialization functions for better state management in apps/web-evals.

  • Behavior:
    • Migrate UI state persistence to useLocalStorage from usehooks-ts in run.tsx, new-run.tsx, and runs.tsx.
    • Add deserialization functions in storage.ts for boolean, enum, number, and string[].
    • Add deserializeToolGroups() and serializeToolGroups() in tool-groups.ts.
  • Testing:
    • Add tests for deserialization functions in storage.spec.ts.
  • Dependencies:
    • Add usehooks-ts to package.json.

This description was created by Ellipsis for 28c49b1. You can customize this summary. It will automatically update as commits are pushed.

@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. Enhancement New feature or request labels Jan 7, 2026
@roomote
Copy link
Contributor

roomote bot commented Jan 7, 2026

Oroocle Clock   See task on Roo Cloud

Re-review complete. All previously flagged items look resolved.

  • deserializeNumber() should not treat empty string / null as 0 (so ?? DEFAULT fallbacks still apply)
Previous reviews

Mention @roomote in a comment to request specific changes to this pull request or fix all unresolved issues.

@hannesrudolph hannesrudolph added the Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. label Jan 7, 2026
Comment on lines 9 to 15
export function deserializeNumber(raw: string): number | undefined {
const parsed = tryParseJson(raw)
if (typeof parsed === "number" && Number.isFinite(parsed)) return parsed

const asNumber = Number(raw)
return Number.isFinite(asNumber) ? asNumber : undefined
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In deserializeNumber(), falling back to Number(raw) means inputs like "" or "null" deserialize to 0, which can prevent ?? DEFAULT fallbacks from applying and leave a persisted invalid value in localStorage.

Suggested change
export function deserializeNumber(raw: string): number | undefined {
const parsed = tryParseJson(raw)
if (typeof parsed === "number" && Number.isFinite(parsed)) return parsed
const asNumber = Number(raw)
return Number.isFinite(asNumber) ? asNumber : undefined
}
export function deserializeNumber(raw: string): number | undefined {
const parsed = tryParseJson(raw)
if (typeof parsed === "number" && Number.isFinite(parsed)) return parsed
const trimmed = raw.trim()
if (trimmed === "" || trimmed === "null") return undefined
// Legacy raw-string storage: accept only plain decimal numbers.
if (!/^-?\d+(\.\d+)?$/.test(trimmed)) return undefined
const asNumber = Number(trimmed)
return Number.isFinite(asNumber) ? asNumber : undefined
}

Fix it with Roo Code or mention @roomote and request a fix.

Co-authored-by: roomote[bot] <219738659+roomote[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Enhancement New feature or request Issue/PR - Triage New issue. Needs quick review to confirm validity and assign labels. size:L This PR changes 100-499 lines, ignoring generated files.

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

2 participants