Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 1cbfac7

Browse files
committed
updates stats buckets for admin stats
1 parent 91fd594 commit 1cbfac7

2 files changed

Lines changed: 14 additions & 8 deletions

File tree

.dex/tasks.jsonl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
{"id":"bnshio68","parent_id":"5pav4yt7","name":"Epic: SOLO battle data foundation","description":"Implement backend/data model changes for SOLO battles while preserving existing battle flows. Include enum/index migration, Zero schema regeneration, mutators for create/start/finish, and queries for existing-attempt lookup + leaderboard data. Include auth/ownership validation and one-attempt enforcement at DB + mutator layer.","priority":1,"completed":true,"result":"Completed SOLO backend foundation: schema/index migration, Zero schema regeneration, dedicated solo create/start/finish mutators, solo attempt/leaderboard queries, and backend invariant validation including duplicate-attempt rejection at DB and mutator levels.","metadata":null,"created_at":"2026-02-06T20:50:44.592Z","updated_at":"2026-02-06T21:41:03.744Z","started_at":"2026-02-06T21:12:50.181Z","completed_at":"2026-02-06T21:41:03.744Z","blockedBy":[],"blocks":[],"children":["8u9rlvnn","ks843qyk","zp9zxaj2","3u470flb","pjqpsbc6"]}
4545
{"id":"bu51ic8c","parent_id":null,"name":"Complete permissions system","description":"Beads description:\nImplement full permissions system for Zero - requires 0.25 syntax migration to be complete first\n\nMetadata:\nbeads_id: battle_mode-4k0\nbeads_status: open\nbeads_type: task\nbeads_priority: 1\nlabels: []\nassignee: null\nnotes: null\ncreated_at: 2025-12-18T11:24:33.095621-07:00\nupdated_at: 2025-12-18T11:24:33.095621-07:00\nclosed_at: None\n\ndependencies:\n- type=blocks issue_id=battle_mode-4k0 depends_on_id=battle_mode-nri created_at=2025-12-18T11:24:37.106627-07:00 created_by=daemon\n- type=blocks issue_id=battle_mode-4k0 depends_on_id=battle_mode-wad created_at=2025-12-18T11:24:37.208857-07:00 created_by=daemon\n- type=blocks issue_id=battle_mode-4k0 depends_on_id=battle_mode-qi9 created_at=2025-12-18T11:24:37.30638-07:00 created_by=daemon","priority":1,"completed":false,"result":null,"metadata":null,"created_at":"2026-01-26T19:33:48.319Z","updated_at":"2026-01-26T19:33:48.319Z","started_at":null,"completed_at":null,"blockedBy":["ucrhr0uk","nnyyw97n","1ecejduu"],"blocks":[],"children":[]}
4646
{"id":"c42fx3xv","parent_id":null,"name":"Add auth context to Zero mutate endpoint","description":"Beads description:\n(empty)\n\nMetadata:\nbeads_id: battle_mode-9te\nbeads_status: closed\nbeads_type: task\nbeads_priority: 2\nlabels: []\nassignee: null\nnotes: null\ncreated_at: 2025-12-18T14:10:02.254789-07:00\nupdated_at: 2025-12-18T14:16:40.882945-07:00\nclosed_at: 2025-12-18T14:16:40.882945-07:00\n\ndependencies: []","priority":1,"completed":true,"result":"Migrated from Beads with closed status preserved. closed_at: 2025-12-18T14:16:40.882945-07:00","metadata":null,"created_at":"2026-01-26T19:30:45.192Z","updated_at":"2026-01-26T19:36:15.142Z","started_at":null,"completed_at":"2026-01-26T19:36:15.142Z","blockedBy":[],"blocks":[],"children":[]}
47+
{"id":"c5gll3bv","parent_id":null,"name":"Tune score buckets for high-end granularity","description":"Adjust admin Solo Target Stats score distribution bucket strategy: broad lower-range bucket through ~70, finer buckets in upper ranges, and break out 95-100 into single-point buckets (95,96,97,98,99,100) to inspect clustering near perfect scores.","priority":1,"completed":true,"result":"Adjusted admin Solo Target Stats bucket strategy in src/routes/(style)/(menu)/admin/+page.svelte. New buckets are: 0-70, 71-79, 80-84, 85-89, 90-94, then single-point buckets 95, 96, 97, 98, 99, 100 for high-end granularity. Updated counting logic to bin by floor(score) so decimal scores map correctly into integer buckets while keeping average score calculation unchanged.","metadata":null,"created_at":"2026-03-18T18:57:42.383Z","updated_at":"2026-03-18T18:59:40.559Z","started_at":"2026-03-18T18:57:52.334Z","completed_at":"2026-03-18T18:59:40.559Z","blockedBy":[],"blocks":[],"children":[]}
4748
{"id":"c8knv8r4","parent_id":null,"name":"Fix drizzle-zero build warnings","description":"Beads description:\n(empty)\n\nMetadata:\nbeads_id: battle_mode-z76\nbeads_status: closed\nbeads_type: task\nbeads_priority: 2\nlabels: []\nassignee: null\nnotes: null\ncreated_at: 2026-01-20T13:25:39.350801-07:00\nupdated_at: 2026-01-20T14:18:14.854518-07:00\nclosed_at: 2026-01-20T14:18:14.854518-07:00\n\ndependencies: []","priority":1,"completed":true,"result":"Migrated from Beads with closed status preserved. closed_at: 2026-01-20T14:18:14.854518-07:00","metadata":null,"created_at":"2026-01-26T19:31:42.772Z","updated_at":"2026-01-26T19:35:44.834Z","started_at":null,"completed_at":"2026-01-26T19:35:44.834Z","blockedBy":[],"blocks":[],"children":[]}
4849
{"id":"ce5k2rbp","parent_id":"xdjw1amk","name":"Add public SOLO leaderboard to recap","description":"Render a leaderboard section on recap for SOLO challenges using completed SOLO battles for the same target. Include rank, user, score, and helpful tie-break display. Highlight the current user row and keep component styling consistent with existing battle surface patterns.","priority":1,"completed":true,"result":"Added a Public Solo Leaderboard section to recap using queries.battles.soloLeaderboardByTarget, showing rank, user, score, completion time, and tie-break date, with current-user row highlighting and existing battle-surface styling conventions.","metadata":null,"created_at":"2026-02-06T20:52:20.416Z","updated_at":"2026-02-06T21:40:47.883Z","started_at":"2026-02-06T21:39:48.566Z","completed_at":"2026-02-06T21:40:47.883Z","blockedBy":["3u470flb","hew6f5mh"],"blocks":["bh88ka6m","aubm53ma"],"children":[]}
4950
{"id":"ckjzk4j2","parent_id":null,"name":"Implement Graffiti CSS framework","description":"Beads description:\nIntegrate https://github.com/stolinski/graffiti - a minimal CSS framework with fluid typography, responsive layouts, and utility classes\n\nMetadata:\nbeads_id: battle_mode-czr\nbeads_status: closed\nbeads_type: feature\nbeads_priority: 2\nlabels: []\nassignee: null\nnotes: null\ncreated_at: 2025-12-19T09:47:55.01261-07:00\nupdated_at: 2026-01-05T16:58:09.938771-07:00\nclosed_at: 2026-01-05T16:58:09.938771-07:00\n\ndependencies: []","priority":1,"completed":true,"result":"Migrated from Beads with closed status preserved. closed_at: 2026-01-05T16:58:09.938771-07:00","metadata":null,"created_at":"2026-01-26T19:30:56.542Z","updated_at":"2026-01-26T19:36:09.863Z","started_at":null,"completed_at":"2026-01-26T19:36:09.863Z","blockedBy":[],"blocks":[],"children":[]}

