Commit Graph

7608 Commits

Author SHA1 Message Date
hanishkvc ae552a9161 SimpleChatTCRV:UIClean: Avoid wip popover anchor position mech
Instead use the explicit positioning, which was already added to
support firefox, given that firefox still doesnt support anchor
based positioning.

Also move the popover to top of the chat message bubble/block,
instead of the bottom area. This ensures that the popover isnt
butting heads with the tool call trigger or user input blocks.
2025-12-04 19:41:40 +05:30
hanishkvc 9d1c7b59a9 SimpleChatTCRV:AnveshikaSallap, Color cleanup
Use variables in css for colors.

Change the tool response color to be bit more soothing and kind of
syncd with the user collor. However the tool call color is left
bit odder, to ensure user sight goes there for validating and
triggering.
2025-12-04 19:41:40 +05:30
hanishkvc 15dcd4a0a3 SimpleChatTCRV:ImagePopOver: To view and if reqd del before submit
Also had forgotten to rename to image_urls, when switching from
single image with its corresponding field image_url to image_urls,
wrt removing the same after it has been added to the content array.
2025-12-04 19:41:40 +05:30
hanishkvc 720818f8e7 SimpleChatTCRV:UICleanup: new icons short texts, tighter buttons
Update usage note wrt new icons.
2025-12-04 19:41:40 +05:30
hanishkvc ae3d4fa96d SimpleChatTCRV:UICleanup: Icon samples 2025-12-04 19:41:40 +05:30
hanishkvc 122c96e8a9 SimpleChatTCRV:MultipleImages:Update ChatMessage++ wrt same
Now NSChatMessage inturn ChatMessageEx, ... have been updated
to maintain a array of image data instead of a single image.

Inturn the ShowMessage as well as submit logics have been updated
to account for multiple images.

Also fix a oversight from previous commit, where when pushing new
image, I had forgotten to remove the old logic, which would have
always updated the 0th image data in the array.
2025-12-04 19:41:40 +05:30
hanishkvc 08ea5c364c SimpleChatTCRV:MultipleImages: Icon only buttons
Instead of having texts submit and image, replace them with equiv
unicode icons.

Adjust the size of these buttons to be smaller, given that now they
only contain icons in them.

Switch from btn+inputfile+img to btn+inputfile wrt image loading btn
given that the image will be shown in seperate dynamically created
images in the user in div.
2025-12-04 19:41:40 +05:30
hanishkvc 1b9190d722 SimpleChatTCRV:MultipleImages:UI: Load track multiple images 2025-12-04 19:41:40 +05:30
hanishkvc ae68ee1850 SimpleChatTCRV:UIClean:Free up vertical space
move sessions buttons div to heading block

and move program name to the default block added to chat div, if
there is no chat in a given chat session.

cleanup the default block helpers to follow a common pattern.

also make the chat message bubbles/blocks bit more prominently box
shadowy
2025-12-04 19:41:40 +05:30
hanishkvc 96f94b8439 SimpleChatTCRV:UICleanup: PopOver, Reasoning bubble
Now popover menu autocloses faster, so that it doesnt distract the
user too long, if not needed.

Reasoning bubble dashed border has been made thinner, so that it
appears pleasant and not over bearing.
2025-12-04 19:41:40 +05:30
hanishkvc d242e7021a SimpleChatTCRV:UICleanup: Full chat messages ui refresh when needed
Starting out with a new chat.

Switching back from settings directly.
2025-12-04 19:41:40 +05:30
hanishkvc 9e720e7688 SimpleChatTCRV:UICleanup:Popover Firefox work around
As firefox doesnt seem to currently support anchor based relative
positioning of the popover, so explicitly set the position of the
popover.

Also reposition the popover to be in the bottom right corner rather
than the previous top center position.
* Rather updated position-area css property ensures this automatically
  wrt chrome browsers.
* while for firefox the explicit code that is added is needed.

NOTE: Had added that id, just in case firefox was goofing up bcas of
the element not having unique id or so, either way the firefox issue
is unrelated and more fundamental lack of support for now.
2025-12-04 19:41:40 +05:30
hanishkvc 72a780e181 SimpleChatTCRV:UICleanup: ToolCall trigger and UserInput block
Add better visual cues wrt the tool call trigger block and the
user input block, and inturn remove the now unneeded horizontal
seperation line between chat messages block and the tool call
trigger block.

