{
- const next = levels[index];
- if (next) selectValue(reasoning, next.id);
- }}
- onPreviewChange={setPreviewIndex}
- />
+ {segmented ? (
+
+ ) : (
+
+ )}
{levelLocked ? (
Your prompt contains "ultrathink" in the text. Remove it to change this
diff --git a/apps/web/src/fincke/EffortSegments.tsx b/apps/web/src/fincke/EffortSegments.tsx
new file mode 100644
index 0000000000..fa8b657cc3
--- /dev/null
+++ b/apps/web/src/fincke/EffortSegments.tsx
@@ -0,0 +1,63 @@
+// apps/web/src/fincke/EffortSegments.tsx
+// effort levels as a row of named segments, the alternative to the snapping slider
+import type { RefObject } from "react";
+
+import { Toggle, ToggleGroup } from "../components/ui/toggle-group";
+import { Tooltip, TooltipPopup, TooltipTrigger } from "../components/ui/tooltip";
+import type { EffortLevel } from "./EffortSlider";
+import "./effortSlider.css";
+
+// the popover is narrow, so long level names get a short form; the full name stays the label
+const SHORT_LABELS: Record = {
+ minimal: "Min",
+ medium: "Med",
+ xhigh: "XHigh",
+ ultracode: "Ultra",
+ ultrathink: "Ultra",
+};
+
+export function EffortSegments(props: {
+ levels: ReadonlyArray;
+ index: number;
+ label: string;
+ disabled?: boolean;
+ // the popover focuses the current level on open, so the caller owns this ref
+ currentRef: RefObject;
+ onCommit: (index: number) => void;
+}) {
+ const current = props.levels[props.index];
+
+ return (
+ {
+ // pressing the current level again reports no value, which keeps it selected
+ const next = props.levels.findIndex((level) => level.id === values[0]);
+ if (next >= 0) props.onCommit(next);
+ }}
+ >
+ {props.levels.map((level, levelIndex) => (
+
+
+ }
+ >
+ {SHORT_LABELS[level.id] ?? level.label}
+ {level.isDefault ? : null}
+
+ {level.description ? {level.description} : null}
+
+ ))}
+
+ );
+}
diff --git a/apps/web/src/fincke/EffortSlider.tsx b/apps/web/src/fincke/EffortSlider.tsx
index 383d07858e..7d21704851 100644
--- a/apps/web/src/fincke/EffortSlider.tsx
+++ b/apps/web/src/fincke/EffortSlider.tsx
@@ -20,9 +20,9 @@ export interface EffortLevel {
readonly ultra: boolean;
}
-// stops sit inside 6%..94% so the thumb never overhangs the rounded ends
+// stops sit inside 3%..97% so the thumb never overhangs the rail's ends
function stopPosition(index: number, count: number): number {
- return count < 2 ? 50 : 6 + (index / (count - 1)) * 88;
+ return count < 2 ? 50 : 3 + (index / (count - 1)) * 94;
}
function nearestStop(pct: number, count: number): number {
diff --git a/apps/web/src/fincke/effortSlider.css b/apps/web/src/fincke/effortSlider.css
index 8d474f0567..574717672b 100644
--- a/apps/web/src/fincke/effortSlider.css
+++ b/apps/web/src/fincke/effortSlider.css
@@ -1,20 +1,17 @@
/* apps/web/src/fincke/effortSlider.css */
-/* effort popover track, thumb & one-shot ultra effects; every theme, fincke tokens win when present */
+/* effort popover: slim slider, segments & one-shot ultra effects; fincke tokens win when present */
[data-slot="effort-panel"] {
- --effort-accent: var(--fincke-teal, var(--primary));
+ /* the panel carries the chip's data-effort-level, so ocean gives it the same level tint */
+ --effort-accent: var(--fincke-effort-tint, var(--fincke-teal, var(--primary)));
--effort-ultra-from: var(--fincke-blue, #82aaff);
--effort-ultra-to: var(--fincke-purple, #c792ea);
- --effort-track: color-mix(in srgb, var(--foreground) 7%, transparent);
+ --effort-rail: color-mix(in srgb, var(--foreground) 10%, transparent);
/* eases into the stop with no overshoot */
--effort-snap: cubic-bezier(0.22, 1, 0.36, 1);
--effort-snap-duration: 0.32s;
}
-html[data-theme-id="fincke-ocean"] [data-slot="effort-panel"] {
- --effort-track: var(--sidebar);
-}
-
/* the composer chip turns purple on ultra levels */
[data-effort-ultra] {
color: var(--fincke-purple, #c792ea);
@@ -24,7 +21,9 @@ html[data-theme-id="fincke-ocean"] [data-slot="effort-panel"] {
[data-slot="effort-level"] {
font-size: 15px;
color: var(--effort-accent);
- transition: opacity 0.18s;
+ transition:
+ opacity 0.18s,
+ color 0.2s;
animation: fincke-effort-label-in 0.18s ease-out;
}
@@ -75,12 +74,10 @@ html[data-theme-id="fincke-ocean"] [data-slot="effort-panel"] {
outline-offset: 1px;
}
+/* a tall hit area around a thin rail */
[data-slot="effort-track"] {
position: relative;
- height: 28px;
- border: 1px solid color-mix(in srgb, #ffffff 5%, transparent);
- border-radius: 14px;
- background: var(--effort-track);
+ height: 24px;
cursor: grab;
touch-action: none;
outline: none;
@@ -97,28 +94,34 @@ html[data-theme-id="fincke-ocean"] [data-slot="effort-panel"] {
opacity: 0.5;
}
-[data-slot="effort-track"]:focus-visible {
- box-shadow: 0 0 0 2px color-mix(in srgb, var(--effort-accent) 40%, transparent);
+[data-slot="effort-track"]:focus-visible [data-slot="effort-thumb"] {
+ box-shadow: 0 0 0 3px color-mix(in srgb, var(--effort-ring) 45%, transparent);
}
+/* the rail; it clips the fill, so the fill needs no rounding of its own */
[data-slot="effort-clip"] {
position: absolute;
- inset: 0;
+ inset-inline: 0;
+ top: 50%;
+ height: 6px;
+ margin-top: -3px;
overflow: hidden;
- border-radius: 14px;
+ border-radius: 3px;
+ background: var(--effort-rail);
}
-/* a full-width fill slid left so its rounded end sits just past the thumb */
+/* a full-width fill slid left so it ends under the thumb */
[data-slot="effort-fill"] {
position: absolute;
inset-block: 0;
left: 0;
width: 100%;
overflow: hidden;
- border-radius: 14px;
background: var(--effort-accent);
- translate: calc((var(--effort-pct) - 100) * 1cqw + 13px) 0;
- transition: translate var(--effort-snap-duration) var(--effort-snap);
+ translate: calc((var(--effort-pct) - 100) * 1cqw) 0;
+ transition:
+ translate var(--effort-snap-duration) var(--effort-snap),
+ background-color 0.2s;
}
/* counter-slid inside the fill, so the gradient & sparks stay pinned to the track */
@@ -129,7 +132,7 @@ html[data-theme-id="fincke-ocean"] [data-slot="effort-panel"] {
width: 100cqw;
background: linear-gradient(90deg, var(--effort-ultra-from), var(--effort-ultra-to));
opacity: 0;
- translate: calc((100 - var(--effort-pct)) * 1cqw - 13px) 0;
+ translate: calc((100 - var(--effort-pct)) * 1cqw) 0;
transition:
opacity 0.2s ease-out,
translate var(--effort-snap-duration) var(--effort-snap);
@@ -141,8 +144,8 @@ html[data-theme-id="fincke-ocean"] [data-slot="effort-panel"] {
[data-slot="effort-spark"] {
position: absolute;
- width: 2px;
- height: 2px;
+ width: 1.5px;
+ height: 1.5px;
border-radius: 50%;
background: #ffffff;
}
@@ -172,11 +175,11 @@ html[data-theme-id="fincke-ocean"] [data-slot="effort-panel"] {
position: absolute;
top: 50%;
z-index: 1;
- width: 5px;
- height: 5px;
- margin: -2.5px 0 0 -2.5px;
+ width: 3px;
+ height: 3px;
+ margin: -1.5px 0 0 -1.5px;
border-radius: 50%;
- background: color-mix(in srgb, var(--foreground) 30%, transparent);
+ background: color-mix(in srgb, var(--foreground) 40%, transparent);
pointer-events: none;
transition: background-color 0.15s;
}
@@ -189,18 +192,16 @@ html[data-theme-id="fincke-ocean"] [data-slot="effort-panel"] {
background: color-mix(in srgb, #000000 45%, transparent);
}
-/* the default level is a hollow ring */
-[data-slot="effort-stop"][data-default] {
- width: 7px;
- height: 7px;
- margin: -3.5px 0 0 -3.5px;
- background: transparent;
- box-shadow: 0 0 0 1.5px var(--muted-foreground);
-}
-
-[data-slot="effort-stop"][data-default][data-filled] {
- background: transparent;
- box-shadow: 0 0 0 1.5px color-mix(in srgb, #000000 55%, transparent);
+/* the default level gets a notch under the rail */
+[data-slot="effort-stop"][data-default]::after {
+ content: "";
+ position: absolute;
+ top: 7px;
+ left: 0.5px;
+ width: 2px;
+ height: 4px;
+ border-radius: 1px;
+ background: var(--muted-foreground);
}
[data-slot="effort-thumb"] {
@@ -209,12 +210,11 @@ html[data-theme-id="fincke-ocean"] [data-slot="effort-panel"] {
top: 50%;
left: 0;
z-index: 2;
- width: 22px;
- height: 22px;
- margin: -11px 0 0 -11px;
+ width: 14px;
+ height: 14px;
+ margin: -7px 0 0 -7px;
border-radius: 50%;
- background: #ffffff;
- box-shadow: 0 1px 4px color-mix(in srgb, #000000 53%, transparent);
+ background: var(--foreground);
pointer-events: none;
translate: calc(var(--effort-pct) * 1cqw) 0;
transition:
@@ -228,9 +228,7 @@ html[data-theme-id="fincke-ocean"] [data-slot="effort-panel"] {
}
[data-slot="effort-track"]:hover [data-slot="effort-thumb"] {
- box-shadow:
- 0 1px 4px color-mix(in srgb, #000000 53%, transparent),
- 0 0 0 4px color-mix(in srgb, var(--effort-ring) 14%, transparent);
+ box-shadow: 0 0 0 4px color-mix(in srgb, var(--effort-ring) 20%, transparent);
}
/* the thumb gives under a press before the drag starts */
@@ -240,9 +238,7 @@ html[data-theme-id="fincke-ocean"] [data-slot="effort-panel"] {
[data-slot="effort-track"][data-dragging] [data-slot="effort-thumb"] {
scale: 1.14;
- box-shadow:
- 0 2px 8px color-mix(in srgb, #000000 63%, transparent),
- 0 0 0 6px color-mix(in srgb, var(--effort-ring) 20%, transparent);
+ box-shadow: 0 0 0 5px color-mix(in srgb, var(--effort-ring) 28%, transparent);
}
/* while dragging the thumb & fill follow the pointer directly */
@@ -253,7 +249,7 @@ html[data-theme-id="fincke-ocean"] [data-slot="effort-panel"] {
}
[data-slot="effort-track"][data-dragging] [data-slot="effort-fill"] {
- transition: none;
+ transition: background-color 0.2s;
}
[data-slot="effort-track"][data-dragging] [data-slot="effort-ultra"] {
@@ -322,9 +318,9 @@ html[data-theme-id="fincke-ocean"] [data-slot="effort-panel"] {
/* a shockwave ring expands from the thumb */
[data-slot="effort-ring"] {
position: absolute;
- width: 22px;
- height: 22px;
- margin: -11px 0 0 -11px;
+ width: 14px;
+ height: 14px;
+ margin: -7px 0 0 -7px;
border: 2px solid var(--effort-ultra-to);
border-radius: 50%;
animation: fincke-effort-ring 0.7s cubic-bezier(0.2, 0.7, 0.3, 1) 0.18s both;
@@ -341,11 +337,14 @@ html[data-theme-id="fincke-ocean"] [data-slot="effort-panel"] {
}
}
-/* the whole track glows once */
+/* the whole rail glows once */
[data-slot="effort-glow"] {
position: absolute;
- inset: -1px;
- border-radius: 14px;
+ inset-inline: -1px;
+ top: 50%;
+ height: 8px;
+ margin-top: -4px;
+ border-radius: 4px;
box-shadow:
0 0 14px 2px color-mix(in srgb, var(--effort-ultra-to) 70%, transparent),
0 0 4px var(--effort-ultra-from);
@@ -365,6 +364,39 @@ html[data-theme-id="fincke-ocean"] [data-slot="effort-panel"] {
}
}
+/* segments mode: the level row is a toggle group stretched across the popover */
+[data-effort-segments] {
+ width: 100%;
+}
+
+/* the tooltip trigger takes over data-slot, so segments carry their own attribute */
+[data-effort-segment] {
+ flex: 1 1 auto;
+ min-width: 0;
+ padding-inline: 6px;
+}
+
+[data-effort-segment][data-pressed] {
+ color: var(--effort-accent);
+}
+
+[data-effort-segment][data-ultra][data-pressed] {
+ color: var(--effort-ultra-to);
+}
+
+/* marks the default level */
+[data-slot="effort-default-dot"] {
+ position: absolute;
+ bottom: 2px;
+ left: 50%;
+ width: 3px;
+ height: 3px;
+ margin-left: -1.5px;
+ border-radius: 50%;
+ background: currentColor;
+ opacity: 0.6;
+}
+
@media (prefers-reduced-motion: reduce) {
[data-slot="effort-panel"] * {
transition: none !important;
diff --git a/apps/web/src/fincke/oceanTokens.css b/apps/web/src/fincke/oceanTokens.css
index b3c76e6d7e..8d84db2367 100644
--- a/apps/web/src/fincke/oceanTokens.css
+++ b/apps/web/src/fincke/oceanTokens.css
@@ -135,6 +135,6 @@ html[data-theme-id="fincke-ocean"]
html[data-theme-id="fincke-ocean"]
[data-effort-level]
- :is([data-composer-control-label], .lucide-brain, .lucide-gauge) {
+ :is([data-composer-control-label], [data-slot="effort-bars"], .lucide-brain, .lucide-gauge) {
color: var(--fincke-effort-tint, inherit);
}
diff --git a/docs/operations/thin-fork.md b/docs/operations/thin-fork.md
index 2c7e8e0525..1ec5f5a889 100644
--- a/docs/operations/thin-fork.md
+++ b/docs/operations/thin-fork.md
@@ -496,7 +496,8 @@ Every upstream file touched for a personal design change is listed here. Earlier
| `apps/web/src/proposedPlan.ts`, `apps/web/src/session-logic.ts`, `packages/client-runtime/package.json` | `packages/client-runtime/src/proposedPlan.ts` | Hook | Implement-prompt helpers and latest-plan selection live in client-runtime (shared with mobile) and are re-exported. |
| `apps/mobile/src/persistence/mobile-preferences.ts` | mobile `use-sidebar-view.ts` | Hook | Stores `sidebarProjectsView`; collapsed projects reuse `collapsedProjectGroups`. |
| `apps/mobile/src/features/threads/ThreadSettingsSheet.tsx`, `ThreadComposer.tsx` | mobile `ProviderLimitsLine.tsx` | Hook | One-line limits under each provider header; the low-limit ring opens thread settings. |
-| `apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx`, `V5StackHeader.ios.tsx` | none | Hook | Duo bar: fixed sidebar width; sidebar, new task and search group; thread settings ends the tools group. |
+| `apps/mobile/src/features/threads/ThreadSettingsSheet.tsx`, `ThreadComposer.tsx`, `Stack.tsx` | mobile `EffortBars.tsx`, `composer-controls.tsx` | Hook | Effort chip and Reasoning slider show level bars and the ocean level color (`SliderRow` gains `iconSlot`, `tintColor`, `footer`); opened onto one option, the settings sheet starts compact. |
+| `apps/mobile/src/features/layout/createWorkspaceStackNavigator.ios.tsx`, `V5StackHeader.ios.tsx` | none | Hook | Duo bar: sidebar, new task and search group; thread settings ends the tools group. |
| `apps/mobile/src/features/keyboard/hardwareKeyboardCommands.ts`, `HardwareKeyboardCommandProvider.tsx` | none | Hook | `threadSettings` (registered by `ThreadComposer.tsx`) and a dispatched `commandPalette` back the bar buttons. |
| `apps/mobile/src/features/threads/ThreadHeader.tsx`, `useSidebarToggle.ts` | none | Hook | The Duo drops the header sidebar button and adds thread settings to the bar's tools group. |
| `apps/mobile/src/components/CompactBrandTitle.tsx`, `apps/mobile/src/features/home/HomeScreen.tsx` | mobile `wave-header-edge.ts` | Hook | Ocean: white brand title; the home list hides UIKit's top edge effect only while the wave band is under the header and restores it once the band has scrolled away, so rows under the title keep a backing. The view toggle pulls up past the wave's lower tail (`finckeWaveTail`) so it stays put while the band shows the whole back ribbon. |
@@ -515,6 +516,8 @@ Every upstream file touched for a personal design change is listed here. Earlier
| `knip.jsonc` | none | Hook | Keeps the replaced upstream originals and the icon shims as entries. |
| `apps/web/src/components/chat/composerProviderState.tsx` | `EffortPicker.tsx` | Hook | Renders the owned effort picker. |
| `apps/web/src/components/chat/TraitsPicker.tsx`, `ComposerPendingApprovalActions.tsx` | `EffortPicker.tsx`, `FinckeApprovalCard.tsx` | Hook | Export `getTraitsSectionVisibility` and `DEFAULT_APPROVAL_OPTIONS`. |
+| `apps/web/src/components/settings/AppearanceSettingsPanel.tsx`, `settingsSearch.ts`, contracts `settings.ts` | `EffortControlSetting.tsx`, `EffortSegments.tsx` | Hook | Effort control setting (client `effortControl`): the effort popover picks a level from named segments or a slim slider. |
+| `apps/web/src/components/chat/DraftHeroHeadline.tsx`, `DraftHeroProjectHeading.tsx` | `packages/shared/src/fincke-draft-headline.ts` | Hook | The new-thread headline rotates through a shared list, one stable line per draft (also mobile `NewTaskDraftScreen.tsx`). |
| `apps/web/src/components/chat/ChatComposer.tsx` | `FinckeApprovalCard.tsx`, `slashMenu.ts` | Hook | Fincke approval card; floating, sectioned slash menu. |
| `apps/web/src/components/chat/ComposerPendingUserInputPanel.tsx`, `ComposerPrimaryActions.tsx` | none | Hook | The question card owns its step chips, an inline "Something else" answer and Back/Next/Submit (also `ChatComposer.tsx`, `usePendingThreadRequests.ts`, `pendingUserInput.ts`, mobile `PendingUserInputCard.tsx`); the chat box stays a normal composer while a question is open, though attachments still go to the question. Reworks upstream files in place, so expect conflicts on updates. |
| `apps/web/src/components/chat/ComposerFooterControls.tsx` | `PlanModeChip.tsx`, `useFinckeOcean.ts` | Hook | Under Fincke Ocean the plan control is a chip shown only while plan mode is on. |
diff --git a/knip.jsonc b/knip.jsonc
index a72336e626..511f2781a2 100644
--- a/knip.jsonc
+++ b/knip.jsonc
@@ -111,7 +111,11 @@
// UI component modules are copied and adapted as cohesive sets. Keep their
// named subcomponents even before they have callers; the file audit still
// reports an entire component module when nothing imports it.
- "ignoreIssues": { "src/components/ui/*.tsx": ["exports", "nsExports", "duplicates"] },
+ "ignoreIssues": {
+ "src/components/ui/*.tsx": ["exports", "nsExports", "duplicates"],
+ // upstream's chevron helper; the fork's effort chip was its last caller
+ "src/components/chat/ComposerControl.tsx": ["exports"],
+ },
},
"apps/mobile": {
// Expo loads plugins and the fingerprint config by string; Metro embeds the browser entry in the native WebView.
diff --git a/packages/contracts/src/settings.ts b/packages/contracts/src/settings.ts
index e849e9329c..f42a85175e 100644
--- a/packages/contracts/src/settings.ts
+++ b/packages/contracts/src/settings.ts
@@ -359,6 +359,9 @@ export type CodeTheme = typeof CodeTheme.Type;
/** How the composer shows reasoning effort: the level's name, or rising bars. */
export const EffortDisplay = Schema.Literals(["label", "bars"]);
export type EffortDisplay = typeof EffortDisplay.Type;
+/** How the effort popover picks a level: a row of named segments, or a snapping slider. */
+export const EffortControl = Schema.Literals(["segments", "slider"]);
+export type EffortControl = typeof EffortControl.Type;
export const ToolCallVisibility = Schema.Literals(["showAll", "hideSuccessful", "hideAll", "zen"]);
export type ToolCallVisibility = typeof ToolCallVisibility.Type;
@@ -418,6 +421,9 @@ export const ClientSettingsSchema = Schema.Struct({
chatWidth: ChatWidth.pipe(Schema.withDecodingDefault(Effect.succeed("comfortable" as const))),
codeTheme: CodeTheme.pipe(Schema.withDecodingDefault(Effect.succeed("auto" as const))),
effortDisplay: EffortDisplay.pipe(Schema.withDecodingDefault(Effect.succeed("label" as const))),
+ effortControl: EffortControl.pipe(
+ Schema.withDecodingDefault(Effect.succeed("segments" as const)),
+ ),
loadBalancingEnabled: Schema.Boolean.pipe(Schema.withDecodingDefault(Effect.succeed(false))),
loadBalancingWeights: LoadBalancingWeights.pipe(Schema.withDecodingDefault(Effect.succeed({}))),
appearanceContrast: AppearanceContrast.pipe(
@@ -2009,6 +2015,7 @@ export const ClientSettingsPatch = Schema.Struct({
chatWidth: Schema.optionalKey(ChatWidth),
codeTheme: Schema.optionalKey(CodeTheme),
effortDisplay: Schema.optionalKey(EffortDisplay),
+ effortControl: Schema.optionalKey(EffortControl),
loadBalancingEnabled: Schema.optionalKey(Schema.Boolean),
loadBalancingWeights: Schema.optionalKey(LoadBalancingWeights),
appearanceContrast: Schema.optionalKey(AppearanceContrast),
diff --git a/packages/shared/package.json b/packages/shared/package.json
index 1c797f6551..348a2e5b3f 100644
--- a/packages/shared/package.json
+++ b/packages/shared/package.json
@@ -3,6 +3,14 @@
"private": true,
"type": "module",
"exports": {
+ "./fincke-draft-headline": {
+ "types": "./src/fincke-draft-headline.ts",
+ "import": "./src/fincke-draft-headline.ts"
+ },
+ "./fincke-effort-scale": {
+ "types": "./src/fincke-effort-scale.ts",
+ "import": "./src/fincke-effort-scale.ts"
+ },
"./fincke-folder-tint": {
"types": "./src/fincke-folder-tint.ts",
"import": "./src/fincke-folder-tint.ts"
diff --git a/packages/shared/src/fincke-draft-headline.ts b/packages/shared/src/fincke-draft-headline.ts
new file mode 100644
index 0000000000..5b9b72076c
--- /dev/null
+++ b/packages/shared/src/fincke-draft-headline.ts
@@ -0,0 +1,50 @@
+// packages/shared/src/fincke-draft-headline.ts
+// rotating new-thread headlines shared by web and native, one stable pick per draft
+
+/** A project headline split so the project name can sit inline or on its own line. */
+export interface ProjectHeadline {
+ // the question w/o its mark; reads alone as "?" when the name wraps below
+ readonly lead: string;
+ // joins the lead to the project name when they share a line
+ readonly joiner: string;
+}
+
+// the first entry is the original line & the fallback for a draft w/o an id
+const PROJECT_HEADLINES: ReadonlyArray = [
+ { lead: "What should we build", joiner: "in" },
+ { lead: "What are we shipping", joiner: "in" },
+ { lead: "What's next", joiner: "for" },
+ { lead: "Where were we", joiner: "in" },
+ { lead: "What needs fixing", joiner: "in" },
+ { lead: "What's the plan", joiner: "for" },
+ { lead: "What are we breaking", joiner: "in" },
+ { lead: "What could go wrong", joiner: "in" },
+];
+
+const SCRATCH_HEADLINES: ReadonlyArray = [
+ "What should we work on?",
+ "What's on your mind?",
+ "Where should we start?",
+ "What are we figuring out?",
+ "What are we poking at?",
+ "Got a half-baked idea?",
+];
+
+// fnv-1a keeps a draft's line stable across rerenders, reloads & clients
+function pick(lines: ReadonlyArray, draftId: string | null | undefined): T {
+ if (!draftId) return lines[0]!;
+ let hash = 0x811c9dc5;
+ for (let index = 0; index < draftId.length; index += 1) {
+ hash ^= draftId.charCodeAt(index);
+ hash = Math.imul(hash, 0x01000193);
+ }
+ return lines[(hash >>> 0) % lines.length]!;
+}
+
+export function finckeProjectHeadline(draftId: string | null | undefined): ProjectHeadline {
+ return pick(PROJECT_HEADLINES, draftId);
+}
+
+export function finckeScratchHeadline(draftId: string | null | undefined): string {
+ return pick(SCRATCH_HEADLINES, draftId);
+}
diff --git a/packages/shared/src/fincke-effort-scale.ts b/packages/shared/src/fincke-effort-scale.ts
new file mode 100644
index 0000000000..f3f1d8fbc7
--- /dev/null
+++ b/packages/shared/src/fincke-effort-scale.ts
@@ -0,0 +1,32 @@
+// packages/shared/src/fincke-effort-scale.ts
+// the effort chip's level bars, shared by the web picker and the native composer
+
+const ULTRA_LEVEL_IDS: ReadonlySet = new Set(["ultra", "ultracode", "ultrathink"]);
+// a scale that starts at off shows that level as no bars lit
+const OFF_LEVEL_IDS: ReadonlySet = new Set(["off", "none"]);
+
+/** Ultra levels sit above the ordinary scale and get their own treatment instead of bars. */
+export function isFinckeUltraEffort(levelId: string): boolean {
+ return ULTRA_LEVEL_IDS.has(levelId);
+}
+
+/** One bar per ordinary level, lit up to the current one; an unknown level lights none. */
+export function finckeEffortBars(
+ levelIds: ReadonlyArray,
+ currentId: string | null | undefined,
+): { readonly count: number; readonly filled: number } {
+ const ordinary = levelIds.filter((id) => !ULTRA_LEVEL_IDS.has(id));
+ const startsOff = OFF_LEVEL_IDS.has(ordinary[0] ?? "");
+ const index = currentId ? ordinary.indexOf(currentId) : -1;
+ return {
+ count: ordinary.length - (startsOff ? 1 : 0),
+ filled: Math.max(0, index + (startsOff ? 0 : 1)),
+ };
+}
+
+/** Bar heights rising by one whole step, from about half height up to `maxBar`. */
+export function finckeEffortBarHeights(count: number, maxBar: number): number[] {
+ // rounding each bar separately mixes step sizes, so round the step once
+ const step = Math.max(1, Math.round(maxBar / 2 / Math.max(count - 1, 1)));
+ return Array.from({ length: count }, (_, index) => maxBar - (count - 1 - index) * step);
+}