Workspace Engine
The Workspace is the core interactive hub of SREDSimplify, located under src/components/workspace/WorkspaceFrame.tsx. It is designed to provide developers and tax consultants with a seamless context-to-generation pipeline.
3-Pane Layout Architecture
The workspace utilizes react-resizable-panels to offer a customizable three-pane layout. The WorkspaceFrame component acts as the orchestrator for these sub-panes.
ContextManagerPane (Left)
- Responsible for file selection, upload, and context definition.
- Users check boxes next to uploaded files to feed them into the current session's AI context window.
- Automatically polls for file indexing status via
useProjectFilesReact Query hook.
CopilotChatPane (Center)
- The primary conversational interface for interacting with the AI.
- Users can brainstorm, ask for clarifications, and trigger specific SR&ED pipeline generations.
- Handles the streaming UI states (e.g., loading spinners) while the backend executes complex prompt chains.
ArtifactPane (Right)
- Displays the final structured output of AI operations.
- Dynamically renders different artifact sub-components found in
src/components/workspace/artifacts/based on the session type:T661Artifact: Renders the multi-line CRA T661 form preview.LogbookArtifact: Renders the extracted timesheet/logbook tables.PrecheckArtifact: Renders the eligibility scores and feedback.
State Synchronization
The workspaceStore (Zustand) is heavily utilized here to synchronize state across these three separate React components without causing deep prop-drilling or excessive re-renders.
Event Flow Example:
- User selects a file checkbox in the
ContextManagerPane. - The
workspaceStoreupdates its internalselectedContextFilesarray. - The user types a message and clicks "Send" in the
CopilotChatPane. - The Chat pane reads the
selectedContextFilesfrom Zustand and appends their IDs to the outgoing API payload sent to the Spring Boot backend. - Once the AI generation completes, the resulting JSON is saved to
workspaceStoredrafts, triggering theArtifactPaneto re-render and display the generated form.