mirror of
https://github.com/gitbutlerapp/gitbutler.git
synced 2024-11-23 20:54:50 +03:00
Improve GitButler chat UI and structure
This commit enhances the GitButler chat user interface by refining the layout, adding clearer chat messages, and improving the overall structure. The changes include a more organized display with chat history and new messages, better styling for chat messages, and the introduction of a chat container for easier navigation through the chat. Changes: - Wrap chat components in a GitBTLR-container for better organization - Add chat-container with better styling and layout for chat history and messages - Modify the appearance of chat messages with new styling, colors, and icons - Use distinguishable message bubbles for user and GitButler messages for improved readability
This commit is contained in:
parent
14bcfaa94d
commit
b790a5457f
@ -115,10 +115,13 @@
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="m-4 flex flex-col gap-4">
|
||||
<div class="flex flex-col gap-2 rounded border border-zinc-700 p-4">
|
||||
<p class="text-xl">Chat GitButler</p>
|
||||
<p>chatId: {chatId}</p>
|
||||
<div class="GitBTLR-container h-full p-4">
|
||||
<div class="flex h-full flex-col rounded border border-zinc-700 shadow bg-card-default">
|
||||
<div class="flex justify-between gap-2 border-b border-zinc-700 p-2 bg-card-active">
|
||||
<div class="flex gap-2 text-[18px]">Chat GitButler</div>
|
||||
|
||||
<div class="flex gap-2 items-center">
|
||||
<span class="text-sm">chatId: <span class="font-mono text-sm">{chatId}</span></span>
|
||||
<Button
|
||||
role="basic"
|
||||
height="small"
|
||||
@ -130,26 +133,72 @@
|
||||
chatInput = '';
|
||||
}}>New chat</Button
|
||||
>
|
||||
<p>Chat history</p>
|
||||
<ul class="flex flex-col gap-2">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="chat-container flex h-full flex-col overflow-auto border-zinc-700">
|
||||
<ul class="flex flex-col gap-2 p-4">
|
||||
{#each chatHistory as pair}
|
||||
{#each pair as message}
|
||||
<li class="rounded border border-zinc-700 bg-zinc-700">{message}</li>
|
||||
{/each}
|
||||
<div class="flex justify-end">
|
||||
<div
|
||||
class="text-blue-100 w-[fit-content] max-w-[80%] cursor-text select-text rounded-[18px] rounded-tr-md bg-blue-700 py-3 px-4"
|
||||
>
|
||||
{pair[0]}
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-start gap-2 align-top">
|
||||
<div class="rounded-full bg-zinc-900 p-4">
|
||||
<svg
|
||||
width="20"
|
||||
height="20"
|
||||
viewBox="0 0 20 20"
|
||||
fill="none"
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
>
|
||||
<path
|
||||
d="M14.5614 12.4668C14.3108 12.3265 14.0786 12.1555 13.8712 11.9587C13.4477 11.5571 13.1091 11.0403 12.8663 10.4225L12.1828 8.68652L11.4994 10.4225C11.2561 11.0403 10.918 11.5571 10.4945 11.9587C10.2861 12.1564 10.0539 12.3274 9.80476 12.4673L8.66333 13.108L9.80476 13.7482C10.0539 13.888 10.2861 14.059 10.494 14.2567C10.918 14.6583 11.2561 15.1757 11.4989 15.7929L12.1823 17.5289L12.8658 15.7929C13.1091 15.1751 13.4472 14.6583 13.8707 14.2567C14.0791 14.059 14.3113 13.8875 14.5609 13.7482L15.7029 13.1075L14.5614 12.4668Z"
|
||||
fill="#F4F4F5"
|
||||
/>
|
||||
<path
|
||||
d="M11.9573 4.05509C11.7746 3.95585 11.6049 3.83459 11.4532 3.69517C11.1469 3.41352 10.9033 3.05324 10.7293 2.62445L10.4759 2L10.2226 2.62445C10.0486 3.05322 9.80498 3.41349 9.49868 3.69517C9.34626 3.83529 9.1769 3.95655 8.99493 4.05544L8.57153 4.28572L8.99493 4.516C9.1769 4.6149 9.34626 4.73615 9.49868 4.87627C9.80497 5.15757 10.0486 5.51784 10.2226 5.94699L10.4759 6.57143L10.7293 5.94699C10.9033 5.51823 11.1469 5.15795 11.4532 4.87627C11.6056 4.73615 11.775 4.61489 11.9573 4.516L12.3811 4.28537L11.9573 4.05509Z"
|
||||
fill="#F4F4F5"
|
||||
/>
|
||||
<path
|
||||
d="M8.56381 8.66611C8.31754 8.52816 8.08878 8.35963 7.88429 8.16583C7.47143 7.77434 7.14309 7.27356 6.90848 6.67755L6.56702 5.80957L6.22556 6.67755C5.99096 7.27353 5.66262 7.7743 5.24974 8.16583C5.04429 8.3606 4.816 8.52915 4.57071 8.6666L4 8.98668L4.57071 9.30677C4.81601 9.44423 5.04429 9.61277 5.24974 9.80754C5.66261 10.1985 5.99094 10.6993 6.22556 11.2958L6.56702 12.1638L6.90848 11.2958C7.14308 10.6999 7.47142 10.1991 7.88429 9.80754C8.08975 9.61277 8.31804 9.44422 8.56381 9.30677L9.13502 8.9862L8.56381 8.66611Z"
|
||||
fill="#F4F4F5"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
<div class=" max-w-[500px] rounded-[18px] rounded-tl-md bg-zinc-300 text-zinc-700 ">
|
||||
<div class="automated-text w-full cursor-text select-text px-4 py-3">{pair[1]}</div>
|
||||
</div>
|
||||
</div>
|
||||
{/each}
|
||||
</ul>
|
||||
<p>New message</p>
|
||||
<input bind:value={chatInput} />
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-2 p-4 border-t border-zinc-700">
|
||||
<div class="flex gap-2 pt-2">
|
||||
<input bind:value={chatInput} placeholder="Send a message..." class="w-full" />
|
||||
<Button
|
||||
disabled={chatInput.length == 0 || !chatId}
|
||||
role="basic"
|
||||
height="small"
|
||||
role="primary"
|
||||
on:click={() => {
|
||||
newChatMessage(chatId, chatInput).then((data) => {
|
||||
chatInput = '';
|
||||
});
|
||||
}}>Send</Button
|
||||
}}
|
||||
>
|
||||
Send
|
||||
</Button>
|
||||
</div>
|
||||
<div class="flex">
|
||||
<p class="text-sm text-zinc-500">
|
||||
Chat GitButler may produce inaccurate information about people, places, or facts.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="flex flex-col gap-2">
|
||||
@ -193,4 +242,3 @@
|
||||
}}>Reset</Button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user