Update TreeView » History » Revision 5
Revision 4 (Tomislav Pleše, 10/02/2025 12:45 PM) → Revision 5/12 (Tomislav Pleše, 10/02/2025 01:30 PM)
# Update TreeView CASES 1. Root Creation 2. Root Parent - Directly Under Root 3. Root Parent - Under Regular Point 4. Root-Shard Parent - Under Regular Point 5. Child-Shard Parent - Under Regular Point 6. Root Parent - Root Initial Sharding 7. Root-Shard Parent - Root 2nd Sharding 8. Regular Child - Regular Point Initial Sharding 9. Child-Shard Parent - Regular Point 2nd Sharding FLOW SCREEN: HomeScreen <-> TreeSliverThread <-> TreeSliverItem 1. First Prompt - Root Creation 1. 1. There is a text input field and a submit button on the screen. 1. 2. User writes a prompt and presses submit button. 1. 3. App creates new Point, sends it to backend to be saved - BackendService class. 1. 4. App creates a node. Node's main purpose is to hold Prompt message and Response message. 1. 5. App creates a card and puts the node (with only prompt) in the card. 1. 6. App shows the card on the screen - TreeSliverItem class. 1. 7. App sends user's prompt to OpenAI API (via java backend app) - OpenAIService class. 1. 8. App receives OpenAI's response and saves it in the ThreadMap - ThreadManager class. 1. 9. App shows on screen AI's response in the same card where the user's prompt is - TreeSliverItem class. 2. New Prompt - when there were previous Prompt/Response combination nodes 2. 1. On the screen are shown one after another previous cards with nodes (Prompt/Response combinations), or only one previous (root) card. 2. 2. User writes a prompt and presses submit button. button 2. 3. App takes the pointId from the previous node (most bottom one) and sets it as a currentPointId in PromptArgs - TreeSliverItem. Also, other existing and needed properties are taken from the node into the PromptArgs. 2. 4. App propagates PromptArgs to the HomeScreen, to be taken as argument in the onPrompt method. 1. 3. App creates new Point, sends it to backend to be saved - BackendService class. 1. 4. App creates a node. Node's main purpose is to hold Prompt message and Response message. 1. 5. App creates a card and puts the node (with only prompt) in the card. 1. 6. App shows the card on the screen - TreeSliverItem class. 1. 7. App sends user's prompt to OpenAI API (via java backend) - OpenAIService class 1. 8. App receives OpenAI's response and saves it in the ThreadMap - ThreadManager class. 1. 9. App shows on screen AI's response in the same card where the user's prompt is - TreeSliverItem class. Point In my flutter app I have Point model (from which a node in tree view is created). There is a regular Point, and there is a Shard Point. Shard Point is the one that has one or more ShardDTOs in it's shardList list. Shards are created by sharding: user enters sub-prompt, and from that new Shard is created and added to shardsList. I have already implemented a flow for handling Prompts for regular Points. It goes: PromptInputField -> HomeScreen -> HomeScreenManager -> ThreadManager -> PointManager (when there is no Sharding). I now want to implement a flow that will handle sub-Prompts (which creates Shard Points), where the flow would go: PromptInputField -> HomeScreen -> HomeScreenManager -> ThreadManager -> ShardManager (when there is Sharding (creation of new Shards)). There can be use of existing methods in PointManager where applicable, but main logic should reside in the ShardManager. The branching between Sharding and No Sharding flows is currently in the HomeScreenManger in the method: handlePrompt(). Try to see if it should stay there, or should be moved to the ThreadManager. Look at my code and suggest minimal changes that will make this work.