Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

UI polish round 7: routines start where you click, steadier menus and tables

aivsomkar7c040c5c0834
diff --git a/src/components/BotSettingsDialog.simple.test.ts b/src/components/BotSettingsDialog.simple.test.ts
index 9b8fec3712..54abcc0866 100644
--- a/src/components/BotSettingsDialog.simple.test.ts
+++ b/src/components/BotSettingsDialog.simple.test.ts
@@ -621,7 +621,8 @@ describe("the Details tab", () => {
it("says what routines are while the bot has none, with Add a routine, and lists them once it has some", () => {
const empty = botTab(makeBot());
expect(empty.html).toContain('data-panel-empty="routines"');
- expect(empty.html).toContain(">Jobs this bot runs on a schedule, like a news roundup every morning. Every bot&#x27;s routines are also in Automations.<");
+ expect(empty.html).toMatch(/>Jobs this bot runs on a schedule, like a news roundup every morning\.(<!-- -->)? <button/);
+ expect(empty.html).toContain(">Every bot&#x27;s routines are in Automations.</button>");
expect(empty.html.match(/data-panel-page="routines"/g)).toHaveLength(1);
const add = find(empty, "data-panel-page", "routines");
expect(empty.html).toMatch(/data-panel-page="routines"[^>]*>.*<span class="truncate">Add a routine<\/span><\/button>/);
diff --git a/src/components/RichTable.tsx b/src/components/RichTable.tsx
index cd4c904025..57e4fa06d0 100644
--- a/src/components/RichTable.tsx
+++ b/src/components/RichTable.tsx
@@ -193,7 +193,7 @@ function TableViewport({ columns, rows, order, name, wrap, large, sort, onSort,
className={card ? "px-4 py-2.5 align-bottom font-semibold" : "h-10 border-b border-hairline/60 px-3 py-2 font-medium"} style={{ textAlign: alignment(column, index) }}>
<div className="break-words [overflow-wrap:anywhere]" style={fit ? { minWidth: minimums[index] } : undefined}>
{card ? (
- <button type="button" className="group/th inline-flex max-w-full items-center gap-1 text-start font-semibold [text-align:inherit] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/60" aria-label={sortLabel(column, index)} title={sortLabel(column, index)} onClick={() => onSort(index)}>
+ <button type="button" className={cn("group/th inline-flex max-w-full items-center gap-1 text-start font-semibold [text-align:inherit] focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/60", alignment(column, index) === "right" && "flex-row-reverse")} aria-label={sortLabel(column, index)} title={sortLabel(column, index)} onClick={() => onSort(index)}>
<span dir="auto">{header(column, index)}</span>
{arrow(index, cn("shrink-0 text-ink-tertiary transition-opacity", sort?.column === index ? "opacity-100" : "opacity-0 group-hover/th:opacity-100 group-focus-within/th:opacity-100 touch:opacity-100"))}
</button>
diff --git a/src/components/SettingsModal.tsx b/src/components/SettingsModal.tsx
index 0c887a1a17..2d9245205e 100644
--- a/src/components/SettingsModal.tsx
+++ b/src/components/SettingsModal.tsx
@@ -571,7 +571,7 @@ export function SettingsModal() {
ref={scrollRef}
data-settings-scroll
className={cn(
- "flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto px-4 pb-10 pt-4 sm:px-8 sm:pb-12 sm:pt-[22px]",
+ "settings-scroll flex min-h-0 flex-1 flex-col gap-5 overflow-y-auto px-4 pb-10 pt-4 sm:px-8 sm:pb-12 sm:pt-[22px]",
SIMPLE_BUTTONS,
"[&_.uppercase]:normal-case [&_.uppercase]:tracking-normal",
)}
diff --git a/src/components/bot-panel/DetailsTab.tsx b/src/components/bot-panel/DetailsTab.tsx
index eca54c8c1d..b43ff75099 100644
--- a/src/components/bot-panel/DetailsTab.tsx
+++ b/src/components/bot-panel/DetailsTab.tsx
@@ -2,7 +2,7 @@ import { Calendar, CalendarPlus, ChevronRight, Sparkles } from "lucide-react";
import { cn } from "@/lib/cn";
import { t } from "@/lib/i18n";
-import type { Bot } from "@/state/store";
+import { useStore, type Bot } from "@/state/store";
import { useChatMoreItems } from "../ChatMoreMenu";
import { ModelPicker } from "../ModelPicker";
import type { SidebarMenuItem } from "../SidebarPopoverMenu";
@@ -45,6 +45,7 @@ export function DetailsTab({ bot, derived, onOpen }: {
onOpen: (page: SimplePageId) => void;
}) {
const { items } = useChatMoreItems(bot);
+ const { dispatch } = useStore();
const routinesOn = derived.botRoutines.filter((routine) => routine.enabled).length;
const conversationItems = CONVERSATION_ITEMS.flatMap((key) => items.filter((item) => item.key === key));
@@ -66,7 +67,13 @@ export function DetailsTab({ bot, derived, onOpen }: {
{derived.botRoutines.length === 0 ? (
<section data-panel-empty="routines">
<CardLabel>{t("botSettings.simple.routines")}</CardLabel>
- <p className="mx-1 text-[13px] leading-[18px] text-ink-tertiary">{t("botPanel.routines.emptyHint")}</p>
+ <p className="mx-1 text-[13px] leading-[18px] text-ink-tertiary">
+ {t("botPanel.routines.emptyHint")}{" "}
+ <button type="button" data-panel-automations onClick={() => dispatch({ type: "showRoutines", view: "list" })}
+ className="rounded-[4px] font-medium text-ink-secondary underline decoration-ink/25 underline-offset-2 hover:text-ink hover:decoration-ink/60">
+ {t("botPanel.routines.seeAll")}
+ </button>
+ </p>
<button
type="button"
data-panel-page="routines"
diff --git a/src/components/bot-panel/pages.tsx b/src/components/bot-panel/pages.tsx
index 8adf79e51e..33cd26f411 100644
--- a/src/components/bot-panel/pages.tsx
+++ b/src/components/bot-panel/pages.tsx
@@ -129,7 +129,8 @@ export function AppsPage({ bot, derived }: PageContext) {
export function RoutinesPage({ bot, derived }: PageContext) {
const { state, dispatch } = useStore();
- const [editing, setEditing] = useState<Routine | "new" | null>(null);
+ // Arriving with no routines means the person asked to add one, so the editor opens straight away.
+ const [editing, setEditing] = useState<Routine | "new" | null>(() => derived.botRoutines.length === 0 ? "new" : null);
return (
<>
<RoutineList
diff --git a/src/locales/en.json b/src/locales/en.json
index 496213d2fd..5947bbaed6 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -4255,7 +4255,8 @@
"botPanel.tab.details": "Details",
"botPanel.tab.library": "Library",
"botPanel.routines.empty": "Routines are recurring tasks this bot runs on a schedule. Ask it in chat to set one up.",
- "botPanel.routines.emptyHint": "Jobs this bot runs on a schedule, like a news roundup every morning. Every bot's routines are also in Automations.",
+ "botPanel.routines.emptyHint": "Jobs this bot runs on a schedule, like a news roundup every morning.",
+ "botPanel.routines.seeAll": "Every bot's routines are in Automations.",
"botPanel.routines.add": "Add a routine",
"botPanel.library.empty": "Pages, files, and apps this bot makes show up here",
"botPanel.library.pages": "Pages",
diff --git a/src/styles.css b/src/styles.css
index 381ce2c672..aba7a6496f 100644
--- a/src/styles.css
+++ b/src/styles.css
@@ -1580,6 +1580,24 @@ body {
:root[data-skin="daylight"] [data-settings-look] > .glass-scrim {
background: rgb(0 0 0 / 0.18);
}
+/* Settings fades its bottom edge only while more lies below: the fade rides the pane's own scroll, so it is absent
+ when nothing scrolls and gone once the end is reached. */
+@property --settings-fade {
+ syntax: "<length>";
+ inherits: false;
+ initial-value: 0px;
+}
+@keyframes settings-fade {
+ 0%, 94% { --settings-fade: 36px; }
+ 100% { --settings-fade: 0px; }
+}
+@supports (animation-timeline: scroll()) {
+ .settings-scroll {
+ mask-image: linear-gradient(to bottom, #000 calc(100% - var(--settings-fade)), transparent);
+ animation: settings-fade linear both;
+ animation-timeline: scroll(self);
+ }
+}
/* Over a light scrim the sheet needs its own lift. */
:root[data-skin="daylight"] [data-settings-look] .glass-surface {
box-shadow: 0 24px 64px -16px rgb(28 28 28 / 0.28), 0 2px 8px rgb(28 28 28 / 0.06);
@@ -3007,7 +3025,7 @@ button:disabled.bg-danger {
:root,
:is([data-skin="midnight"], [data-skin="foundry"], [data-skin="graphite"], [data-skin="dusk"], [data-skin="halloween"]) {
--radius-menu: 12px;
- --menu-shadow: 0 0 #0000;
+ --menu-shadow: 0 14px 32px -10px rgb(0 0 0 / 0.7), 0 2px 8px rgb(0 0 0 / 0.35);
}
:is([data-skin="atelier"], [data-skin="lagoon"], [data-skin="linen"], [data-skin="meadow"], [data-skin="pop"]) {
--menu-shadow: 0 8px 24px -6px rgb(0 0 0 / 0.12), 0 1px 2px rgb(0 0 0 / 0.04);