refactor(webui): colocate composer palette and automation calendar styles
This commit is contained in:
1 parent
09384cab26
commit
6057ce59e5
6 files changed
+82
-74
No files matched your search
+1
-1
@@ -46,7 +46,7 @@ Bundled channel marks in `public/brand/channels/` use the SVG paths and brand co
|
||||
| `src/components/icons/` | Product-specific icon vocabulary | `product-icons.tsx` |
|
||||
| `nanobot/channels/<channel>/webui/` | Channel-owned screens, components, and translations | Feishu assistants, Linear setup, Weixin connection |
|
||||
|
||||
Supporting hooks and display-model helpers stay near the feature that owns them. Common theme tokens and reusable CSS treatments live in `src/globals.css`, `tailwind.config.js`, and the relevant `ui/` modules. The component inventory lists `.tsx` modules; pure `.ts` helpers remain discoverable through their callers and source imports.
|
||||
Supporting hooks and display-model helpers stay near the feature that owns them. Keep a component’s styles, including its responsive and accessibility variants, next to the component and import them there. Reserve `src/globals.css`, `tailwind.config.js`, and the shared `ui/` modules for theme tokens, document defaults, and treatments used across features. The component inventory lists `.tsx` modules; pure `.ts` helpers remain discoverable through their callers and source imports.
|
||||
|
||||
`NanobotClient` adapts WebSocket frames into observations for its `ClientRunLedger`. The ledger owns each chat's message delivery, run identities, clocks, and completion records, and returns effects for the client to apply to its queues and subscribers. A dropped connection makes unconfirmed delivery unknown while durable runs remain unresolved. Wire completion still permits late final messages; canonical completion records suppress matching top-level turn events. `useNanobotStream` owns message projection and render batching, while `ThreadShell` adopts canonical history and confirms completion after the messages commit.
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ import { formControlFocusClassName } from "@/components/ui/form-control";
|
||||
import { Popover, PopoverContent, PopoverTrigger } from "@/components/ui/popover";
|
||||
import type { SessionAutomationJob } from "@/lib/types";
|
||||
import { cn } from "@/lib/utils";
|
||||
import "./automation-calendar.css";
|
||||
|
||||
type CalendarEntry = {
|
||||
id: string;
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
.automation-calendar-grid { display: none; }
|
||||
.automation-calendar-agenda { display: block; }
|
||||
@container automations (min-width: 44rem) {
|
||||
.automation-calendar-grid { display: block; }
|
||||
.automation-calendar-agenda { display: none; }
|
||||
.automation-calendar-weekdays {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(7, minmax(0, 1fr));
|
||||
}
|
||||
.automation-calendar-weekdays > div {
|
||||
padding: 8px 10px;
|
||||
color: hsl(var(--muted-foreground));
|
||||
font-size: 10px;
|
||||
line-height: 16px;
|
||||
text-align: end;
|
||||
}
|
||||
.automation-calendar-month {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(7, minmax(0, 1fr));
|
||||
}
|
||||
.automation-calendar-day {
|
||||
min-block-size: 112px;
|
||||
min-inline-size: 0;
|
||||
border-inline-end: 1px solid hsl(var(--border) / 0.55);
|
||||
border-block-end: 1px solid hsl(var(--border) / 0.55);
|
||||
}
|
||||
.automation-calendar-day:nth-child(7n) { border-inline-end: 0; }
|
||||
.automation-calendar-day:nth-last-child(-n + 7) { border-block-end: 0; }
|
||||
}
|
||||
@@ -21,6 +21,7 @@ import { logoFallbackUrls } from "@/lib/provider-brand";
|
||||
import { sessionHandleColor } from "@/lib/session-handle";
|
||||
import type { SessionMention } from "@/lib/types";
|
||||
import { cn } from "@/lib/utils";
|
||||
import "./composer-palette.css";
|
||||
|
||||
const PALETTE_CHROME_PX = 12;
|
||||
|
||||
|
||||
@@ -0,0 +1,49 @@
|
||||
@keyframes composer-palette-enter {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(var(--palette-enter-y, 4px)) scale(0.985);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0) scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes composer-palette-preview-in {
|
||||
from {
|
||||
opacity: 0.55;
|
||||
transform: translateY(2px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.composer-palette-surface {
|
||||
--palette-enter-y: 4px;
|
||||
transform-origin: bottom center;
|
||||
animation: composer-palette-enter 130ms cubic-bezier(0.16, 1, 0.3, 1);
|
||||
}
|
||||
|
||||
.composer-palette-surface[data-placement="below"] {
|
||||
--palette-enter-y: -4px;
|
||||
transform-origin: top center;
|
||||
}
|
||||
|
||||
.composer-palette-surface[data-placement="beside"] {
|
||||
--palette-enter-y: 0px;
|
||||
transform-origin: left center;
|
||||
}
|
||||
|
||||
.composer-palette-preview-body {
|
||||
animation: composer-palette-preview-in 110ms ease-out;
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.composer-palette-surface, .composer-palette-preview-body { animation: none; }
|
||||
}
|
||||
|
||||
@media (forced-colors: active) {
|
||||
.composer-palette-surface { outline: 1px solid CanvasText; }
|
||||
}
|
||||
+1
-73
@@ -1489,48 +1489,6 @@
|
||||
container-type: inline-size;
|
||||
}
|
||||
|
||||
@keyframes composer-palette-enter {
|
||||
from {
|
||||
opacity: 0;
|
||||
transform: translateY(var(--palette-enter-y, 4px)) scale(0.985);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0) scale(1);
|
||||
}
|
||||
}
|
||||
|
||||
@keyframes composer-palette-preview-in {
|
||||
from {
|
||||
opacity: 0.55;
|
||||
transform: translateY(2px);
|
||||
}
|
||||
to {
|
||||
opacity: 1;
|
||||
transform: translateY(0);
|
||||
}
|
||||
}
|
||||
|
||||
.composer-palette-surface {
|
||||
--palette-enter-y: 4px;
|
||||
transform-origin: bottom center;
|
||||
animation: composer-palette-enter 130ms cubic-bezier(0.16, 1, 0.3, 1);
|
||||
}
|
||||
|
||||
.composer-palette-surface[data-placement="below"] {
|
||||
--palette-enter-y: -4px;
|
||||
transform-origin: top center;
|
||||
}
|
||||
|
||||
.composer-palette-surface[data-placement="beside"] {
|
||||
--palette-enter-y: 0px;
|
||||
transform-origin: left center;
|
||||
}
|
||||
|
||||
.composer-palette-preview-body {
|
||||
animation: composer-palette-preview-in 110ms ease-out;
|
||||
}
|
||||
|
||||
.dark .thread-composer-surface,
|
||||
.dark .context-inspector-surface,
|
||||
.dark .user-message-surface,
|
||||
@@ -1540,7 +1498,6 @@
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.thread-composer-surface { transition: var(--theme-paint-transition, none); }
|
||||
.composer-palette-surface, .composer-palette-preview-body { animation: none; }
|
||||
.pending-edge-overlay[data-pending-edge-overlay="pending"] .pending-edge-layer-dashed {
|
||||
border-color: hsl(var(--muted-foreground) / 0.30);
|
||||
animation: none;
|
||||
@@ -1560,7 +1517,7 @@
|
||||
}
|
||||
|
||||
@media (forced-colors: active) {
|
||||
.thread-composer-surface, .composer-palette-surface, .context-inspector-surface, .user-message-surface, .side-panel-surface { outline: 1px solid CanvasText; }
|
||||
.thread-composer-surface, .context-inspector-surface, .user-message-surface, .side-panel-surface { outline: 1px solid CanvasText; }
|
||||
.user-message-surface-dashed { outline-style: dashed; }
|
||||
.user-message-collapsible-masked {
|
||||
-webkit-mask-image: none;
|
||||
@@ -1966,35 +1923,6 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
.automation-calendar-grid { display: none; }
|
||||
.automation-calendar-agenda { display: block; }
|
||||
@container automations (min-width: 44rem) {
|
||||
.automation-calendar-grid { display: block; }
|
||||
.automation-calendar-agenda { display: none; }
|
||||
.automation-calendar-weekdays {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(7, minmax(0, 1fr));
|
||||
}
|
||||
.automation-calendar-weekdays > div {
|
||||
padding: 8px 10px;
|
||||
color: hsl(var(--muted-foreground));
|
||||
font-size: 10px;
|
||||
line-height: 16px;
|
||||
text-align: end;
|
||||
}
|
||||
.automation-calendar-month {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(7, minmax(0, 1fr));
|
||||
}
|
||||
.automation-calendar-day {
|
||||
min-block-size: 112px;
|
||||
min-inline-size: 0;
|
||||
border-inline-end: 1px solid hsl(var(--border) / 0.55);
|
||||
border-block-end: 1px solid hsl(var(--border) / 0.55);
|
||||
}
|
||||
.automation-calendar-day:nth-child(7n) { border-inline-end: 0; }
|
||||
.automation-calendar-day:nth-last-child(-n + 7) { border-block-end: 0; }
|
||||
}
|
||||
.settings-stack > :not([hidden]) ~ :not([hidden]) {
|
||||
margin-block-start: var(--settings-module-gap, 20px);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user