src/routes/(style)/(menu)/admin/+page.svelte

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,16 @@
2222
};
2323
2424
const scoreBucketDefs: ScoreBucketDef[] = [
25-
{ label: '0-39', min: 0, max: 39 },
26-
...Array.from({ length: 12 }, (_, index) => {
27-
const min = 40 + index * 5;
28-
const max = min === 95 ? 100 : min + 4;
25+
{ label: '0-70', min: 0, max: 70 },
26+
{ label: '71-79', min: 71, max: 79 },
27+
{ label: '80-84', min: 80, max: 84 },
28+
{ label: '85-89', min: 85, max: 89 },
29+
{ label: '90-94', min: 90, max: 94 },
30+
...Array.from({ length: 6 }, (_, index) => {
31+
const min = 95 + index;
32+
const max = min;
2933
return {
30-
label: `${min}-${max}`,
34+
label: `${min}`,
3135
min,
3236
max
3337
};
@@ -75,9 +79,10 @@
7579
7680
const buckets = scoreBucketDefs.map((bucket) => ({
7781
label: bucket.label,
78-
count: scores.filter(
79-
(score) => score >= bucket.min && score <= bucket.max
80-
).length
82+
count: scores.filter((score) => {
83+
const wholePercent = Math.floor(score);
84+
return wholePercent >= bucket.min && wholePercent <= bucket.max;
85+
}).length
8186
}));
8287
8388
const maxBucketCount = buckets.reduce(

0 commit comments

Comments
 (0)