Bring in the user role color gradient to the full user input block

Change the TEMP roles to use -TEMP instead of .TEMP suffix, so
that role based css rules get applied without any complexity
that may inturn not get applied.

Avoid extra newlines in the err message returned by the tool call
workers. Given that now there is a proper tool call response
sent back to the ai backend/server, without using user and ai
text content block itself to maintain the tool call and its
response info (which is what this client was doing initially
and so more spacing was added to important parts to bring it
into better focus, just in case).
2025-12-04 19:41:40 +05:30
hanishkvc 087fd93495 SimpleChatTCRV:SysDateTime: Follow unix date format markers
Also support w ie day of week.
2025-12-04 19:41:40 +05:30
hanishkvc 519cc46f0e SimpleChatTCRV:Sessions++ button take two: normal html + js + css
Now use javascript to trap the button click and inturn change css
class to hide or show the corresponding div.

This moving away from details with summary being the top level
title + buttons block, avoids the warning wrt non standard use of
details element, as well as gives a clear icon to end users wrt
toggling the sessions+systemprompt block.
2025-12-04 19:41:40 +05:30
hanishkvc a3da445f29 SimpleChatTCRV:UICleanup: Sessions button take one popover 2025-12-04 19:41:40 +05:30
hanishkvc e2bd57d5a5 SimpleChatTCRV:UICleanup+: Fix oversight wrt Auto ObjPropsEdit
Had forgotten to use ${} for variable within a literal template
string.

Had forgotten to use the full hierarchy of props when setting the
id of elements, which is useful to map a label to a button and so.
This would have led to the wrong button being clicked when a label
with duplicated id was clicked. Ie if two different objects within
a object, have properties/fields with the same name, then previously
this would have led to a bunch of labels and buttons or so having
the same id, bcas their hierarchy was not being accounted for. This
is fixed now.
2025-12-04 19:41:40 +05:30
hanishkvc c039447494 SimpleChatTCRV:UiCleanup: Switch to icon only buttons and title 2025-12-04 19:41:40 +05:30
hanishkvc bf393380a9 SimpleChatTCRV:UICleanup: limit border-radius, SlidingWindow info
Allow AutoCreated Object Properties Editing UI to be themed to an
extent by assigning a id to the top level element, which is based
on the legend specified.

Use the same to add inline padding as well as adjust border radius
wrt the elements within, for the Settings ui. And min height and
border width wrt input, select and buttons within.

Similarly for the default Usage,Restore and SettingsInfo summary
titles, avoid border-radius.

Show the string representation of the sliding window selected.

Add some padding to system prompt input.
2025-12-04 19:41:40 +05:30
hanishkvc 7b4afc8652 SimpleChatTCRV:UICleanup: Scrollbar, role gradiants, textarea, ...
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.
2025-12-04 19:41:40 +05:30
hanishkvc ab9e9c9ee8 SimpleChatTCRV:UICleanup: PopOverTO, buttonBorder, Restore, Usage
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.
2025-12-04 19:41:40 +05:30
hanishkvc 92bd3557d5 SimpleChatTCRV:UI theme cleanup - html+css r3
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.
2025-12-04 19:41:40 +05:30
hanishkvc 9f782d70b8 SimpleChatTCRV:UI theme simple cleanup - css round 2
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.
2025-12-04 19:41:40 +05:30
hanishkvc 9baece7c93 SimpleChatTCRV:UI theme simple cleanup
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.
2025-12-04 19:41:40 +05:30
hanishkvc 08d84ecd85 SimpleChatTCRV:UI Cleanup
rename to ui_userinput_reset,

