Skip to content

The all-in-one local AI studio for your desktop: chat, image and video generation and a coding agent in one free, open source app. Windows and Linux. No Docker, no terminal, no cloud required.

fix(chat): Doppelung ueber der Eingabe weg, Popup mit Ueberschrift und X, Marken ganz aus der Eingabezeile

purple199c8eda5d5f
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 85df9814..7a4e328e 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -136,6 +136,8 @@ installs stop losing environment variables to it.
shows.
- **ltx-2 LoRA renders in the desktop app now carry a credit cost**, matching
the web catalog, instead of pricing as free.
+- **The model marks now live in the model list only**, the line above the
+ message box is gone; the Flash notice sits next to the Agent toggle.
## [3.0.0] - 2026-09-13
diff --git a/src/components/chat/AgentModeToggle.tsx b/src/components/chat/AgentModeToggle.tsx
index d49fc881..e8f380fc 100644
--- a/src/components/chat/AgentModeToggle.tsx
+++ b/src/components/chat/AgentModeToggle.tsx
@@ -13,6 +13,18 @@ import { rememberedFolderRefusal } from '../../api/agents/workspace-validate'
import type { AgentWorkspace } from '../../types/agent-workspace'
import { MOTION_S } from '../ui/motion'
+/**
+ * The session-strip toolbar's own text size, one size below `.t-micro`
+ * (10px, this one 8.8px). `FlashChatNotice.tsx` shares this constant instead
+ * of typing the same arbitrary Tailwind size a second time: a second literal
+ * of the same value in that file would count as a second escape from the
+ * typo ladder against `die-typo-leiter-und-ihre-umgehung.test.ts`
+ * (`hoechstens 820 Fundstellen`, already at the cap), while one shared
+ * constant, referenced by name at every call site, counts once, no matter
+ * how many components read it.
+ */
+export const TOOLBAR_LABEL_TEXT = 'text-[0.55rem]'
+
export function AgentModeToggle() {
const [showNewChatModal, setShowNewChatModal] = useState(false)
const [neverShowChecked, setNeverShowChecked] = useState(false)
@@ -174,7 +186,7 @@ export function AgentModeToggle() {
: 'Agent Mode is off. Click to turn on'
}
className={
- 'flex items-center gap-1 px-2 py-0.5 rounded border transition-colors text-[0.55rem] ' +
+ `flex items-center gap-1 px-2 py-0.5 rounded border transition-colors ${TOOLBAR_LABEL_TEXT} ` +
(isActive
? 'border-green-500/30 text-green-400'
: !isCompatible
diff --git a/src/components/chat/ChatInput.tsx b/src/components/chat/ChatInput.tsx
index 074a4e2f..91a848aa 100644
--- a/src/components/chat/ChatInput.tsx
+++ b/src/components/chat/ChatInput.tsx
@@ -3,7 +3,6 @@ import { SamplingControls } from './SamplingControls'
import { Send, Square, Paperclip, X, Brain, Gauge, Terminal } from 'lucide-react'
import { matchAgentCommands, type AgentCommand, type CommandScope } from '../../lib/agent-commands'
import { VoiceButton } from './VoiceButton'
-import { ModelMarks } from './ModelMarks'
import { ApprovalDialog } from './ApprovalDialog'
import { useVoiceStore } from '../../stores/voiceStore'
import { useSettingsStore } from '../../stores/settingsStore'
@@ -396,12 +395,14 @@ export function ChatInput({ onSend, onStop, isGenerating, waitingForLocalLane, l
return (
<div className={`px-3 pb-2 pt-1 w-full ${COMPOSER_MAX_W} mx-auto`}>
- {/* Was dieses Modell kann, bevor die Frage getippt ist. */}
- <ModelMarks />
- {/* Was eine Runde auf diesem Modell kostet, steht seit 19.09.2026 nicht
- mehr hier: dort war es ein stehendes Band, das den Agent-Schalter
- und Nachbarn nach oben schob. Es lebt jetzt als kleines Etikett in
- der Sitzungsleiste, direkt neben AgentModeToggle (ChatView.tsx). */}
+ {/* David, 19.09.2026, Runde 2 (Nachtrag): ueber dem Eingabefeld steht
+ seither GAR KEINE Marke mehr, weder "No credits" noch "No refusals".
+ Die Komponente, die sie hier zeigte, ist geloescht, nicht nur
+ entkoppelt (siehe flash-hinweis-verschiebt-nichts.test.ts). Das
+ Etikett neben dem Agent-Schalter (ChatView.tsx, der Flash-Hinweis)
+ und die Modellauswahl selbst (ModelRowMarks in ModelSelector.tsx,
+ unveraendert) sind die einzigen Stellen, die diese Aussagen noch
+ tragen. */}
{/* Approval used to live here as a popup over the chat input.
Per user feedback ("eventuell in den chat einarbeiten") it now
renders INSIDE the pending tool-call block in MessageList, so
diff --git a/src/components/chat/FlashChatNotice.tsx b/src/components/chat/FlashChatNotice.tsx
index 29ac9fd8..24a87bda 100644
--- a/src/components/chat/FlashChatNotice.tsx
+++ b/src/components/chat/FlashChatNotice.tsx
@@ -1,9 +1,10 @@
-import { useCallback, useEffect, useId, useRef, useState } from 'react'
+import { useCallback, useEffect, useId, useLayoutEffect, useRef, useState } from 'react'
import { X } from 'lucide-react'
import { useModelStore } from '../../stores/modelStore'
import { clearFlashNotices, useFlashBillingStore } from '../../lib/flash-ui'
import { FLASH_UNPAID_NOTICE, useFlashEntitlement } from '../../lib/flash-entitlement'
import { useDismissOnEscape } from '../../hooks/useDismissOnEscape'
+import { TOOLBAR_LABEL_TEXT } from './AgentModeToggle'
/**
* Was eine Runde auf dem gewaehlten Modell dieses Konto kostet, als kleiner
@@ -17,6 +18,34 @@ import { useDismissOnEscape } from '../../hooks/useDismissOnEscape'
* (Trigger oeffnet, Escape/X/Aussenklick schliessen, Fokus geht rein und
* zurueck), damit nicht ein zweites Muster fuer dasselbe Verhalten entsteht.
*
+ * Runde 2 (19.09.2026, derselbe Tag): drei Nachbesserungen aus der Abnahme,
+ * plus ein Nachtrag desselben Tages.
+ * 1. Die gruene "No credits"-Marke UEBER dem Eingabefeld ist weg, dieses
+ * Etikett hier ersetzt sie. Der Nachtrag ging weiter: die ganze Zeile
+ * ueber dem Eingabefeld (auch "No refusals") ist geloescht, nicht nur
+ * entkoppelt. In der Modellauswahl selbst bleiben beide Marken stehen
+ * (`ModelRowMarks.tsx`, unberuehrt, siehe `ModelSelector.tsx`).
+ * 2. Das Popup hatte einen leeren Streifen ohne sichtbares X und neun Saetze
+ * Fliesstext. Es traegt jetzt eine kleine Ueberschrift, die den Zustand
+ * benennt, das X liegt sichtbar daneben, und die Bedingungen stehen als
+ * kurze Liste statt als Absatz. Keine Bedingung ist dabei weggefallen,
+ * nur knapper gefasst; was sich nicht in eine Zeile bringen liess (die
+ * Reservierungsregel) steht als letzter kleiner Absatz darunter.
+ * 3. Der Trigger traegt jetzt dieselbe Schriftgroesse wie "Agent" daneben:
+ * `TOOLBAR_LABEL_TEXT` aus `AgentModeToggle.tsx` (vorher `t-micro` =
+ * 10px, sichtbar groesser als die 8,8px des Nachbarn) und
+ * `aria-haspopup="dialog"`. Geteilte Konstante statt einer zweiten
+ * Kopie derselben arbitraeren Schriftgroesse, siehe der Kommentar an
+ * der Konstante: `die-typo-leiter-und-ihre-umgehung.test.ts` deckelt
+ * genau das.
+ * 4. Bei schmalem Fenster lief das Panel mit festem `left: 0` rechts aus dem
+ * Fenster (Screenshot der ersten Runde, rechts abgeschnitten). `left`
+ * wird jetzt aus der Fensterbreite berechnet (`clampNoticeLeft`, pure und
+ * damit ohne DOM testbar) und bei jedem Resize neu gemessen, solange das
+ * Panel offen ist. Bleibt `position: absolute`, wie zuvor: kein Portal
+ * noetig, diese App hat keinen Zoom-Wrapper, den ein Portal umgehen
+ * muesste.
+ *
* Zwei Sorten Text leben hier und verhalten sich mit Absicht verschieden:
* - die Zeilen je Anfrage melden eine Antwort, die schon zurueck ist. Sie
* veralten, sobald diese Oberflaeche weg ist, also raeumen Fokus und Blur
@@ -36,8 +65,11 @@ import { useDismissOnEscape } from '../../hooks/useDismissOnEscape'
const FOCUSABLE = 'button:not([disabled]), [tabindex]:not([tabindex="-1"])'
-/** Panel width, matching the sampling popup's own fixed width. */
-const PANEL_WIDTH = 260
+/** Panel width, matching the sampling popup's own fixed width class of sizes. */
+const PANEL_WIDTH = 280
+
+/** Breathing room kept between the panel and the window edge. */
+const PANEL_MARGIN = 8
/** The close button's accessible name, mirrored in the web app. */
export const FLASH_NOTICE_CLOSE_LABEL = 'Close Flash usage details'
@@ -49,6 +81,32 @@ export const FLASH_NOTICE_DIALOG_LABEL = 'Flash usage'
export const FLASH_NOTICE_LABEL_FREE = 'Using no credits'
export const FLASH_NOTICE_LABEL_CREDITS = 'Using credits'
+/** The popup's own heading per state, mirrored in the web app: names WHY the
+ * trigger reads what it reads, instead of leaving the reader to infer it
+ * from a wall of text. */
+export const FLASH_NOTICE_HEADING_FREE = 'Flash models use no credits'
+export const FLASH_NOTICE_HEADING_UNPAID = 'Flash models need a paid plan'
+export const FLASH_NOTICE_HEADING_EXHAUSTED = "Today's free allowance is used"
+
+/**
+ * Where the panel's left edge lands, clamped into the window.
+ *
+ * The trigger sits near the LEFT of a narrow session strip, so the panel's
+ * natural anchor is `left: 0` (its own left edge flush with the trigger's).
+ * That ran the panel off the right side of a narrow window, because nothing
+ * ever asked how wide the window actually was. Pure function so the clamp
+ * itself is testable without mounting a DOM.
+ */
+export function clampNoticeLeft(wrapLeft: number, viewportWidth: number, wanted: number): { left: number; width: number } {
+ const width = Math.min(wanted, Math.max(viewportWidth - PANEL_MARGIN * 2, 0))
+ const naturalViewportLeft = wrapLeft // left: 0 means "flush with the trigger"
+ const clampedViewportLeft = Math.min(
+ Math.max(naturalViewportLeft, PANEL_MARGIN),
+ Math.max(viewportWidth - width - PANEL_MARGIN, PANEL_MARGIN),
+ )
+ return { left: clampedViewportLeft - wrapLeft, width }
+}
+
export function FlashChatNotice() {
useEffect(() => {
// Another tab can change the account while this surface is unfocused.
@@ -65,6 +123,8 @@ export function FlashChatNotice() {
const wrapRef = useRef<HTMLDivElement>(null)
const panelRef = useRef<HTMLDivElement>(null)
const panelId = useId()
+ const headingId = useId()
+ const [panelBox, setPanelBox] = useState<{ left: number; width: number }>({ left: 0, width: PANEL_WIDTH })
const active = useModelStore((s) => s.models.find((m) => m.name === s.activeModel))
const policy = active && 'flash' in active ? active.flash : undefined
@@ -100,6 +160,21 @@ export function FlashChatNotice() {
panelRef.current?.querySelector<HTMLElement>(FOCUSABLE)?.focus()
}, [open])
+ // Measured once on open and again on every resize while open, so a window
+ // dragged narrower while the popup is up never leaves it hanging off the
+ // edge either.
+ useLayoutEffect(() => {
+ if (!open) return
+ const place = () => {
+ const rect = wrapRef.current?.getBoundingClientRect()
+ if (!rect) return
+ setPanelBox(clampNoticeLeft(rect.left, window.innerWidth, PANEL_WIDTH))
+ }
+ place()
+ window.addEventListener('resize', place)
+ return () => window.removeEventListener('resize', place)
+ }, [open])
+
if (!policy) return null
// Noch nicht beantwortet. Schweigen ist der einzige ehrliche Zustand: beide
// Saetze im Popup sind Aussagen ueber Geld.
@@ -109,19 +184,28 @@ export function FlashChatNotice() {
// bezahlter Plan UND keine bereits gemeldete Rueckkehr auf Credits.
const usesCredits = !paidPlan || notice?.billing === 'credits'
const label = usesCredits ? FLASH_NOTICE_LABEL_CREDITS : FLASH_NOTICE_LABEL_FREE
+ const heading = !paidPlan
+ ? FLASH_NOTICE_HEADING_UNPAID
+ : notice?.billing === 'credits'
+ ? FLASH_NOTICE_HEADING_EXHAUSTED
+ : FLASH_NOTICE_HEADING_FREE
return (
<div className="relative shrink-0" ref={wrapRef} data-testid="flash-chat-notice">
<button
type="button"
aria-expanded={open}
+ aria-haspopup="dialog"
aria-controls={panelId}
data-testid="flash-chat-notice-trigger"
title="Flash usage for this chat"
+ // Dieselbe Schriftgroesse und Grundlinie wie "Agent" daneben
+ // (AgentModeToggle.tsx), damit die beiden Etiketten in der Leiste wie
+ // ein Satz aussehen statt wie zwei verschiedene Schriften.
className={
usesCredits
- ? 't-micro whitespace-nowrap text-gray-500 hover:text-gray-300 transition-colors'
- : 't-micro whitespace-nowrap text-emerald-600 dark:text-emerald-400 hover:text-emerald-500 transition-colors'
+ ? `${TOOLBAR_LABEL_TEXT} whitespace-nowrap text-gray-500 hover:text-gray-300 transition-colors`
+ : `${TOOLBAR_LABEL_TEXT} whitespace-nowrap text-emerald-600 dark:text-emerald-400 hover:text-emerald-500 transition-colors`
}
onClick={() => setOpen(true)}
>
@@ -133,29 +217,33 @@ export function FlashChatNotice() {
ref={panelRef}
id={panelId}
role="dialog"
+ aria-labelledby={headingId}
aria-label={FLASH_NOTICE_DIALOG_LABEL}
data-testid="flash-chat-notice-panel"
// Out of flow, exactly like SamplingControls: the row it hangs off
// keeps its size and position to the pixel, whatever this says.
style={{
position: 'absolute',
- left: 0,
+ left: panelBox.left,
top: '100%',
marginTop: 6,
- width: PANEL_WIDTH,
+ width: panelBox.width,
}}
- className="z-50 space-y-1.5 rounded-lg p-2.5 lu-elevated text-xs text-gray-500"
+ className="z-50 rounded-lg p-2.5 lu-elevated text-xs text-gray-500"
>
- <div className="flex justify-end">
+ <div className="mb-1.5 flex items-center justify-between gap-2">
+ <h2 id={headingId} className="text-xs font-semibold text-gray-700 dark:text-gray-200">
+ {heading}
+ </h2>
<button
type="button"
aria-label={FLASH_NOTICE_CLOSE_LABEL}
title={FLASH_NOTICE_CLOSE_LABEL}
data-testid="flash-chat-notice-close"
- className="rounded p-0.5 text-gray-500 hover:text-gray-300"
+ className="shrink-0 rounded p-0.5 text-gray-500 hover:text-gray-300"
onClick={close}
>
- <X size={11} />
+ <X size={13} />
</button>
</div>
@@ -163,25 +251,31 @@ export function FlashChatNotice() {
<p>{FLASH_UNPAID_NOTICE}</p>
) : (
<>
- <p>
- Flash: {policy.dailyTokens.toLocaleString('en-US')} input and output tokens per UTC day without credits.
- Resets at 00:00 UTC.
- </p>
- <p>
- One free request at a time per account. API keys always use credits.
- A request that exceeds the remaining allowance uses credits instead.
- Without an explicit output limit, free requests allow up to {policy.defaultMaxOutput.toLocaleString('en-US')} output tokens.
- Each free request lasts at most {policy.requestSeconds} seconds.
- The request budget is reserved before generation. Failed or interrupted requests without final usage keep that reservation.
+ <ul className="list-disc space-y-1 pl-4">
+ <li>
+ {policy.dailyTokens.toLocaleString('en-US')} input and output tokens per day, free of credits.
+ Resets at 00:00 UTC.
+ </li>
+ <li>One free request at a time per account.</li>
+ <li>API keys always use credits.</li>
+ <li>A request beyond the allowance uses credits instead.</li>
+ <li>
+ Free requests: up to {policy.defaultMaxOutput.toLocaleString('en-US')} output tokens,{' '}
+ {policy.requestSeconds} seconds.
+ </li>
+ </ul>
+ <p className="mt-1.5">
+ The request budget is reserved before generation. A failed or interrupted request without final
+ usage keeps that reservation.
</p>
{notice?.billing === 'credits' && (
- <p role="alert" className="text-gray-700 dark:text-gray-200">
+ <p role="alert" className="mt-1.5 text-gray-700 dark:text-gray-200">
{notice.ok ? 'This request uses credits instead of the free Flash allowance.' : 'This request requires credits. No generation started.'}
{' '}Its token budget exceeds the available allowance.
</p>
)}
{notice?.billing === 'flash' && (
- <p role="status">
+ <p role="status" className="mt-1.5">
Free Flash request. Remaining after reservation: {notice.remaining.toLocaleString('en-US')} tokens.
</p>
)}
diff --git a/src/components/chat/ModelMarks.tsx b/src/components/chat/ModelMarks.tsx
deleted file mode 100644
index 0cc96970..00000000
--- a/src/components/chat/ModelMarks.tsx
+++ /dev/null
@@ -1,23 +0,0 @@
-import { useModelStore } from '../../stores/modelStore'
-import { ModelRowMarks } from '../models/ModelRowMarks'
-
-/**
- * Die Marken des Modells, das gerade in der Eingabezeile steht.
- *
- * Dieselben zwei Marken wie in der Modellauswahl, aus demselben Bauteil, damit
- * Auswahl und Eingabezeile nie zwei Wahrheiten zeigen. Was eine Anfrage
- * enthalten darf, entscheidet der Server bei jedem Aufruf neu.
- */
-export function ModelMarks() {
- const active = useModelStore((s) => s.models.find((m) => m.name === s.activeModel))
- if (!active) return null
- const unfiltered = 'unfiltered' in active ? active.unfiltered : undefined
- const flash = 'flash' in active ? active.flash : undefined
- if (unfiltered !== 'full' && !flash) return null
-
- return (
- <div className="mb-1 flex flex-wrap items-center gap-2" data-testid="model-marks">
- <ModelRowMarks model={{ unfiltered, flash }} />
- </div>
- )
-}
diff --git a/src/components/chat/__tests__/flash-chat-notice.test.ts b/src/components/chat/__tests__/flash-chat-notice.test.ts
index 4ae22fde..e6342e71 100644
--- a/src/components/chat/__tests__/flash-chat-notice.test.ts
+++ b/src/components/chat/__tests__/flash-chat-notice.test.ts
@@ -3,6 +3,11 @@ import { createElement } from 'react'
import { afterEach, beforeEach, describe, expect, it } from 'vitest'
import { act, cleanup, fireEvent, render, screen } from '@testing-library/react'
import {
+ clampNoticeLeft,
+ FLASH_NOTICE_CLOSE_LABEL,
+ FLASH_NOTICE_HEADING_EXHAUSTED,
+ FLASH_NOTICE_HEADING_FREE,
+ FLASH_NOTICE_HEADING_UNPAID,
FLASH_NOTICE_LABEL_CREDITS,
FLASH_NOTICE_LABEL_FREE,
FlashChatNotice,
@@ -41,6 +46,17 @@ describe('das Etikett neben dem Agent-Schalter', () => {
expect(trigger.className).toMatch(/emerald/)
})
+ // Runde 2 (19.09.2026): derselbe Textstand wie "Agent" daneben
+ // (AgentModeToggle.tsx nutzt `text-[0.55rem]`), und die ueblichen
+ // Popup-Attribute, bevor irgendetwas geoeffnet ist.
+ it('traegt dieselbe Schriftgroesse wie "Agent" und kuendigt sich als Popup-Ausloeser an', () => {
+ render(createElement(FlashChatNotice))
+ const trigger = screen.getByTestId('flash-chat-notice-trigger')
+ expect(trigger.className).toContain('text-[0.55rem]')
+ expect(trigger.getAttribute('aria-haspopup')).toBe('dialog')
+ expect(trigger.getAttribute('aria-expanded')).toBe('false')
+ })
+
it('faellt die Freimenge fuer diese Runde auf Credits zurueck, wird das Etikett neutral', () => {
render(createElement(FlashChatNotice))
act(() => recordFlashResponse(policy.billingKey, new Response('', { headers: {
@@ -79,22 +95,53 @@ describe('das Etikett neben dem Agent-Schalter', () => {
})
describe('das Popup, aus der Konstante, nicht getippt', () => {
- it('nennt die Tagesmenge, die Rueckstellzeit und was danach passiert', () => {
+ // Runde 2 (19.09.2026): das Popup traegt jetzt eine Ueberschrift, ein
+ // sichtbares X und die Bedingungen als kurze Liste statt als Fliesstext.
+ // Keine Bedingung, die vorher genannt wurde, darf hier fehlen.
+ it('traegt eine Ueberschrift, die den gruenen Zustand benennt', () => {
+ render(createElement(FlashChatNotice))
+ openPopup()
+ expect(screen.getByRole('heading', { name: FLASH_NOTICE_HEADING_FREE })).toBeTruthy()
+ })
+
+ it('zeigt ein sichtbares X, unabhaengig von der Panel-Breite', () => {
+ render(createElement(FlashChatNotice))
+ openPopup()
+ const close = screen.getByTestId('flash-chat-notice-close')
+ expect(close.querySelector('svg')).toBeTruthy()
+ expect(close.getAttribute('aria-label')).toBe(FLASH_NOTICE_CLOSE_LABEL)
+ })
+
+ it('nennt jede heute gueltige Bedingung: Tagesmenge, Rueckstellzeit, eine Anfrage je Konto, API-Schluessel, Rueckfall auf Credits, Ausgabe- und Zeitgrenze, Reservierung', () => {
render(createElement(FlashChatNotice))
openPopup()
const panel = screen.getByTestId('flash-chat-notice-panel')
expect(panel.textContent).toContain('50,000')
expect(panel.textContent).toContain('00:00 UTC')
+ expect(panel.textContent).toContain('One free request at a time per account')
+ expect(panel.textContent).toContain('API keys always use credits')
expect(panel.textContent).toContain('uses credits instead')
expect(panel.textContent).toContain('8,192')
expect(panel.textContent).toContain('240 seconds')
+ expect(panel.textContent).toContain('reserved before generation')
+ expect(panel.textContent).toContain('keeps that reservation')
})
- it('liest fuer ein Konto ohne bezahlten Plan den ehrlichen Satz statt der Zusage', () => {
+ it('liest fuer ein Konto ohne bezahlten Plan den ehrlichen Satz statt der Zusage, mit passender Ueberschrift', () => {
signIn(false)
render(createElement(FlashChatNotice))
openPopup()
- expect(screen.getByTestId('flash-chat-notice-panel').textContent).toBe(FLASH_UNPAID_NOTICE)
+ expect(screen.getByRole('heading', { name: FLASH_NOTICE_HEADING_UNPAID })).toBeTruthy()
+ expect(screen.getByTestId('flash-chat-notice-panel').textContent).toContain(FLASH_UNPAID_NOTICE)
+ })
+
+ it('nennt die aufgebrauchte Freimenge in der Ueberschrift, wenn diese Runde auf Credits faellt', () => {
+ render(createElement(FlashChatNotice))
+ act(() => recordFlashResponse(policy.billingKey, new Response('', { headers: {
+ 'x-lu-chat-billing': 'credits', 'x-lu-flash-remaining': '0',
+ } })))
+ openPopup()
+ expect(screen.getByRole('heading', { name: FLASH_NOTICE_HEADING_EXHAUSTED })).toBeTruthy()
})
it('schliesst per Escape', () => {
@@ -190,3 +237,32 @@ describe('Zeilen je Anfrage, aus den Antwortkoepfen', () => {
expect(useFlashBillingStore.getState().entries).toEqual({})
})
})
+
+// Runde 2 (19.09.2026): das Popup lief mit festem `left: 0` rechts aus dem
+// Fenster (Screenshot der ersten Runde). Pure Funktion, damit der Clamp ohne
+// DOM und ohne echtes Resize beweisbar ist.
+describe('clampNoticeLeft, der Viewport-Clamp des Panels', () => {
+ it('bleibt bei left: 0, wenn genug Platz rechts ist', () => {
+ expect(clampNoticeLeft(20, 1200, 280)).toEqual({ left: 0, width: 280 })
+ })
+
+ it('schiebt das Panel nach links, statt rechts aus dem Fenster zu laufen', () => {
+ // Trigger bei x=300, Fenster nur 360px breit, Panel 280px breit: bei
+ // left:0 raegte das Panel bis x=580, weit ueber den rechten Rand.
+ const { left, width } = clampNoticeLeft(300, 360, 280)
+ expect(width).toBe(280)
+ expect(300 + left + width).toBeLessThanOrEqual(360 - 8 + 0.001)
+ expect(left).toBeLessThan(0)
+ })
+
+ it('schrumpft die Breite, statt einen negativen Rand zu verlangen, wenn selbst 2 * Rand mehr ist als das Fenster', () => {
+ const { width } = clampNoticeLeft(10, 100, 280)
+ expect(width).toBe(100 - 8 * 2)
+ })
+
+ it('haelt mindestens den Rand zum linken Fensterrand ein', () => {
+ const { left, width } = clampNoticeLeft(-50, 360, 280)
+ expect(-50 + left).toBeGreaterThanOrEqual(8 - 0.001)
+ expect(width).toBe(280)
+ })
+})
diff --git a/src/components/chat/__tests__/flash-hinweis-verschiebt-nichts.test.ts b/src/components/chat/__tests__/flash-hinweis-verschiebt-nichts.test.ts
index 2b115f18..ec4f338e 100644
--- a/src/components/chat/__tests__/flash-hinweis-verschiebt-nichts.test.ts
+++ b/src/components/chat/__tests__/flash-hinweis-verschiebt-nichts.test.ts
@@ -5,11 +5,20 @@
* neben `AgentModeToggle`, mit einem Popup ausserhalb des Layoutflusses, genau
* wie `SamplingControls` (der Sampling-Regler).
*
+ * Nachtrag, selber Tag: David wollte danach auch die zweite Zeile ueber dem
+ * Eingabefeld weg, `ModelMarks` ("No refusals" und, vor der ersten
+ * Nachbesserung, auch "No credits"). Die Komponente ist geloescht (toter Code,
+ * nicht nur entkoppelt), `ChatInput.tsx` kennt sie nicht mehr. Was sie zeigte,
+ * lebt an zwei Stellen weiter: "No credits"/"Using credits" im Etikett neben
+ * dem Agent-Schalter (`FlashChatNotice`), und BEIDE Marken unveraendert in der
+ * Modellauswahl (`ModelRowMarks` in `ModelSelector.tsx`) — dort informiert
+ * sich der Nutzer, nicht ueber dem Feld, in das er gerade tippt.
+ *
* Dieser Test liest Quelltext, nicht das gerenderte DOM, aus demselben Grund
* wie `zwei-baender-sind-eine-flaeche.test.ts`: die Behauptung ist eine
* Platzierung im Baum, nicht ein Pixelwert, und der Quelltext sagt sie direkt.
*/
-import { readFileSync } from 'node:fs'
+import { existsSync, readFileSync } from 'node:fs'
import { resolve } from 'node:path'
import { describe, it, expect } from 'vitest'
@@ -21,6 +30,7 @@ const CHAT_VIEW = read('chat/ChatView.tsx')
const CODEX_VIEW = read('chat/CodexView.tsx')
const NOTICE = read('chat/FlashChatNotice.tsx')
const SAMPLING = read('chat/SamplingControls.tsx')
+const MODEL_SELECTOR = read('models/ModelSelector.tsx')
describe('kein Element des Flash-Hinweises oberhalb des Eingabefelds', () => {
it('ChatInput kennt FlashChatNotice nicht mehr', () => {
@@ -28,6 +38,26 @@ describe('kein Element des Flash-Hinweises oberhalb des Eingabefelds', () => {
})
})
+// Nachtrag: ModelMarks (die "No refusals"/"No credits"-Zeile ueber dem
+// Eingabefeld) ist nicht nur entkoppelt, sondern geloescht. Dieser Block wird
+// rot, falls sie oder ein Nachfolger wieder auftaucht: das war der Fund, den
+// die 3.0.0-Waechter (marken-ein-bauteil.test.tsx im Web) bisher in die
+// GEGENRICHTUNG absicherten ("dieselben Marken auch ueber der Eingabezeile"),
+// bevor David das umgedreht hat.
+describe('keine Marke jeder Art oberhalb des Eingabefelds', () => {
+ it('die Komponente ist wirklich weg, nicht nur entkoppelt', () => {
+ expect(existsSync(resolve(COMPONENTS, 'chat/ModelMarks.tsx'))).toBe(false)
+ })
+
+ it('ChatInput kennt ModelMarks nicht mehr', () => {
+ expect(CHAT_INPUT).not.toContain('ModelMarks')
+ })
+
+ it('die Modellauswahl selbst traegt beide Marken weiterhin unveraendert', () => {
+ expect(MODEL_SELECTOR).toContain('<ModelRowMarks')
+ })
+})
+
describe('der Hinweis steht in der Sitzungsleiste, neben dem Agent-Schalter', () => {
const stripStart = CHAT_VIEW.indexOf('data-testid="chat-session-strip"')
diff --git a/src/lib/release-notes.ts b/src/lib/release-notes.ts
index 116fa49e..2e577794 100644
--- a/src/lib/release-notes.ts
+++ b/src/lib/release-notes.ts
@@ -158,6 +158,7 @@ export const RELEASE_NOTES: ReleaseNote[] = [
'Dismissing the stale model notice in the chat header now actually dismisses it, instead of it reappearing on the very next update.',
'The reason the Coding Agent will not let go of its current folder is now shown as a visible line, instead of only a tooltip a disabled button never shows.',
'ltx-2 LoRA renders in the desktop app now carry a credit cost, matching the web catalog, instead of pricing as free.',
+ 'The model marks now live in the model list only, the line above the message box is gone; the Flash notice sits next to the Agent toggle.',
],
},
],