Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/components/SuiteWizard.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ if (isInteractive && !isSelectedOptionButton) {
}
}

if (answers[step] == null) return
if (answers[step] === null) return

event.preventDefault()
handleNext()
Expand Down
2 changes: 1 addition & 1 deletion src/components/TraceViewer.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function TraceStep({ step, index, defaultOpen }) {
}

function TracePayload({ label, value }) {
if (value == null || value === '') return null
if (value === null || value === '') return null
return (
<div>
<p className="text-[11px] font-semibold uppercase tracking-wide mb-1 dark:text-text-muted text-gray-400">
Expand Down
2 changes: 1 addition & 1 deletion src/lib/useAnalytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ function computeStats(events, timeRange = 'all') {
}

// Longest streak ever
const sortedDays = [...allDayKeys].sort()
const sortedDays = [...allDayKeys].sort((a, b) => a - b)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

rg -n -C 4 'allDayKeys|sortedDays|function toDateKey' src/lib/useAnalytics.js

node - <<'NODE'
const days = ['2026-08-02', '2026-08-01']
const sorted = [...days].sort((a, b) => a - b)

if (sorted[0] !== '2026-08-01') {
  console.error('Unexpected result:', sorted)
  process.exit(1)
}

console.error('The arithmetic comparator does not sort YYYY-MM-DD strings.')
process.exit(1)
NODE

Repository: AditthyaSS/iloveAgents

Length of output: 2171


Sort the date keys with a comparator that produces a valid ordering.

allDayKeys contains YYYY-MM-DD strings from toDateKey, so a - b returns NaN. Array.prototype.sort keeps the insertion order when the comparator does not return a valid comparison result. Since streak processing needs chronological order, use sorted = [...allDayKeys].sort() or a comparator such as a.localeCompare(b).

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/useAnalytics.js` at line 209, Update the sortedDays construction in
the streak-processing flow to sort the YYYY-MM-DD date keys lexicographically,
replacing the numeric subtraction comparator with the default sort or
a.localeCompare-based comparator so chronological ordering is guaranteed.

let longestStreak = 0
let tempStreak = 1
for (let i = 1; i < sortedDays.length; i++) {
Expand Down
2 changes: 1 addition & 1 deletion src/lib/useSessionSpend.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ export function useSessionSpend() {
let inputC = inputCost
let outputC = outputCost

if (inputC == null && inputTokens != null && model) {
if (inputC === null && inputTokens != null && model) {
inputC = estimateInputCost(model, inputTokens) || 0
}
if (outputC == null && outputTokens != null && model) {
Expand Down