Initial review to ensure all paths make use of it suitably, wrt
handle user submit and tool call.
2025-12-04 19:41:40 +05:30
hanishkvc a49774817b SimpleChatTCRV:UICleanup: User Input area one bunch of clenaup
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).
2025-12-04 19:41:40 +05:30
hanishkvc 735a8b382c SimpleChatTCRV:Cleanup: Starting flow, cleanup description, readme
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.
2025-12-04 19:41:40 +05:30
hanishkvc c4cbeba463 SimpleChatTCRV:Cleanup:MouseEvents demote, UIRefreshy almost all
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.
2025-12-04 19:41:40 +05:30
hanishkvc c84ec53511 SimpleChatTCRV:UICleanup: loading message wrt restoring session
also update some notes
2025-12-04 19:41:40 +05:30
hanishkvc 511fcb0016 SimpleChatTCRV:UICleanup: Use chat_uirefresh not chat_show
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.
2025-12-04 19:41:40 +05:30
hanishkvc dda9f81d37 SimpleChatTCRV:UICleanupPlus: Fix oversights with initial go 2025-12-04 19:41:40 +05:30
hanishkvc 9ddd923412 SimpleChatTCRV:UI Flow cleanup plus
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.
2025-12-04 19:41:40 +05:30
hanishkvc 161714f56e SimpleChatTCRV:CMUI:Scroll into view in optimized ui flows 2025-12-04 19:41:40 +05:30
hanishkvc d18745d02f SimpleChatTCRV:CMUI: remove live element, uidelete all matching 2025-12-04 19:41:40 +05:30
hanishkvc d29201be3d SimpleChatTCRV:Cleanup:Distinguish btw uiremove & del_uiupdate
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.
2025-12-04 19:41:40 +05:30
hanishkvc a2698d0521 SimpleChatTCRV:CMOptimisedShow: User respones
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.
2025-12-04 19:41:40 +05:30
hanishkvc 3e20b5c680 SimpleChatTCRV:MCUI:CMAddShow:tool response happy path
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).
2025-12-04 19:41:39 +05:30
hanishkvc 1b4e1aa682 SimpleChatTCRV:MCUI:ChatMsgAddShow, Use4 toolresp nonhappy paths
Make the toolresp non happy path use a direct insert chat msg
wrt ui, rather than recreating the full chat session ui fresh.
2025-12-04 19:41:39 +05:30
hanishkvc 926b5cd8f3 SimpleChatTCRV:Cleanup:Delete and Chat UI suitable update
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.
2025-12-04 19:41:39 +05:30
hanishkvc f3424d3a2a SimpleChatTCRV:Cleanup: Efficient ChatMessage Ui Delete
avoid refreshing the full chat session messages ui

also Update readme
2025-12-04 19:41:39 +05:30
hanishkvc 95f79eb8b0 SimpleChatTCRV:CleanUp: Refresh chat ui, if user empty submits
This ensures that the tool call edit/trigger is reshown, when user
submits a empty response and the logic stops from going ahead.
2025-12-04 19:41:39 +05:30
hanishkvc efcd81aa2f SimpleChatTCRV:SimpleProxy:DumpHeaders 2025-12-04 19:41:39 +05:30
hanishkvc 67b9c68b3e SimpleChatTCRV: Update readme a bit, need to cleanup later 2025-12-04 19:41:39 +05:30
hanishkvc e731d29dc9 SimpleChatTCRV:Cleanup:Delete keeps view around adjacent messages
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.
2025-12-04 19:41:39 +05:30
hanishkvc c0dbc1d59c SimpleChatTCRV:ChatMessage:Copy using PopOver menu & navigator
Currently only the text/content part is handled wrt copy. Image
URL isnt handled, even if present.
2025-12-04 19:41:39 +05:30
hanishkvc 6a67d002d6 SimpleChatTCRV:CMPopOver:Relative positioning - P2
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.
2025-12-04 19:41:39 +05:30
hanishkvc 70a163fd18 SimpleChatTCRV:CMPopOver:Relative positioning - P1
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).
2025-12-04 19:41:39 +05:30
hanishkvc 62fb992e0e SimpleChatTCRV:CMPopOver: show within chatmessage, del logic
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.
2025-12-04 19:41:39 +05:30
hanishkvc 1d2ef9dddb SimpleChatTCRV:ChatMessage: UniqId, Delete logic, edit popover ui 2025-12-04 19:41:39 +05:30
hanishkvc dc71a9be4c SimpleChatTCRV:Remember to reset the Input File type value 2025-12-04 19:41:39 +05:30