Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .agents/plans/button-hover-and-new-chat-icon-2026-11-23-plan.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Button hover and NewChatIcon

1. Document and add `group/btn` to every Button base recipe. Move the chat pen into the UI package with its own motion styles.
2. Prepare aligned 10.1.0 manifests, run `pnpm check` including isolated installation, and open a release PR.
3. Obtain Matt's confirmation before merging and pushing the immutable release tag through the protected npm workflow. Verify published archives and provenance.
4. Upgrade Impression on master after publication. Remove the local icon/keyframes, audit hover workarounds, and address the 10.x changes.
5. Run Impression lint, types, unit and sidebar checks, inspect the browser in both themes, then commit the verified migration.

The 9.4.0 to 10.x history is recorded in docs/package-release.md and commit 3a53845. Required sidebar icons and AppSidebarGroup labels affect CTX9 shell users; Impression uses its own sidebar. Shared Button routing, select check-mark spacing, dialog and feedback styles need consumer verification.

## Progress

- Shared UI implementation and 10.1.0 manifests are ready. The full Node 22 check passes, including all 26 tests and clean archive installation, typecheck, render and style-policy enforcement.
- Impression is current with origin/master at f58e456c. Frozen dependency installation passes after starting and unlocking the installed Notenv broker. Unrelated cache files and browser artifacts remain untouched.
- Impression has no CTX9 shell/DataTable consumers. Its migration is expected to change the exact UI pin and release-age exception, lockfile, sidebar import and local icon/keyframes, plus CreatePostMenuButton's existing named hover class.
- Other reviewed hover groups cover non-Button layouts or multiple controls. Keep those groups.
- Publication requires Matt's confirmation before merging the release PR and pushing v10.1.0. No npm publication or Impression migration commit has occurred.
2 changes: 2 additions & 0 deletions docs/component-inventory.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ The v8 inventory uses Impression's internal application components and semantic
transparent at rest, grows with its content and lines its text up with the
question. Sections own their heading, 48px separation and 40px question
rhythm.
- NewChatIcon supplies the animated square pen for chat launchers. Every Button
exposes `group/btn` for descendant hover effects, including links.
- Button with stable loading text, ButtonGroup, and Impression's animated
FunkyLoaderButton with typed loading and gradient options;
- FunkyLoaderButton's growing-row width owns the existing full-width flex
Expand Down
12 changes: 12 additions & 0 deletions docs/package-release.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Package release and consumption

## 10.1.0 Button hover and chat icon

Every Button variant exposes `group/btn`, including native buttons, `href`
links and `asChild` compositions. Use `group-hover/btn:` on descendants.
NewChatIcon supplies the animated square pen with full-contrast hover colour
and reduced-motion support. No Button class override is needed.

All three packages advance together to 10.1.0. The complete local `pnpm check`
passes under Node 22, including 26 tests and isolated archive installation.
Publication and registry read-back remain pending Matt's approval of the
release PR.

## 10.0.0 application UI

Sidebar navigation items now require a Lucide `icon`. Migrate each consumer
Expand Down
6 changes: 6 additions & 0 deletions docs/source-provenance.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

Reference repository: Impression

NewChatIcon moves Impression `f58e456c`'s Lucide square pen into the shared
package. The 2.5 stroke, visible overflow, full-contrast hover colour and
reduced-motion colour-only behavior are retained. Matt's November 23 request
sets a 1.6px clockwise circle over 500ms. The pen uses the shared `group/btn`
hook so button and link renderings share the same hover behavior.

