Project

General

Profile

Actions

Feature #5

closed

Kommentall - Feature #4: Proof of concept

Chatbot - Sub-prompt - FE - Implement Sharding

Added by Tomislav Pleše 4 months ago. Updated about 2 months ago.

Status:
Closed
Priority:
Normal
Start date:
09/24/2025
Due date:
% Done:

100%

Estimated time:
20:00 h (Total: 30:00 h)

Subtasks 1 (0 open1 closed)

Feature #13: FE-Sub-prompt - fix TreeView ClosedTomislav Pleše09/24/2025

Actions
Actions #1

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
Actions #2

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
Actions #3

Updated by Tomislav Pleše 3 months ago

  • Subject changed from Sub-prompt - FE - Implement Sharding to Chatbot - Sub-prompt - FE - Implement Sharding
Actions #4

Updated by Tomislav Pleše 3 months ago

  • Status changed from New to In Progress
Actions #5

Updated by Tomislav Pleše 3 months ago · Edited

ThreadManager.updateConversationThreadMap
Cases for New Point creation:

  1. No current Root Point (ThreadMap = empty) - new Point becomes a Root Point
  2. Under existing Regular Point (ThreadMap = not empty) - new Point is added to the PointChildren of the Root Point
  3. 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
  4. 2nd Sharding - Shard already exists (ThreadMap = not empty, ShardList = not empty) - Shard is added to ShardList, new Point is added to ShardPointChildren
Actions #6

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

    1. 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
    1. 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

    1. Table - code Flow
HomeScreen HomeScreenManager ThreadManager ShardManager Cases:
onSubPrompt handleSubPropmt insertNewPoint createNewPoint
1. Under Regular Point - 1st Sharding
2. Under Existing Shard - 2nd Sharding
    1. 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
Actions #7

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.

Actions #8

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.
Actions #9

Updated by Tomislav Pleše 2 months ago

  • Subtask #13 added
Actions #10

Updated by Tomislav Pleše about 2 months ago

  • Status changed from In Progress to Resolved
Actions #11

Updated by Tomislav Pleše about 2 months ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF