Skip to content

refactor(tarko): consolidate state atoms#1237

Merged
ulivz merged 4 commits intomainfrom
refactor/consolidate-state-atoms
Aug 25, 2025
Merged

refactor(tarko): consolidate state atoms#1237
ulivz merged 4 commits intomainfrom
refactor/consolidate-state-atoms

Conversation

@ulivz
Copy link
Member

@ulivz ulivz commented Aug 22, 2025

Summary

Consolidate fragmented state atoms to improve maintainability and reduce complexity.

Changes:

  • Merge modelInfoAtom, agentInfoAtom, and workspaceInfoAtom into unified sessionMetadataAtom
  • Consolidate isProcessingAtom into agentStatusAtom with derived compatibility
  • Maintain backward compatibility through derived atoms
  • Address existing FIXME comment about merging session metadata atoms

Benefits:

  • Reduced state fragmentation and improved consistency
  • Better state organization with logical grouping
  • Easier to manage related state updates atomically
  • Maintains full backward compatibility

Checklist

  • Added or updated necessary tests (Optional).
  • Updated documentation to align with changes (Optional).
  • Verified no breaking changes, or prepared solutions for any occurring breaking changes (Optional).
  • My change does not involve the above items.

@netlify
Copy link

netlify bot commented Aug 22, 2025

Deploy Preview for agent-tars-docs ready!

Name Link
🔨 Latest commit da8ef9e
🔍 Latest deploy log https://app.netlify.com/projects/agent-tars-docs/deploys/68ac221b4a684d00087d296d
😎 Deploy Preview https://deploy-preview-1237--agent-tars-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

- Merge modelInfoAtom, agentInfoAtom, and workspaceInfoAtom into sessionMetadataAtom
- Consolidate isProcessingAtom into agentStatusAtom with derived compatibility
- Maintain backward compatibility with derived atoms
- Reduce state fragmentation and improve consistency
- Address FIXME comment about merging session metadata atoms
@ulivz ulivz force-pushed the refactor/consolidate-state-atoms branch from 410d5e9 to 2d0f0f2 Compare August 23, 2025 06:32
ulivz added 2 commits August 23, 2025 14:40
Remove modelInfoAtom, agentInfoAtom, and workspaceInfoAtom as they are no longer used anywhere in the codebase.
- Replace custom SessionMetadata with SessionItemInfo['metadata'] from server
- Remove duplicate ModelInfo and AgentInfo types from frontend
- Update all components to use unified sessionMetadata structure
- Simplify state management by using server-side type definitions
- Improve type consistency between frontend and backend
- Reduce maintenance overhead from duplicate type definitions
- Add workspace to metadata instead of top-level in sessionMetadataAtom
- Replace any type with proper SessionItemInfo metadata type
- Use SessionItemInfo['metadata'] type for AboutModal props
@ulivz ulivz merged commit 1447009 into main Aug 25, 2025
10 checks passed
@ulivz ulivz deleted the refactor/consolidate-state-atoms branch August 25, 2025 09:08
ulivz added a commit that referenced this pull request Aug 31, 2025
Fix UI components to display model.displayName instead of raw modelId
when displayName is configured. This resolves the regression introduced
by state consolidation in PR #1237.

Changes:
- Add displayName field to SessionItemInfo.metadata.modelConfig interface
- Update ModelSelector.tsx to show displayName || modelId for current session
- Update AboutModal.tsx to show displayName || modelId in model info
- Update Navbar.tsx to use displayName || modelId for width calculations

Fixes: #1312
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.

1 participant

Comments