Feature #5
closedKommentall - Feature #4: Proof of concept
Chatbot - Sub-prompt - FE - Implement Sharding
Added by Tomislav Pleše 4 months ago. Updated about 2 months ago.
100%
Updated by Tomislav Pleše 4 months ago
- Subject changed from Chatbot - Subprompt to Sub-prompt - FE - Implement Sharding
- Estimated time changed from 30:00 h to 15:00 h
Updated by Tomislav Pleše 4 months ago
- Project changed from Kommentall to FE-Kommentall
- Estimated time changed from 15:00 h to 20:00 h
Updated by Tomislav Pleše 3 months ago
- Subject changed from Sub-prompt - FE - Implement Sharding to Chatbot - Sub-prompt - FE - Implement Sharding
Updated by Tomislav Pleše 3 months ago · Edited
ThreadManager.updateConversationThreadMap
Cases for New Point creation:
- No current Root Point (ThreadMap = empty) - new Point becomes a Root Point
- Under existing Regular Point (ThreadMap = not empty) - new Point is added to the PointChildren of the Root Point
- 1st Sharding - Regular Point becomes Shard Point (ThreadMap = not empty, ShardList = empty) - Shard is created and added to ShardList, new Point is added to ShardPointChildren
- 2nd Sharding - Shard already exists (ThreadMap = not empty, ShardList = not empty) - Shard is added to ShardList, new Point is added to ShardPointChildren
Updated by Tomislav Pleše 3 months ago · Edited
Flow:
HomeScreen -> HomeScreenManager -> ThreadManager -> PointManager | ShardManager
- current Point = Point/Shard currently in focus on screen
- new Point = Point/Shard created when new Prompt sent
1. Prompt
-
- Table - code Flow:
| HomeScreen | HomeScreenManager | ThreadManager | PointManager | Cases: |
|---|---|---|---|---|
| onPrompt | handlePropmt | insertNewPoint | createNewPoint | |
| 1. Start Thread - New Root | ||||
| 2. Under Regular Point Child | ||||
| 3. Under Point that is a Shard Child - no Sharding |
-
- Table - Point/Shard states:
| 1. Start Thread - New Root | 2. Under Regular Point Child | 3. Under Shard Child - no Sharding | ||
|---|---|---|---|---|
| new PointDTO | id | = new id | = new id | = new id |
| parentId | = new id | = currentPoint.parentId | = currentPoint.parentId | |
| parentShardId | null | null | = currentPoint.ShardId | |
| parent ShardDTO | shardPointChildren | no change | no change | = add newPoint.id |
| parent PointDTO | pointChildren | no change | = add new id | = no chnage |
2. SubPrompt - Sharding
-
- Table - code Flow
| HomeScreen | HomeScreenManager | ThreadManager | ShardManager | Cases: |
|---|---|---|---|---|
| onSubPrompt | handleSubPropmt | insertNewPoint | createNewPoint | |
| 1. Under Regular Point - 1st Sharding | ||||
| 2. Under Existing Shard - 2nd Sharding |
-
- Table - Point/Shard states:
| 1. Under Regular Point - 1st Sharding | 2. Under Existing Shard - 2nd Sharding | Differences | ||
|---|---|---|---|---|
| new PointDTO | id | = new id | = new id | same |
| parentId | = currentPoint.id | = currentPoint.id | same | |
| parentShardId | null | null | same | |
| current ShardDTO | shardId | = new shardId | = new shardId | same |
| shardPointChildren | = add newPoint.id | = add newPoint.id | same | |
| current PointDTO | shardList | = add newShardId | = add newShardId | same |
| new PointDTO | parentShardId | = newShardId | = newShardId | same |
**** Important:¶
Difference between 1st and 2nd Sharding:
- on 1st Sharding - shardsList = null -> Shard just added to empty list
- on 2nd Sharding - shardsList != null -> Shard needs to be inserted into the list at certain index
Updated by Tomislav Pleše 3 months ago · Edited
Claude Code - prompt to implement HandleSubPrompt flow (with Sharding) that starts in the HomeScreenManager¶
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.
Updated by Tomislav Pleše 3 months ago
Errors in the project:
Bash(cd "D:\osobno\kommentall\fe_kommentall" && dart analyze --fatal-infos)
⎿ Error: Analyzing fe_kommentall...
warning - lib\managers\home_screen_manager.dart:21:24 - The value of the field '_backendService' isn't used. Try removing the field, or using it. - unused_field
warning - lib\managers\home_screen_manager.dart:124:13 - The receiver can't be 'null' because of short-circuiting, so the null-aware operator '?.' can't be used. Try replacing the operator '?.' with '.'. - invalid_null_aware_operator
- The operator '?.' is causing the short circuiting at lib\managers\home_screen_manager.dart:123:45.
warning - lib\managers\openai_request_manager.dart:243:65 - The left operand can't be null, so the right operand is never executed. Try removing the operator and the right operand. - dead_null_aware_expression
warning - lib\managers\shard_manager.dart:98:11 - The receiver can't be 'null' because of short-circuiting, so the null-aware operator '?.' can't be used. Try replacing the operator '?.' with '.'. - invalid_null_aware_operator
- The operator '?.' is causing the short circuiting at lib\managers\shard_manager.dart:97:62.
warning - lib\managers\shard_manager.dart:100:64 - The left operand can't be null, so the right operand is never executed. Try removing the operator and the right operand. - dead_null_aware_expression
warning - lib\managers\shard_manager.dart:101:60 - The left operand can't be null, so the right operand is never executed. Try removing the operator and the right operand. - dead_null_aware_expression
warning - lib\managers\shard_manager.dart:200:8 - The declaration '_validateShardList' isn't referenced. Try removing the declaration of '_validateShardList'. - unused_element
warning - lib\managers\thread_manager.dart:4:8 - Unused import: 'package:objectid/objectid.dart'. Try removing the import directive. - unused_import
warning - lib\managers\thread_manager.dart:29:43 - The operand can't be 'null', so the condition is always 'false'. Try removing the condition, an enclosing condition, or the whole conditional statement. - unnecessary_null_comparison
warning - lib\managers\thread_manager.dart:40:50 - The operand can't be 'null', so the condition is always 'true'. Remove the condition. - unnecessary_null_comparison
warning - lib\managers\tree_view_manager.dart:74:37 - The operand can't be 'null', so the condition is always 'true'. Remove the condition. - unnecessary_null_comparison
warning - lib\managers\tree_view_manager.dart:75:63 - The '!' will have no effect because the receiver can't be null. Try removing the '!' operator. - unnecessary_non_null_assertion
info - lib\api_services\openai_service.dart:17:7 - Missing type annotation. Try adding a type annotation. - strict_top_level_inference
13 issues found.
Updated by Tomislav Pleše about 2 months ago
- Status changed from In Progress to Resolved
Updated by Tomislav Pleše about 2 months ago
- Status changed from Resolved to Closed