Reduce fullbody height by a tiny bit so that everything fits within
the overall height of the screen available, without needing a dummy
no use vertical scrollbar for full body. Rather its hardcoded for
now, in a sense, need to look into all elements competing for vertical
space and see how to make this auto adapt responsively, if there is
any subtle issue beyond me going beyond 100vh.
Set scrollbar in general to thin and minimal contrast subdued look.
Change user gradiant to blue hue, also add a subtle whitish hue based
gradiant to assistant chat messages. Also make trimmed content bgnd
a gradiant.
Wrt print media target, instead of trying to change the body color
directly, use the global variable added for same, so that other elements
also adjust suitably wrt the change like gradiants merging seemlessly
into the changed overall background and so.
Allow the input textarea to grow vertically to an extent, while still
ensuring that it doesnt cross a limit which could lead to additional
full page scrollbar showing up.
Add a border-radius by default across elements. In turn add padding
wrt toolcall details block so that things dont get cutoff and appear
proper.
PopOver menu now auto closes, if user doesnt interact with it, for
a predefined timeout period.
Change the button border color, which seems to make it more pleasent
with current backgrounds at different places.
Update usage note wrt vision and click to toggle wrt title area.
Make the restore / load session block into a details based block.
Also place it into the parent div immidiately, but in hidden state.
Inturn only if a corresponding entry found in the db, create the
button for loading, as well as unhide it. This ensures that the
restore block's position|order doesnt change in the set of ui
elements wrt usage,restore,settings-info.
Move the heading, sessions list and system prompt into a details
block so that user can hide them if required.
avoid the borders around chat message blocks and the chat message
role blocks within them, instead go for a subtle box shadow.
Use gradiants wrt heading, as well as chat message role based color
codings.
Update both the normal/screen view as well as the print view wr
above.
Have a common 1vmin radius wrt buttons in general and chat messages.
While the input area and its buttons have more rounded look.
Force a minimum height wrt the buttons in general, while ensuring
that the popover menu buttons tightly fit the content/icons in them.
Use slight off white body background & make user input area whiter.
Allow button and input area to have rounded borders.
Also adjust the rounding wrt chat messages and popover menu btns.
ui_reset_userinput now resets role associated with user input to
user always.
chat_show now does a full on ui_reset_userinput, and thus inturn
session switching now force cleans up User Input area, state and
associated data (like dataURLs) with chat_show->ui_reset_userinput.
UIRefresh helper does a partial ui_reset_userinput thus cleaning
up the user input state. Inturn given that addsmart_uishow calls
uirefresh, so avoid calling partial ui_reset_userinput after call
to addsmart_uishow.
show_message now sets user input area role to either ToolTemp or
User (all cases other than ToolTemp).
Avoid chat_show getting called twice during starting.
Update description of sys_date_time to be more verbose
Update the readme DONE section, where I had few days back forgotten
and started making entries as parts of a item list or so.
Demote the Popover related mouse event trapping related logs to
debug level, as they are no longer required.
Avoid using brute force chat_show instead use only the optimal
chat_uirefresh wrt all paths in handle_user_submit, rather had
forgotten to change previously.
Rename chatmsg_ui_refresh to chat_uirefresh.
Even in case of the delete path and inturn deleting one of the last
two messages in a chat session, now use the generified chat uirefresh
logic instead of the chat_show full session refresh / recreation of
the session ui
Inturn to make the uirefresh really generic and usable in all cases
including above case, now take care of clearing the tool call edit
/ trigger at the beginning, so that the last 2 messages decide in
turn whether to show a tool call edit/trigger ui or not, as well as
the tool call response edit / submit ui.
SC.add discards any temp role message and not just tool temp msg
New SC.add_smart which either adds a new message to the chat session
or replaces existing last message in the chat session, based on same
role or different, given that the chat session cant have the same
role type chat message occuring adjacent in it. Inturn rename MCUI
chatmsg_add_uishow to chatmsg_addsmart_uishow and use add_smart
* helps wrt trying to rerun a tool call with modified args or so.
Rather prev discard temp role messages in SC.add not good enough
as uniqId will change in its case.
Helps avoid adding duplicate ToolTemp messages in chat session ui
* can help if loading a prev chat session which ended in a user
message without a ai response. User can type in a new message
and continue that old chat session, with the new message, replacing
the old user message as well as initiating handshake with ai server
in a proper manner.
Replace MCUI chatmsg_ui_updateprev_appendlast with chatmsg_ui_refresh
which is a more generic flow, which takes care of updating the ui as
needed irrespective of if the specified set of messages are already
in the chat session ui or not. Also allows the caller to control how
many messages at the end need to be refreshed wrt ui.
Needed as some places we require to delete the chat message as
well as update the corresponding ui block.
And in other places we require to just remove the ui block from
chat session ui and not the underlying chat message from chat history.
Change ui updateprev appendlast to use the ui remove logic.
Now even the user response handling flow (handle_user_submit) has
been updated to use the optimised chat show logic which adjusts
/ updates the chat session ui wrt the last two messages only and
not the full chat history in the chat session.
Move the logic wrt last two messages and ui, into its own func
and inturn use it everywhere as required.
Rename lastMsg to prevLastMsg to match semantic better
Return seperate flags to indicate add and show success or not
Update tool response happy path to use this optimised add show
instead of chat_show (which recreates the full chat session ui).
If deleting a non last (and non just before last) message, then
just directly remove the corresponding chat message block from the
ChatSession UI and be done with it.
However if deleting the last (or just before last) message, then
one needs to decide on whether tool call edit/trigger ui is shown
or removed and so... and similarly wrt tool response edit/submit.
Rename to get_chatmessage_index.
Return the index of the chatmessage deleted.
Add a scroll element into view helper.
Now the UniqId wrt the ChatMessage is stored as a attribute
wrt the corresponding chatmessage block. And same used wrt
scrolling after deleting messages.
When a chat message is deleted, previously the screen would have
moved to last message in the chat session, now it tries to remain
wrt adjacent messages on the screen.
As position-area is not yet officially supported in firefox (its
only in nightly builds, as of now), so switching to the inset
block/inline start/end css properties.
Use position fixed followed by using position-area so that one
can use anchor passed through showPopover.
Avoid the hidePopover from mouseLeave, because as the mouse moves
over the poped up popover ui, the mouseLeave will be called on
the chat message block/container. And that would have closed the
popover and inturn mouseEnter would have got called on ChatMsg,
given now with the popover hidden, the ChatMsg block is directly
accessible. So this leads to twinkling / toggling ie continues
show/hide of the popover.
Inturn in mouseEnter itself decide when to close the previous
popover (ie if the chatmessage id is different from what it was
before).
Trap the mouseenter and mouseleave events wrt the chatmessage
block to show the chatmessage-popover ui inturn within the
corresponding chatmessage.
When ever user clicks the popover menu's delete button, the
uniqId associated with each chat message, is now used to
delete the user selected chat message.
Initial skeleton wrt clipboard copy.
Had forgotten to move the one shot resp into try catch before.
Fixed it. Ensure both oneshot multipart resp try catch
Add some todos for later.
Add a new check wrt response being normal or a error related one
ie the content is actually a error message.
Allow passing the accept list for file type input element helper.
Inturn given that currently it is used for the image selection
for vision models, set it to jpeg and png in the caller for the
same.
Limit scroll to veritical dir and inturn show only when needed
Move the Tool Call Edit UI's HR into its div.
Add a bottom margin wrt the individual chat messages.
Move all dataUrl handling into helper functions.
So that its manipulation is done in a controlled manner, as well as
in future, changes to the semantic can be easily carried out by
updating the helper functions suitably and inturn updating the caller
as needed.
For now avoid push and pop and work with 0th index directly, given
that currently the logic is setup for handling only a single image
with the ai model. This keeps things simple. It can be changed if
required in future easily.
There can be issue with chat.add->chat.save, in that trying to
store into localStorage or so can raise exception, like quota
exceeded and so.
So now trap chat.add also and inturn for now take care of clearing
image state while also trapping and rethrowing a new error which
identifies the above location, as well as tracks the original err
Add a new helper to create a file type input which includes a btn
with image. Use same wrt the user image selection button.
Update button creation helper to show innerText only if the newly
added innerHTML arg is undefined.
When ever user makes a image selection, the image will be shown
in the input-filetype-image-button. In turn when the same is
submitted to ai engine server, the image will be cleared.