Skip to content

feat: Merge PR features with test-IDs from Optimizecodecloudagents - #26

Closed
dsactivi-2 wants to merge 6 commits into
mainfrom
feat/merged-pr-features-with-testids
Closed

feat: Merge PR features with test-IDs from Optimizecodecloudagents#26
dsactivi-2 wants to merge 6 commits into
mainfrom
feat/merged-pr-features-with-testids

Conversation

@dsactivi-2

Copy link
Copy Markdown
Owner

Summary

Merged features from Optimizecodecloudagents PRs #2, #4, #7 with proper test-IDs.

New Components

  • ThemeProvider.tsx - Dark/light/system theme switching with localStorage persistence
  • ThemeToggle.tsx - Dropdown button for theme selection

Updated Components

  • AgentCard.tsx - Added:

    • spokenLanguage support (de/en/bs/sr)
    • agentType (standard/influencer)
    • contentAutonomy badge
    • Influencer styling (purple gradient)
    • All test-IDs preserved and extended
  • CreateAgentDialog.tsx - Added:

    • Spoken language selector
    • Agent type selector (Standard/Influencer)
    • Content autonomy switch (auto-enabled for influencer)
    • All test-IDs preserved and extended

New Documentation

  • docs/AGENT_CONTROL.md - Complete API documentation for agent control endpoints

Test-IDs

All components follow naming convention: cloudagents.{component}.{element}.{action}

Examples:

  • cloudagents.theme.toggle.button
  • cloudagents.agent.create.name.input
  • cloudagents.agent.{id}.badge.influencer

Source PRs (Optimizecodecloudagents)

Changes

  • 5 files changed
  • 971 insertions, 22 deletions

Test Plan

  • TypeScript build passes
  • Pre-commit checks pass
  • Manual test theme switching
  • Manual test agent creation with new fields

🤖 Generated with Claude Code

dsactivi and others added 6 commits January 1, 2026 04:00
- Add core-brain.ts client for connecting to brain-core API (49.13.158.176:5001)
- Implement Pre-Recall: Search core brain before AI response for context
- Implement Writeback: Store Q&A pairs in core brain (append-only)
- User mapping: Pass real userId to brain-core (auto-created if not exists)

Features:
- coreBrainSearch(): Search central knowledge base
- coreBrainStore(): Store memories (append-only, no overwrites)
- coreBrainRecent(): Get recent memories
- buildCoreBrainContext(): Build context string for prompt injection

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Auto-fixed by GitHub Actions
- POST /api/auth/reset-password (admin only)
- Validates password length (min 8 chars)
- Logs password_reset event to audit log
- Added new audit event types: password_reset, user_created, user_deleted

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
🤖 Auto-fixed by GitHub Actions
- src/lib/api.ts: Complete API client with all 178 backend endpoints
  - Auth, Users, Agents, Tasks, Chat, Audit, Ops, Brain, Memory
  - Settings, Enforcement, GitHub, Linear, Webhooks, Modules, Billing
  - Full TypeScript types for all API responses

- src/components/UsersPage.tsx: User management (CRUD)
  - List, create, edit, delete users
  - Password reset functionality
  - Role management (admin/user/demo)
  - User stats dashboard

- src/components/AuditPage.tsx: Audit & Ops dashboard
  - Event log with filtering
  - Blocked tasks management (approve/reject)
  - Operations statistics
  - STOP-Score monitoring

- src/components/IntegrationsPage.tsx: External integrations
  - GitHub repos and issues
  - Linear teams and issues
  - Webhook management (CRUD, test)

- Updated App.tsx with new navigation tabs

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Components (with test-IDs):
- NEW: ThemeProvider.tsx - dark/light/system theme switching
- NEW: ThemeToggle.tsx - theme toggle dropdown button
- MERGED: AgentCard.tsx - added spokenLanguage, agentType, contentAutonomy
- MERGED: CreateAgentDialog.tsx - added influencer type, spoken language selector

Documentation:
- NEW: docs/AGENT_CONTROL.md - Agent Control API documentation

Features merged from PRs:
- PR #2: ThemeProvider, ThemeToggle
- PR #4: Influencer agent type, Serbian language support, content autonomy
- PR #7: AGENT_CONTROL.md API documentation

All components include data-testid attributes following naming convention:
cloudagents.{component}.{element}.{action}

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Comment on lines +94 to +99
const [usersRes, statsRes] = await Promise.all([
usersApi.list(),
usersApi.stats(),
]);
setUsers(usersRes.users || []);
setStats(statsRes);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The UsersPage component expects a raw stats object from usersApi.stats(), but the API returns a wrapped object { success, stats }. This mismatch will cause stats cards to display undefined.
Severity: HIGH | Confidence: High

🔍 Detailed Analysis

The usersApi.stats() endpoint returns a wrapped response object: { success: boolean, stats: { ... } }. However, the UsersPage component at lines 94-99 incorrectly assumes the API returns the raw stats object directly. The statsRes variable is assigned the wrapped object, and setStats(statsRes) stores this incorrect structure in the component's state. When the component later attempts to render properties like stats.total or stats.active, it accesses properties on the wrapped object, resulting in undefined values and breaking the user statistics display cards.

💡 Suggested Fix

In UsersPage.tsx, update the handling of the statsRes to correctly unwrap the nested stats object before calling setStats. For example: setStats(statsRes.stats). This will align the component's state with the data structure used for rendering.

🤖 Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: src/components/UsersPage.tsx#L94-L99

Potential issue: The `usersApi.stats()` endpoint returns a wrapped response object: `{
success: boolean, stats: { ... } }`. However, the `UsersPage` component at lines 94-99
incorrectly assumes the API returns the raw `stats` object directly. The `statsRes`
variable is assigned the wrapped object, and `setStats(statsRes)` stores this incorrect
structure in the component's state. When the component later attempts to render
properties like `stats.total` or `stats.active`, it accesses properties on the wrapped
object, resulting in `undefined` values and breaking the user statistics display cards.

Did we get this right? 👍 / 👎 to inform future reviews.
Reference ID: 508565

@dsactivi-2

Copy link
Copy Markdown
Owner Author

Replaced by clean PR - original branch had merge conflicts with old commits

@dsactivi-2 dsactivi-2 closed this Jan 1, 2026
@dsactivi-2
dsactivi-2 deleted the feat/merged-pr-features-with-testids branch January 1, 2026 14:59
@dsactivi-2

Copy link
Copy Markdown
Owner Author

n

dsactivi-2 pushed a commit that referenced this pull request Mar 2, 2026
…-compatibility

Add TypeScript support for Jest 30.2.0 configuration
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants