jonverrier / BraidEng

Engine code for an OpenAI assistant that likes to talk about AI, written using Typescript, Node.js, & the Azure stack. GPT-3 backed with a store of AI Canon documents.
GNU Affero General Public License v3.0
0 stars 1 forks source link

Add a search capability to search messages #3

Open jonverrier opened 2 months ago

jonverrier commented 2 months ago

Likely a panel at the top - do some research on UI patterns.

jonverrier commented 1 week ago

https://stackoverflow.com/questions/9127498/how-to-perform-a-real-time-search-and-filter-on-a-html-table

function searchTable(){ var term, table; // get term to search term = document.getElementById("myInput").value.toLowerCase();

// get table rows, handle as array.
table = Array.from(document.getElementById("myTable").rows);

// filter non-matching rows; these are set to display='none'
table.filter(function(el){return el.textContent.toLowerCase().indexOf(term) == 
-1}).map(x=> x.style.display = "none");

// filter matching rows; these are set to display =''
table.filter(function(el){return el.textContent.toLowerCase().indexOf(term) > -1}).map(x=> x.style.display = "");

}