MCPcopy Create free account
hub / github.com/SpartanJ/eepp / writeToLastChat

Method writeToLastChat

src/tools/ecode/plugins/aiassistant/chatui.cpp:1857–1894  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1855}
1856
1857void LLMChatUI::writeToLastChat( const std::string& text ) {
1858 runOnMainThread( [this, text] {
1859 removeWaitingBubble();
1860
1861 UIWidget* chatAdded = nullptr;
1862 if ( mChatsList->getChildCount() > 0 ) {
1863 auto* lastChild = mChatsList->getLastChild()->asType<UIWidget>();
1864 if ( lastChild->hasClass( "llm_conversation" ) && !lastChild->hasClass( "llm_plan" ) &&
1865 !lastChild->hasClass( "llm_tool_call" ) &&
1866 !lastChild->hasClass( "llm_thought" ) ) {
1867 auto* roleDDL = lastChild->findByClass<UIDropDownList>( "role_ui" );
1868 if ( roleDDL && roleDDL->getListBox()->getItemSelectedIndex() == 1 ) {
1869 chatAdded = lastChild;
1870 }
1871 }
1872 }
1873
1874 if ( nullptr == chatAdded ) {
1875 chatAdded = addChatUI( LLMChat::Role::Assistant );
1876 }
1877
1878 auto* editor = chatAdded->findByClass<UICodeEditor>( "data_ui" );
1879 if ( !editor )
1880 return;
1881
1882 auto* thinking = editor->findByClass<UIImage>( "thinking" );
1883 if ( thinking ) {
1884 auto thinkingID = String::hash( String::format( "thinking-%p", thinking ) );
1885 thinking->removeActionsByTag( thinkingID );
1886 thinking->setVisible( false );
1887 }
1888
1889 editor->getDocument().textInput( String::fromUtf8( text ) );
1890 editor->setCursorVisible( false );
1891 resizeToFit( editor );
1892 mChatScrollView->getVerticalScrollBar()->setValue( 1.0f );
1893 } );
1894}
1895
1896void LLMChatUI::updateAgentModeUI() {
1897 mModelBtn->setVisible( !mIsAgentMode );

Callers

nothing calls this directly

Calls 14

hashFunction · 0.85
formatFunction · 0.85
getLastChildMethod · 0.80
removeActionsByTagMethod · 0.80
textInputMethod · 0.80
getDocumentMethod · 0.80
setCursorVisibleMethod · 0.80
getChildCountMethod · 0.45
hasClassMethod · 0.45
getItemSelectedIndexMethod · 0.45
getListBoxMethod · 0.45
setVisibleMethod · 0.45

Tested by

no test coverage detected