Matt's October 21 Impression redesign requests 36px sidebar section rows,
32px child rows, a full-width workspace switcher and a 32px avatar floor, and
adds QuestionField, QuestionExample, QuestionSection and the quiet Textarea
Expand Down
3 changes: 3 additions & 0 deletions docs/style-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ This guide is canonical for Impression's authenticated application and CTX9-owne
dismissal behavior local.
- Recovery material, secrets metadata, and artifact identifiers use the shared `font-mono` utility and selectable wrapping.
- Standard actions use `Button`. Its `loading` and `loadingLabel` props own the loading state.
Every Button supplies `group/btn`, including links; descendants use
`group-hover/btn:` for hover effects. `NewChatIcon` owns the chat pen motion
and full-contrast hover colour, with colour only under reduced motion.
- Text buttons in CTX9 apps carry a leading Lucide icon through `icon`; the
Button sizes it at 16px and swaps it for a spinner while loading. Use one
meaning per icon across apps (Retry `RotateCw`, Cancel `X`, Save `Save`, Add
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ctx9/web-workspace",
"version": "10.0.1",
"version": "10.1.0",
"private": true,
"license": "Apache-2.0",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion packages/identity/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ctx9/identity",
"version": "10.0.1",
"version": "10.1.0",
"description": "Passkey and confidential OIDC identity authority with application-owned persistence",
"license": "Apache-2.0",
"repository": {
Expand Down
16 changes: 16 additions & 0 deletions packages/ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
DataTable,
Input,
NavigationProvider,
NewChatIcon,
} from "@ctx9/ui";
```

Expand All @@ -30,3 +31,18 @@ Applications own product row types, columns, URL state, and mutations. Shared co

Animations are allowed. Keep Impression's existing spinning action loader and
pulsing skeletons when migrating their usages.

Every `Button` supplies the named `group/btn` hover hook, including `href` and
`asChild` links. Descendants can use `group-hover/btn:` without caller classes
on the Button. Appearance still belongs to variants and presets.

`NewChatIcon` uses this hook to turn its pen black in light mode or white in dark
mode and trace one tiny clockwise circle over 500ms. Reduced motion keeps only
the colour change. Its SVG allows overflow so the pen stays visible.

```tsx
<Button preset="chatLauncher">
<NewChatIcon className="size-5" />
New chat
</Button>
```
2 changes: 1 addition & 1 deletion packages/ui/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ctx9/ui",
"version": "10.0.1",
"version": "10.1.0",
"description": "Shared Impression and CTX9 internal application UI",
"license": "Apache-2.0",
"repository": {
Expand Down
10 changes: 5 additions & 5 deletions packages/ui/src/button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const dateTimeJoinedStyles = cn(
);

const standardButtonVariants = cva(
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors duration-300 disabled:pointer-events-none disabled:opacity-50",
"group/btn inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors duration-300 disabled:pointer-events-none disabled:opacity-50",
{
variants: {
surface: {
Expand Down Expand Up @@ -465,7 +465,7 @@ const standardButtonVariants = cva(
"inline-flex h-5 min-h-5 w-5 min-w-5 items-center justify-center rounded-md border border-neutral-400 text-primary transition-all hover:scale-[120%] disabled:cursor-not-allowed disabled:opacity-40 dark:border-mono-600",
railIcon: "m-0 h-7 w-7 min-w-7 gap-0 rounded-xl px-0",
railFunkyIcon:
"m-0 h-7 w-7 min-w-7 gap-0 rounded-xl px-0 group/btn relative overflow-hidden border border-input shadow-none",
"m-0 h-7 w-7 min-w-7 gap-0 rounded-xl px-0 relative overflow-hidden border border-input shadow-none",
shimmerAction: "",
previewIcon:
"size-9 rounded-xl border border-black/8 bg-white/95 text-mono-500 shadow-sm transition-colors hover:bg-neutral-100 hover:text-mono-900 dark:border-white/10 dark:bg-black/80 dark:text-mono-300 dark:hover:bg-mono-950 dark:hover:text-white",
Expand Down Expand Up @@ -649,7 +649,7 @@ const standardButtonVariants = cva(
{
preset: "shimmerAction",
className:
"group/btn relative z-10 px-4 font-medium shadow-none dark:text-mono-100 rounded-xl bg-brandPrimary dark:bg-brandPrimary text-white hover:bg-brandPrimary hover:dark:bg-brandPrimary",
"relative z-10 px-4 font-medium shadow-none dark:text-mono-100 rounded-xl bg-brandPrimary dark:bg-brandPrimary text-white hover:bg-brandPrimary hover:dark:bg-brandPrimary",
},
{
state: "shimmerLoading",
Expand Down Expand Up @@ -708,7 +708,7 @@ export function buttonVariants(
) {
if (props.surface !== "auth" && props.variant === "iconDashed") {
return cn(
"flex h-6 w-6 flex-shrink-0 items-center justify-center gap-1 rounded-md text-sm",
"group/btn flex h-6 w-6 flex-shrink-0 items-center justify-center gap-1 rounded-md text-sm",
"border border-dashed border-neutral-300 bg-neutral-50 transition-all duration-200",
"dark:border-mono-700 dark:bg-mono-900",
props.state === "concealed"
Expand All @@ -721,7 +721,7 @@ export function buttonVariants(
}
if (props.surface !== "auth" && props.variant === "iconInfo") {
return cn(
"flex h-6 w-6 items-center justify-center rounded-md",
"group/btn flex h-6 w-6 items-center justify-center rounded-md",
"cursor-pointer transition-colors duration-200 hover:bg-neutral-200 hover:dark:bg-neutral-700",
props.class,
props.className,
Expand Down
4 changes: 2 additions & 2 deletions packages/ui/src/funky-loader-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ const presetClassNames = {
sidebarTextStyles,
"border border-input bg-inherit bg-white dark:bg-black",
funkyBlueButtonColourAndText,
"group/btn relative size-[42px] overflow-hidden rounded-full",
"relative size-[42px] overflow-hidden rounded-full",
),
contentAction:
"h-8 w-8 min-w-8 rounded-xl border border-input p-0 shadow-none",
Expand Down Expand Up @@ -191,7 +191,7 @@ export const FunkyLoaderButton = React.forwardRef<
...props,
asChild,
className: cn(
"group/btn relative",
"relative",
surface === "app" && "px-4 font-medium shadow-none",
width === "grow" && "w-full",
presetClassNames[preset],
Expand Down
1 change: 1 addition & 0 deletions packages/ui/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export * from "./avatar.js";
export * from "./breadcrumb.js";
export * from "./common.js";
export * from "./button.js";
export * from "./new-chat-icon.js";
export * from "./funky-loader-button.js";
export * from "./shimmer-border-button.js";
export * from "./card.js";
Expand Down
32 changes: 32 additions & 0 deletions packages/ui/src/new-chat-icon.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import type { ComponentProps } from "react";

import { cn } from "./cn.js";

/**
* Lucide's square pen. When its button is hovered, the pen turns full
* contrast and circles once; reduced motion keeps only the colour.
* Visible overflow keeps the circling pen whole beyond the icon's box.
*/
export function NewChatIcon({ className, ...props }: ComponentProps<"svg">) {
return (
<svg
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="none"
stroke="currentColor"
strokeWidth="2.5"
strokeLinecap="round"
strokeLinejoin="round"
aria-hidden="true"
className={cn("overflow-visible", className)}
{...props}
>
<path d="M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" />
<path
stroke="currentColor"
className="transition-colors motion-safe:group-hover/btn:animate-[ctx9-pen-circle_500ms_linear] group-hover/btn:text-black dark:group-hover/btn:text-white"
d="M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z"
/>
</svg>
);
}
29 changes: 29 additions & 0 deletions packages/ui/src/styles.css
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,35 @@
animation: pulse-blue-border 2s cubic-bezier(0.4, 0, 0.6, 1);
}

/* One 1.6px clockwise circle, returning the pen to its resting position. */
@keyframes ctx9-pen-circle {
0%,
100% {
transform: translate(0, 0);
}
12.5% {
transform: translate(-0.57px, -0.23px);
}
25% {
transform: translate(-0.8px, -0.8px);
}
37.5% {
transform: translate(-0.57px, -1.37px);
}
50% {
transform: translate(0, -1.6px);
}
62.5% {
transform: translate(0.57px, -1.37px);
}
75% {
transform: translate(0.8px, -0.8px);
}
87.5% {
transform: translate(0.57px, -0.23px);
}
}

@layer base {
* {
@apply border-border;
Expand Down
2 changes: 1 addition & 1 deletion packages/web-auth/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@ctx9/web-auth",
"version": "10.0.1",
"version": "10.1.0",
"description": "Shared CTX9 confidential OIDC BFF protocol",
"license": "Apache-2.0",
"repository": {
Expand Down
5 changes: 3 additions & 2 deletions scripts/check-isolated-install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,16 @@ try {
await writeFile(
join(scratch, "consumer.tsx"),
`
import { Button, Input, Checkbox, ColorPicker, NumberSelect, FormDisclosure, FormExampleAction, ShimmerBorderButton, FunkyLoaderButton, DataTable, createDataTableColumnHelper, AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogAction, AlertDialogCancel, createCtx9Applications } from '@ctx9/ui';
import { Button, NewChatIcon, Input, Checkbox, ColorPicker, NumberSelect, FormDisclosure, FormExampleAction, ShimmerBorderButton, FunkyLoaderButton, DataTable, createDataTableColumnHelper, AlertDialog, AlertDialogTrigger, AlertDialogContent, AlertDialogHeader, AlertDialogTitle, AlertDialogDescription, AlertDialogFooter, AlertDialogAction, AlertDialogCancel, createCtx9Applications } from '@ctx9/ui';
import * as auth from '@ctx9/web-auth';
import { createIdentityAuthority, toNodeHandler } from '@ctx9/identity';
import { renderToStaticMarkup } from 'react-dom/server';
import { checkStyleSource } from '@ctx9/ui/style-policy';
interface Row { id: string; name: string }
const helper = createDataTableColumnHelper<Row>();
const columns = [helper.accessor('name', { header: 'Name' })];
const app = <><Button variant="primary">Save</Button><Input aria-label="Name" />
const app = <><Button variant="primary">Save</Button>
<Button preset="chatLauncher"><NewChatIcon />New chat</Button><Input aria-label="Name" />
<Button variant="secondary" preset="dateTimeMenu" state="dateTimeIntended">Schedule</Button>
<ShimmerBorderButton preset="upgrade">Upgrade</ShimmerBorderButton>
<FunkyLoaderButton preset="pricing">Select plan</FunkyLoaderButton>
Expand Down