implemenation on the bot

This commit is contained in:
2026-08-19 17:08:45 +05:30
parent bdb21766f2
commit 37ca2352e2
52 changed files with 7074 additions and 3568 deletions

View File

@@ -44,7 +44,6 @@
--dai-duration: 240ms;
--dai-ease: cubic-bezier(0.16, 1, 0.3, 1);
}
/* --------------------------------------------------------------------------
Scrim — deliberately light. The dashboard underneath must stay readable;
this is a layering cue, not a modal blackout.
@@ -57,11 +56,9 @@
opacity: 0;
transition: opacity var(--dai-duration) var(--dai-ease);
}
.dai-scrim[data-open='true'] {
opacity: 1;
}
/* --------------------------------------------------------------------------
Panel
-------------------------------------------------------------------------- */
@@ -87,16 +84,13 @@
transform var(--dai-duration) var(--dai-ease),
opacity var(--dai-duration) var(--dai-ease);
}
.dai-panel[data-open='true'] {
transform: translateX(0);
opacity: 1;
}
.dai-panel:focus {
outline: none;
}
/* --------------------------------------------------------------------------
Header
-------------------------------------------------------------------------- */
@@ -105,7 +99,6 @@
padding: 14px 12px 12px 14px;
border-bottom: 1px solid var(--dai-border);
}
.dai-root .dai-title {
font-size: 15px;
font-weight: 650;
@@ -113,13 +106,11 @@
letter-spacing: -0.01em;
color: var(--dai-text);
}
.dai-root .dai-subtitle {
font-size: 12px;
line-height: 1.3;
color: var(--dai-text-muted);
}
/* The AI mark. A soft gradient orb — not a robot face. */
.dai-root .dai-spark {
display: inline-flex;
@@ -127,27 +118,34 @@
justify-content: center;
flex: 0 0 auto;
border-radius: 999px;
color: #ffffff;
background: linear-gradient(135deg, var(--dai-ai-from), var(--dai-ai-to));
box-shadow: 0 0 0 3px var(--dai-ai-glow);
background: var(--dai-surface);
overflow: hidden;
}
/* The mark's own canvas is only 66.8% content — a third of every edge is
transparent padding, measured off the PNG's alpha bounding box (x and y both
170..853 of 1024, i.e. perfectly centred). Drawing it at 100% therefore
rendered a D two-thirds the size the box implied, which is exactly why it
read as too small. 150% cancels that padding so the D fills its box edge to
edge; the overflow:hidden above clips only transparent pixels. */
.dai-root .dai-spark img {
width: 150%;
height: 150%;
max-width: none;
object-fit: contain;
display: block;
}
.dai-root .dai-spark[data-size='sm'] {
width: 22px;
height: 22px;
}
.dai-root .dai-spark[data-size='md'] {
width: 30px;
height: 30px;
}
.dai-root .dai-spark[data-size='lg'] {
width: 44px;
height: 44px;
box-shadow: 0 0 0 6px var(--dai-ai-glow);
.dai-root .dai-spark[data-size='md'] {
width: 40px;
height: 40px;
}
.dai-root .dai-spark[data-size='lg'] {
width: 56px;
height: 56px;
}
/* Live indicator — subtle, not a large pill. */
.dai-root .dai-live {
display: inline-flex;
@@ -161,7 +159,6 @@
background: rgba(16, 185, 129, 0.08);
white-space: nowrap;
}
.dai-root .dai-live-dot {
width: 6px;
height: 6px;
@@ -169,7 +166,6 @@
background: var(--dai-live);
animation: dai-pulse 2.4s ease-in-out infinite;
}
@keyframes dai-pulse {
0%,
100% {
@@ -181,7 +177,6 @@
transform: scale(0.85);
}
}
/* Page-context strip — "Orders · Today · All locations" */
.dai-root .dai-context {
flex: 0 0 auto;
@@ -194,7 +189,120 @@
overflow: hidden;
text-overflow: ellipsis;
}
/* --------------------------------------------------------------------------
Welcome state
-------------------------------------------------------------------------- */
.dai-root .dai-welcome {
padding: 22px 14px 8px;
}
.dai-root .dai-welcome-greeting {
font-size: 17px;
font-weight: 650;
letter-spacing: -0.01em;
color: var(--dai-text);
}
.dai-root .dai-welcome-lead {
font-size: 13.5px;
line-height: 1.5;
color: var(--dai-text-secondary);
}
.dai-root .dai-welcome-note {
font-size: 12px;
line-height: 1.5;
color: var(--dai-text-muted);
}
.dai-root .dai-section-label {
font-size: 11px;
font-weight: 600;
letter-spacing: 0.04em;
text-transform: uppercase;
color: var(--dai-text-muted);
}
/* --------------------------------------------------------------------------
Suggestion cards
-------------------------------------------------------------------------- */
.dai-suggestion {
display: flex;
align-items: center;
gap: 10px;
width: 100%;
padding: 10px 11px;
text-align: left;
font: inherit;
color: var(--dai-text);
background: var(--dai-surface);
border: 1px solid var(--dai-border);
border-radius: 5px;
cursor: pointer;
transition:
background-color 140ms ease,
border-color 140ms ease,
transform 140ms ease;
}
.dai-suggestion:hover {
background: var(--dai-surface-alt);
border-color: var(--dai-border-strong);
}
.dai-suggestion:active {
transform: scale(0.99);
}
.dai-suggestion:focus-visible {
outline: 2px solid var(--dai-accent);
outline-offset: 2px;
}
.dai-root .dai-suggestion-icon {
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
width: 26px;
height: 26px;
border-radius: 5px;
background: var(--dai-surface-hover);
color: var(--dai-text-secondary);
}
.dai-root .dai-suggestion-text {
flex: 1 1 auto;
font-size: 13px;
line-height: 1.35;
}
.dai-root .dai-suggestion-arrow {
flex: 0 0 auto;
color: var(--dai-text-muted);
opacity: 0;
transform: translateX(-3px);
transition:
opacity 140ms ease,
transform 140ms ease;
}
.dai-suggestion:hover .dai-suggestion-arrow,
.dai-suggestion:focus-visible .dai-suggestion-arrow {
opacity: 1;
transform: translateX(0);
}
/* Plain text link-button ("View more", "Sources") */
.dai-link {
font: inherit;
font-size: 12px;
color: var(--dai-text-secondary);
background: none;
border: none;
padding: 2px 0;
cursor: pointer;
align-self: flex-start;
}
.dai-link:hover {
color: var(--dai-text);
text-decoration: underline;
}
.dai-link:focus-visible {
outline: 2px solid var(--dai-accent);
outline-offset: 2px;
border-radius: 5px;
}
/* --------------------------------------------------------------------------
Conversation
-------------------------------------------------------------------------- */
/* --------------------------------------------------------------------------
Scroll region
-------------------------------------------------------------------------- */
@@ -225,141 +333,24 @@
background: transparent;
}
/* --------------------------------------------------------------------------
Welcome state
-------------------------------------------------------------------------- */
.dai-root .dai-welcome {
padding: 22px 14px 8px;
}
.dai-root .dai-welcome-greeting {
font-size: 17px;
font-weight: 650;
letter-spacing: -0.01em;
color: var(--dai-text);
}
.dai-root .dai-welcome-lead {
font-size: 13.5px;
line-height: 1.5;
color: var(--dai-text-secondary);
}
.dai-root .dai-welcome-note {
font-size: 12px;
line-height: 1.5;
color: var(--dai-text-muted);
}
.dai-root .dai-section-label {
font-size: 11px;
font-weight: 600;
letter-spacing: 0.04em;
text-transform: uppercase;
color: var(--dai-text-muted);
}
/* --------------------------------------------------------------------------
Suggestion cards
-------------------------------------------------------------------------- */
.dai-suggestion {
display: flex;
align-items: center;
gap: 10px;
width: 100%;
padding: 10px 11px;
text-align: left;
font: inherit;
color: var(--dai-text);
background: var(--dai-surface);
border: 1px solid var(--dai-border);
border-radius: 5px;
cursor: pointer;
transition:
background-color 140ms ease,
border-color 140ms ease,
transform 140ms ease;
}
.dai-suggestion:hover {
background: var(--dai-surface-alt);
border-color: var(--dai-border-strong);
}
.dai-suggestion:active {
transform: scale(0.99);
}
.dai-suggestion:focus-visible {
outline: 2px solid var(--dai-accent);
outline-offset: 2px;
}
.dai-root .dai-suggestion-icon {
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
width: 26px;
height: 26px;
border-radius: 5px;
background: var(--dai-surface-hover);
color: var(--dai-text-secondary);
}
.dai-root .dai-suggestion-text {
.dai-scroll-wrap {
position: relative;
flex: 1 1 auto;
font-size: 13px;
line-height: 1.35;
min-height: 0;
display: flex;
flex-direction: column;
}
.dai-root .dai-suggestion-arrow {
flex: 0 0 auto;
color: var(--dai-text-muted);
opacity: 0;
transform: translateX(-3px);
transition:
opacity 140ms ease,
transform 140ms ease;
}
.dai-suggestion:hover .dai-suggestion-arrow,
.dai-suggestion:focus-visible .dai-suggestion-arrow {
opacity: 1;
transform: translateX(0);
}
/* Plain text link-button ("View more", "Sources") */
.dai-link {
font: inherit;
font-size: 12px;
color: var(--dai-text-secondary);
background: none;
border: none;
padding: 2px 0;
cursor: pointer;
align-self: flex-start;
}
.dai-link:hover {
color: var(--dai-text);
text-decoration: underline;
}
.dai-link:focus-visible {
outline: 2px solid var(--dai-accent);
outline-offset: 2px;
border-radius: 5px;
}
/* --------------------------------------------------------------------------
Conversation
-------------------------------------------------------------------------- */
.dai-root .dai-thread {
padding: 16px 14px 8px;
}
.dai-root .dai-msg {
/* Only the newest turn animates in. Applying this to every .dai-msg meant
opening a panel with a restored thread started 50 simultaneous opacity +
transform animations, which is a visible hitch before the first scroll. The
base state IS the animation's end state, so a turn that stops being last
simply keeps its finished appearance. */
.dai-root .dai-thread > .dai-msg:last-child {
animation: dai-enter 220ms var(--dai-ease) both;
}
@@ -374,7 +365,6 @@
}
}
/* User — compact, right aligned, brand surface. */
.dai-root .dai-msg-user {
max-width: 82%;
margin-left: auto;
@@ -388,7 +378,6 @@
white-space: pre-wrap;
overflow-wrap: anywhere;
}
/* Assistant — no bubble. Text sits on the panel surface. */
.dai-root .dai-msg-ai {
font-size: 13.5px;
@@ -396,36 +385,30 @@
color: var(--dai-text);
overflow-wrap: anywhere;
}
.dai-root .dai-msg-ai-detail {
font-size: 12.5px;
line-height: 1.55;
color: var(--dai-text-secondary);
white-space: pre-line;
}
.dai-root .dai-msg-name {
font-size: 11.5px;
font-weight: 600;
color: var(--dai-text-secondary);
}
.dai-root .dai-msg-footer {
font-size: 11px;
color: var(--dai-text-muted);
}
/* Copy button — only revealed on hover of the message row. */
.dai-root .dai-msg-actions {
opacity: 0;
transition: opacity 140ms ease;
}
.dai-root .dai-msg-row:hover .dai-msg-actions,
.dai-root .dai-msg-row:focus-within .dai-msg-actions {
opacity: 1;
}
/* --------------------------------------------------------------------------
Structured metrics
-------------------------------------------------------------------------- */
@@ -435,14 +418,12 @@
gap: 6px;
width: 100%;
}
.dai-root .dai-stat {
padding: 9px 10px;
border: 1px solid var(--dai-border);
border-radius: 5px;
background: var(--dai-surface-alt);
}
.dai-root .dai-stat-value {
font-size: 19px;
font-weight: 650;
@@ -450,12 +431,10 @@
letter-spacing: -0.02em;
font-variant-numeric: tabular-nums;
}
.dai-root .dai-stat-label {
font-size: 11px;
color: var(--dai-text-muted);
}
/* Headline metric — the "primary number is large" rule. */
.dai-root .dai-metric-value {
font-size: 28px;
@@ -465,12 +444,10 @@
color: var(--dai-text);
font-variant-numeric: tabular-nums;
}
.dai-root .dai-metric-label {
font-size: 12px;
color: var(--dai-text-secondary);
}
/* --------------------------------------------------------------------------
Typing / loading
-------------------------------------------------------------------------- */
@@ -480,7 +457,6 @@
gap: 4px;
height: 18px;
}
.dai-root .dai-typing span {
width: 5px;
height: 5px;
@@ -488,15 +464,12 @@
background: var(--dai-text-muted);
animation: dai-bounce 1.3s ease-in-out infinite;
}
.dai-root .dai-typing span:nth-child(2) {
animation-delay: 0.16s;
}
.dai-root .dai-typing span:nth-child(3) {
animation-delay: 0.32s;
}
@keyframes dai-bounce {
0%,
70%,
@@ -509,7 +482,6 @@
transform: translateY(-3px);
}
}
.dai-root .dai-shimmer {
height: 9px;
border-radius: 999px;
@@ -517,7 +489,6 @@
background-size: 400% 100%;
animation: dai-shimmer 1.5s ease infinite;
}
@keyframes dai-shimmer {
from {
background-position: 100% 50%;
@@ -526,7 +497,6 @@
background-position: 0 50%;
}
}
/* --------------------------------------------------------------------------
States (error / empty)
-------------------------------------------------------------------------- */
@@ -536,19 +506,16 @@
border-radius: 5px;
background: var(--dai-surface-alt);
}
.dai-root .dai-state-title {
font-size: 13px;
font-weight: 600;
color: var(--dai-text);
}
.dai-root .dai-state-body {
font-size: 12.5px;
line-height: 1.5;
color: var(--dai-text-secondary);
}
.dai-root .dai-state-icon {
display: inline-flex;
align-items: center;
@@ -558,7 +525,6 @@
border-radius: 5px;
flex: 0 0 auto;
}
/* --------------------------------------------------------------------------
Jump-to-latest
-------------------------------------------------------------------------- */
@@ -581,24 +547,13 @@
cursor: pointer;
z-index: 2;
}
.dai-jump:hover {
background: var(--dai-surface-alt);
}
.dai-jump:focus-visible {
outline: 2px solid var(--dai-accent);
outline-offset: 2px;
}
.dai-scroll-wrap {
position: relative;
flex: 1 1 auto;
min-height: 0;
display: flex;
flex-direction: column;
}
/* --------------------------------------------------------------------------
Composer
-------------------------------------------------------------------------- */
@@ -608,7 +563,6 @@
border-top: 1px solid var(--dai-border);
background: var(--dai-surface);
}
.dai-root .dai-composer {
border: 1px solid var(--dai-border-strong);
border-radius: 5px;
@@ -619,12 +573,10 @@
border-color 140ms ease,
box-shadow 140ms ease;
}
.dai-root .dai-composer[data-focused='true'] {
border-color: var(--dai-accent);
box-shadow: 0 0 0 3px rgba(15, 23, 42, 0.06);
}
.dai-root .dai-composer textarea {
display: block;
width: 100%;
@@ -641,51 +593,13 @@
max-height: 108px; /* ~5 lines */
overflow-y: auto;
}
.dai-root .dai-composer textarea::placeholder {
color: var(--dai-text-muted);
}
.dai-send {
display: inline-flex;
align-items: center;
justify-content: center;
flex: 0 0 auto;
width: 30px;
height: 30px;
border: none;
border-radius: 999px;
color: var(--dai-accent-contrast);
background: var(--dai-accent);
cursor: pointer;
transition:
opacity 140ms ease,
transform 140ms ease;
}
.dai-send:hover:not(:disabled) {
opacity: 0.88;
}
.dai-send:active:not(:disabled) {
transform: scale(0.93);
}
.dai-send:disabled {
opacity: 0.28;
cursor: default;
}
.dai-send:focus-visible {
outline: 2px solid var(--dai-accent);
outline-offset: 2px;
}
.dai-root .dai-hint {
font-size: 11px;
color: var(--dai-text-muted);
}
/* --------------------------------------------------------------------------
Trigger (lives in the app TopNav)
-------------------------------------------------------------------------- */
@@ -693,40 +607,44 @@
display: inline-flex;
align-items: center;
justify-content: center;
width: 32px;
height: 32px;
width: 40px;
height: 40px;
padding: 0;
border-radius: 5px;
border: 1px solid transparent;
background: transparent;
color: #4f46e5;
cursor: pointer;
overflow: hidden;
transition:
background-color 140ms ease,
border-color 140ms ease,
transform 140ms ease;
}
.dai-trigger:hover {
background: rgba(99, 102, 241, 0.09);
border-color: rgba(99, 102, 241, 0.16);
/* 30px box × 1.5 cancels the mark's transparent padding, so the visible D is
30px inside the 40px button. */
.dai-trigger-mark {
width: 30px;
height: 30px;
max-width: none;
object-fit: contain;
display: block;
transform: scale(1.5);
}
.dai-trigger:hover {
background: rgba(0, 0, 0, 0.05);
border-color: rgba(0, 0, 0, 0.1);
}
.dai-trigger:active {
transform: scale(0.94);
}
.dai-trigger:focus-visible {
outline: 2px solid var(--dai-accent);
outline-offset: 2px;
}
.dai-trigger[data-active='true'] {
color: #ffffff;
background: linear-gradient(135deg, var(--dai-ai-from), var(--dai-ai-to));
border-color: transparent;
background: rgba(0, 0, 0, 0.07);
border-color: rgba(0, 0, 0, 0.14);
}
/* --------------------------------------------------------------------------
Responsive
-------------------------------------------------------------------------- */
@@ -735,24 +653,17 @@
--dai-panel-width: 396px;
}
}
@media (max-width: 767px) {
.dai-root {
--dai-inset: 0px;
}
.dai-panel {
width: 100vw;
max-width: 100vw;
border-radius: 0;
border: none;
}
.dai-msg-user {
max-width: 88%;
}
}
/* --------------------------------------------------------------------------
Reduced motion — no slide, no pulse, no shimmer. Opacity only.
-------------------------------------------------------------------------- */
@@ -761,11 +672,9 @@
.dai-scrim {
transition: opacity 1ms linear;
}
.dai-panel {
transform: none;
}
.dai-msg,
.dai-live-dot,
.dai-typing span,
@@ -777,7 +686,6 @@
transition: none !important;
}
}
/* --------------------------------------------------------------------------
Write-action confirm card
-------------------------------------------------------------------------- */
@@ -787,7 +695,6 @@
border-radius: 5px;
background: var(--dai-surface-alt);
}
.dai-root .dai-action-icon {
display: inline-flex;
align-items: center;
@@ -799,28 +706,22 @@
color: #4f46e5;
background: rgba(99, 102, 241, 0.1);
}
.dai-root .dai-action-summary {
font-size: 13px;
line-height: 1.35;
font-weight: 550;
color: var(--dai-text);
}
.dai-root .dai-action-note {
font-size: 12px;
color: var(--dai-text-secondary);
}
.dai-root .dai-ok {
color: #047857;
}
.dai-root .dai-err {
color: #b91c1c;
}
/* --------------------------------------------------------------------------
Overflow containment
--------------------------------------------------------------------------
@@ -838,7 +739,6 @@
min-width: 0;
max-width: 100%;
}
/* Two fields per row that genuinely share the width. `flex-wrap` is the
belt-and-braces part: if a field ever can't compress far enough (a long
label, a narrower panel), the row drops to two lines instead of pushing the
@@ -850,12 +750,10 @@
width: 100%;
min-width: 0;
}
.dai-root .dai-form-row > * {
flex: 1 1 140px;
min-width: 0;
}
/* Astryx's TextInput sizes itself to content unless told otherwise. */
.dai-root .dai-form input,
.dai-root .dai-form-row input {
@@ -863,34 +761,62 @@
min-width: 0;
box-sizing: border-box;
}
.dai-root .dai-field-err {
font-size: 11.5px;
line-height: 1.4;
color: #b91c1c;
}
/* --------------------------------------------------------------------------
Source footer + full lists
-------------------------------------------------------------------------- */
/* The footer is a baseline-aligned row, not a centred one: the timestamp and
the Sources toggle are both small text and must sit on the same line. */
/* Timestamp left, Sources toggle hard right, both on ONE line. It was a
wrapping baseline row, and the toggle — a shrinkable flex item with inline
content — gave up its chevron to a second line whenever the panel got
narrow, which read as a stray arrow floating under the text. */
.dai-root .dai-msg-foot {
display: flex;
align-items: baseline;
flex-wrap: wrap;
gap: 8px;
align-items: center;
flex-wrap: nowrap;
gap: 10px;
width: 100%;
min-width: 0;
}
/* The timestamp is the only part allowed to give up space, and it ellipsises
rather than wrapping. */
.dai-root .dai-msg-foot .dai-msg-footer {
flex: 0 1 auto;
flex: 1 1 auto;
min-width: 0;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
/* The toggle is one atom: label and chevron cannot be separated. */
.dai-root .dai-msg-foot .dai-sources {
flex: 0 0 auto;
display: inline-flex;
align-items: center;
gap: 4px;
align-self: center;
white-space: nowrap;
padding: 3px 7px;
margin-right: -7px;
border-radius: 5px;
color: var(--dai-text-muted);
transition: background 140ms ease, color 140ms ease;
}
.dai-root .dai-msg-foot .dai-sources:hover {
background: var(--dai-surface-hover);
color: var(--dai-text);
text-decoration: none;
}
.dai-root .dai-msg-foot .dai-sources svg {
flex: 0 0 auto;
transition: transform 160ms var(--dai-ease);
}
.dai-root .dai-msg-foot .dai-sources[aria-expanded='true'] svg {
transform: rotate(180deg);
}
/* A full, readable list instead of "…and 4 more". Scrolls past ~12 rows so a
long list can never push the panel's height around. */
.dai-root .dai-list {
@@ -901,7 +827,6 @@
background: var(--dai-surface-alt);
overflow: hidden;
}
.dai-root .dai-list-head {
display: flex;
align-items: baseline;
@@ -915,14 +840,12 @@
text-transform: uppercase;
color: var(--dai-text-muted);
}
.dai-root .dai-list-body {
max-height: 260px;
overflow-y: auto;
overflow-x: hidden;
overscroll-behavior: contain;
}
.dai-root .dai-list-item {
display: flex;
flex-wrap: wrap;
@@ -934,11 +857,9 @@
color: var(--dai-text);
border-top: 1px solid var(--dai-divider, rgba(15, 23, 42, 0.05));
}
.dai-root .dai-list-item:first-child {
border-top: none;
}
.dai-root .dai-list-index {
flex: 0 0 auto;
min-width: 18px;
@@ -946,7 +867,6 @@
font-variant-numeric: tabular-nums;
color: var(--dai-text-muted);
}
/* The label must not be crushed to zero width by a long value — that is what
made "address" render one letter per line. It sizes to its content and the
value takes the remaining space, wrapping onto its own full-width line when
@@ -956,7 +876,6 @@
min-width: 0;
overflow-wrap: anywhere;
}
.dai-root .dai-list-meta {
flex: 1 1 auto;
min-width: 0;
@@ -965,10 +884,36 @@
color: var(--dai-text-secondary);
overflow-wrap: anywhere;
}
/* A value that wrapped to its own line reads better left-aligned under its
label than pinned to the right edge. */
.dai-root .dai-list-item > .dai-list-meta:only-child,
.dai-root .dai-list-meta[data-wrapped='true'] {
text-align: left;
}
/* --------------------------------------------------------------------------
Documentation answers
--------------------------------------------------------------------------
Retrieved passages are shown VERBATIM with their source file. They are prose
rather than a figure, so they get a quieter, wider treatment than a metric —
and the source line matters as much as the text, because the operator needs
to know this came from a document, not from live data.
-------------------------------------------------------------------------- */
.dai-root .dai-doc {
padding: 10px 11px;
border: 1px solid var(--dai-border);
border-left: 2px solid var(--dai-ai-from);
border-radius: 5px;
background: var(--dai-surface-alt);
font-size: 12.5px;
line-height: 1.55;
color: var(--dai-text);
white-space: pre-line;
overflow-wrap: anywhere;
max-height: 320px;
overflow-y: auto;
}
.dai-root .dai-doc-source {
font-size: 11px;
color: var(--dai-text-muted);
font-variant-numeric: tabular-nums;
}