Antigravity commited on
Commit
3bbaff5
·
1 Parent(s): 3f6f2b9

final: absolute sync of all resources for HF Space - timestamp 2026-04-07 22:35:46

Browse files
.build-trigger CHANGED
@@ -1 +1 @@
1
- 2026-04-07 22:27:49
 
1
+ 2026-04-07 22:35:46
frontend/src/hooks/useWebSocket.js CHANGED
@@ -129,6 +129,8 @@ const useWebSocket = (url) => {
129
  if (data.type === 'reward_update') {
130
  draft.reward = data.reward;
131
  draft.cumulativeReward = data.cumulative;
 
 
132
  }
133
 
134
  if (data.type === 'episode_end') {
 
129
  if (data.type === 'reward_update') {
130
  draft.reward = data.reward;
131
  draft.cumulativeReward = data.cumulative;
132
+ draft.rewardBreakdown = data.breakdown || {};
133
+ draft.rewardHistory = [...(draft.rewardHistory || []), data.reward];
134
  }
135
 
136
  if (data.type === 'episode_end') {
frontend/src/views/DashboardView.jsx CHANGED
@@ -200,8 +200,13 @@ const DashboardView = () => {
200
  </div>
201
  <div className="h-10 w-px bg-outline-variant/20"></div>
202
  <div className="text-right">
203
- <p className="text-[10px] font-mono text-slate-500 uppercase tracking-widest">Current Reward</p>
204
- <p className="font-mono text-lg text-tertiary">{Number(state.cumulativeReward).toFixed(2)}</p>
 
 
 
 
 
205
  </div>
206
  </div>
207
  </div>
@@ -226,6 +231,38 @@ const DashboardView = () => {
226
  />
227
  </div>
228
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  {/* Bottom Row */}
230
  <div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
231
  {/* Incident Brief Mini */}
 
200
  </div>
201
  <div className="h-10 w-px bg-outline-variant/20"></div>
202
  <div className="text-right">
203
+ <p className="text-[10px] font-mono text-slate-500 uppercase tracking-widest">Step Reward</p>
204
+ <p className="font-mono text-lg text-tertiary">{Number(state.reward || 0).toFixed(3)}</p>
205
+ </div>
206
+ <div className="h-10 w-px bg-outline-variant/20"></div>
207
+ <div className="text-right">
208
+ <p className="text-[10px] font-mono text-slate-500 uppercase tracking-widest">Cumulative</p>
209
+ <p className="font-mono text-lg text-tertiary">{Number(state.cumulativeReward || 0).toFixed(2)}</p>
210
  </div>
211
  </div>
212
  </div>
 
231
  />
232
  </div>
233
 
234
+ {/* Reward Breakdown Panel */}
235
+ {state.rewardBreakdown && Object.keys(state.rewardBreakdown).length > 0 && (
236
+ <section className="bg-surface-container-low/40 backdrop-blur-md rounded-lg p-5 border border-white/5">
237
+ <div className="flex items-center gap-2 mb-4">
238
+ <span className="material-symbols-outlined text-primary text-sm">analytics</span>
239
+ <h3 className="text-xs font-bold font-headline tracking-widest uppercase text-primary">Reward Breakdown</h3>
240
+ </div>
241
+ <div className="grid grid-cols-4 md:grid-cols-8 gap-3">
242
+ {Object.entries(state.rewardBreakdown).map(([key, value]) => (
243
+ <div key={key} className="text-center">
244
+ <div className="text-[9px] font-mono text-slate-500 uppercase mb-1">{key.replace(/_/g, ' ')}</div>
245
+ <div className={`font-mono text-lg font-bold ${value > 0 ? 'text-primary' : 'text-slate-600'}`}>
246
+ {typeof value === 'number' ? value.toFixed(3) : value}
247
+ </div>
248
+ </div>
249
+ ))}
250
+ </div>
251
+ {state.rewardHistory && state.rewardHistory.length > 1 && (
252
+ <div className="mt-4 pt-4 border-t border-white/10">
253
+ <div className="text-[9px] font-mono text-slate-500 uppercase mb-2">Reward History</div>
254
+ <div className="flex gap-1 items-end h-12">
255
+ {state.rewardHistory.slice(-16).map((r, i) => (
256
+ <div key={i} className="flex-1 bg-primary/30 rounded-t"
257
+ style={{ height: `${Math.max(10, (r / 1) * 100)}%` }}>
258
+ </div>
259
+ ))}
260
+ </div>
261
+ </div>
262
+ )}
263
+ </section>
264
+ )}
265
+
266
  {/* Bottom Row */}
267
  <div className="grid grid-cols-1 lg:grid-cols-3 gap-6">
268
  {/* Incident Brief Mini */}