This repository was archived by the owner on May 11, 2026. It is now read-only.
fix: restore Agents details panel + replay date input usability + data-testid forwarding#117
Open
AdriankennethCS wants to merge 6 commits into
Open
Conversation
| /> | ||
| )} | ||
| {view === 'replay' && <ReplayView />} | ||
| {view === 'chat' && <ChatView />} |
There was a problem hiding this comment.
ChatView ignores selected agent from navigation
When handleOpenChat(agentId) is called from AgentsView, it sets selectedAgentId in App state and navigates to the chat view. However, ChatView is rendered without any props (<ChatView />), so it doesn't receive the selected agent. ChatView maintains its own internal selectedAgentId state initialized to empty string, and its useEffect auto-selects the first agent from the list. This means clicking "Chat" for a specific agent shows the wrong agent selected in the chat interface.
Additional Locations (1)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Body:
Fix Agents Details: ensure selection updates and details panel renders reliably
Fix Replay date inputs: switch to text inputs with multi-format parsing + validation + persistence
Add data-testid hooks needed for Comet QA selectors
Fix UI components (Button/Card) to forward DOM attributes (e.g., data-testid) via props spread
QA checklist
Agents: clicking Details updates right panel and header
Replay: typing/pasting dates works; values persist after Load; invalid formats show error
Comet selectors: [data-testid="agent-detail-panel"], replay-from/to/load, etc. present
Type-check + build passpread
data-testid hooks verified in DevTools: agent-detail-panel, agent-detail-title, replay-from/to/load
Note
Establishes a TypeScript monorepo alongside Python with a full Node API and React web dashboard.
/health,/agents,/replay,/chat), Zod validation, centralized error handling, in-memory stores (state/equity/log/chat), agent strategies (FlatValue, FractionalKelly, RandomBaseline) viaAgentRegistry, trading engine (applyOrderIntents) with PnL/exposure logic, agent runner + scheduler, market data layer (Gamma/CLOB) mapped toMarketSnapshot, and comprehensive tests (Vitest)Written by Cursor Bugbot for commit 9e6ba5d. This will update automatically on new commits. Configure here.
Summary
This PR addresses QA automation blockers and review feedback across Atlas Prediction Lab:
Ensures data-testid attributes propagate correctly through shared UI components (Button/Card).
Removes duplicate “initial fetch” calls on mount where usePolling(..., enabled=true) already performs the initial request.
Prevents duplicated user messages in the LLM prompt by building the message array before persisting the current user message into the chat store.
Removes leftover debug logging from App.tsx.
Changes
apps/web/src/ui/Button.tsx, apps/web/src/ui/Card.tsx
Forward DOM attributes reliably (e.g., data-testid, aria-*) by spreading props correctly.
apps/web/src/components/AgentsView.tsx
Remove redundant mount useEffect fetch (usePolling already does initial fetch).
apps/web/src/components/Dashboard.tsx, apps/web/src/components/AgentDetail.tsx
Remove redundant mount fetch for same reason.
apps/web/src/App.tsx
Remove debug console.log.
apps/api/src/services/ChatService.ts
Fix duplicated user message in LLM prompt (avoid adding the user message to history before building the prompt messages).
How to test (manual)
Start dev:
pnpm -C apps/api dev
pnpm -C apps/web dev
Agents page:
Verify details panel updates when switching agents.
Verify data-testid selectors exist in DOM (DevTools console):
document.querySelector('[data-testid="agent-detail-panel"]')
document.querySelectorAll('[data-testid^="agent-details-btn-"]').length
Replay page:
Verify date inputs accept typing/paste and persist after “Load Replay”.
Verify selectors:
document.querySelector('[data-testid="replay-from"]')
document.querySelector('[data-testid="replay-to"]')
Chat:
Send a message and confirm it does not appear twice in the prompt/context behavior.
Notes
usePolling already handles initial fetch; removing the extra mount fetch reduces duplicate network calls.
Fix ChatView history pairing bug (sentMessageRef + effect only on chatResponse)