Project

General

Profile

Actions

Update TreeView » History » Revision 10

« Previous | Revision 10/12 (diff) | Next »
Tomislav Pleše, 10/05/2025 09:48 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 FLOW: HomeScreen <-> TreeSliverThread <-> TreeSliverItem

USER STORIES:

  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.
  1. 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.
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. 
2. 5. App creates new Point, sends it to backend to be saved - BackendService class.
2. 6. App creates a node. Node's main purpose is to hold Prompt message and Response message. 
2. 7. App creates a card and puts the node (with only prompt) in the card. 
2. 8. App shows the card on the screen - TreeSliverItem class.
2. 9. App sends user's prompt to OpenAI API (via java backend) - OpenAIService class
2. 10. App receives OpenAI's response and saves it in the ThreadMap - ThreadManager class.
2. 11. App shows on screen AI's response in the same card where the user's prompt is - TreeSliverItem class.
  1. New Sub Prompt - when there were previous Prompt/Response combination nodes
3. 1. On the screen are shown one after another previous cards with nodes (Prompt/Response combinations), or only one previous (root) card.
3. 2. User selects a portion of the previous response (from the node.response that is shown on the card).
3. 3. Default popup on the screen is shown, with Copy, Paste, Share... buttons. Added is the App's Sub-prompt button.
3. 4. User taps the Sub-prompt button. 
3. 5. App copies the text portion user selected and pastes it into the text input field.
3. 6. App takes the selected text, start and end positions and propagates it to the TreeNodeModel class. 
3. 7. User writes additional text into the text input field (if they choose this) and presses submit button.
3. 8. 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 (like the selected text, start and end positions) are taken from the node into the PromptArgs.
3. 4. App propagates PromptArgs to the HomeScreen, to be taken as argument in the onPrompt method. 
3. 5. App creates new Point, sends it to backend to be saved - BackendService class.
3. 6. App creates a node. Node's main purpose is to hold Prompt message and Response message. 
3. 7. App creates a card and puts the node (with only prompt) in the card. 
3. 8. App takes the previous node/card and devides it into two parts: 1st part = card with the prompt and response that is from the beginning of the response till the end position (of the seleceted text), and 2nd part = card with only the part of response from the first character after the end position, till the end of the response. So the App divides one card into two cards at the end of the user selected text.
3. 9. App inserts (indented) the new card with the new prompt.    
3. 10. App shows the card on the screen - TreeSliverItem class.
3. 11. App sends user's prompt to OpenAI API (via java backend) - OpenAIService class
3. 12. App receives OpenAI's response and saves it in the ThreadMap - ThreadManager class.
3. 13. App shows on screen AI's response in the same card where the new user's prompt is - TreeSliverItem class.

Actually, this should be the behavior

  1. Submitting 1st Prompt (normal prompt) node structure:

├─ 💬 (1st Prompt) User: What's Earth?
├─ 💬 (1st Response) Assistant: Third planet from the Sun, home to diverse life forms, and the only kn…

(Response) Assistant: Third planet from the Sun, home to diverse life forms, and the only kn…

  1. Submitting 2nd Prompt (sub prompt, with selected text "Sun") node structure:

├─ 💬 (1st Prompt) User: What's Earth?
├─ 💬 (1st Response - 1st part) Assistant: Third planet from the Sun
│ └─ 💬 (2nd Prompt) User: Sun - what's this?
│ └─ 💬 (2nd Response) Assistant: Star at the center of our solar system that provides light and heat to…
└─ 💬 (1st Response 2nd part) Assistant: Third planet from the Sun, home to diverse life forms, and the only kn…

Can you implement this?

Updated by Tomislav Pleše 2 months ago · 12 revisions