# Project Development To-Do List

This list outlines the key development tasks based on our discussion for enhancing the project component and its interaction with child ibgibs and agents.

## High-Level Tasks

- [ ] Refactor `ProjectComponentInstance` to be a tabbed interface.
- [ ] Implement dedicated agents per ibgib context.
- [ ] Establish agent delegation mechanisms.
- [ ] Develop a system for associating views/components with ibgibs based on project metadata.
- [ ] Create an API function for adding child ibgibs (e.g., "create child ibgib").
- [ ] Implement queued commands for saving changes to ibgibs.
- [ ] Design and implement UI elements for adding children within the project component.

## Detailed Tasks

### Agent Architecture

- [ ] Define interfaces/base classes for context-aware agents.
- [ ] Update `initAgents` in `ProjectComponentInstance` to create/load a dedicated project agent.
- [ ] Implement logic for agents to "witness" relevant ibgibs (project, children).
- [ ] Design and implement agent delegation patterns (e.g., via API functions, rel8s).
- [ ] Consider a mechanism for agents to discover or be assigned to specific ibgib contexts.

### Tab Management

- [ ] Modify `ProjectComponentInstance` to inherit from or utilize a tabbed interface base class/utility.
- [ ] Implement logic within `ProjectComponentInstance` to manage a collection of child tabs.
- [ ] Add functionality to open a new tab in the project component for a given child ibgib address.
- [ ] Ensure tab switching correctly updates the content area with the appropriate child component.

### Child Tab Content

- [ ] Update child components (e.g., a future text editor component) to accept a `contextIbGib` property.
- [ ] Ensure child components load and render based on the data in their `contextIbGib`.
- [ ] Implement `handleContextUpdated` in child components to react to updates of their `contextIbGib` proxy.

### View Association

- [ ] Define the structure for storing view association metadata within the `ProjectIbGib_V1` (e.g., in `data` or `addlData`).
- [ ] Develop a lookup mechanism within `ProjectComponentInstance` to determine the appropriate component to render for a child ibgib based on this metadata.
- [ ] Create placeholder components for different view types (e.g., a basic text viewer, a generic data viewer).

### Creating Children/New Files

- [ ] Define the `APIFunctionInfo` for "create child ibgib" (or similar).
- [ ] Implement the logic for this API function to create a new ibgib, set its initial data/metadata, and create the `rel8` back to the parent project ibgib.
- [ ] Integrate this API function into the relevant agent(s) (e.g., the project agent).
- [ ] Modify the API function to trigger the opening of a new tab in the hosting `ProjectComponentInstance` with the newly created child ibgib as context.

### Saving

- [ ] Implement a queueing mechanism for save operations.
- [ ] Modify components that allow mutation (e.g., a text editor) to add save requests to the queue instead of saving immediately.
- [ ] Implement a background process or service to process the save queue, performing the necessary transforms and persistence.
- [ ] Ensure that successful saves trigger the update of the ibgib's proxy, leading to component re-renders.

### UI for Adding Children

- [ ] Design UI elements within the `ProjectComponentInstance` for initiating the creation of new child ibgibs.
- [ ] Explore options like a "+" button with a dropdown menu for different child types ("Text File", "Image", etc.).
- [ ] Consider integrating this functionality with the existing submit button UX.
- [ ] Implement event listeners and handlers to trigger the "create child ibgib" API function when a UI element is activated.
- [ ] Investigate keyboard shortcut integration for common actions like creating a text file.

## Future Considerations (Out of Scope for Initial Pass)

- [ ] More sophisticated agent delegation and communication patterns.
- [ ] Drag-and-drop or other intuitive ways to add/rearrange children.
- [ ] More advanced view association rules (e.g., based on user preferences, ibgib content analysis).
- [ ] Conflict resolution for concurrent save operations on the same ibgib.