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(settings): ContentPolicySettings.tsx uebernimmt Webs Wortlaut fuer Hinweise (R5-4, R5-5, R5-6)

purple2a921a181921
diff --git a/src/components/settings/ContentPolicySettings.tsx b/src/components/settings/ContentPolicySettings.tsx
index 708ac5da..99ae063f 100644
--- a/src/components/settings/ContentPolicySettings.tsx
+++ b/src/components/settings/ContentPolicySettings.tsx
@@ -8,17 +8,22 @@ import { primeContentPolicyCache } from '../../hooks/useContentPolicy'
* Der Zusatz am Off-Hinweis haengt am Schalter des Servers. Ein Satz, der eine
* Bestaetigung ankuendigt, die nicht mehr kommt, verspricht genau das, was die
* Oberflaeche nicht mehr tut. Gleicher Bau wie im Web.
+ *
+ * Wortlaut (R5-5, R5-6): identisch mit apps/web/components/settings/
+ * ContentPolicySettings.tsx, ein Wortlaut ist besser als zwei. Das Wort
+ * "filter" bleibt hier erlaubt, anders als in der oeffentlichen Doku unter
+ * docs/: die Regel gegen das Wort gilt der Zahlungsdomain, nicht dieser App.
*/
function options(bestaetigungNoetig: boolean): { value: ContentPolicy; label: string; hint: string }[] {
return [
- { value: 'strict', label: 'Strict', hint: 'The tightest filter we have. Choose this if others use your screen.' },
+ { value: 'strict', label: 'Strict', hint: 'The strictest setting we have. Choose this if others use your screen.' },
{ value: 'soft', label: 'Standard', hint: 'The default for every account.' },
{
value: 'off',
label: 'Off',
hint: bestaetigungNoetig
- ? 'No filter beyond the legal limits below. Requires an age confirmation.'
- : 'No filter beyond the legal limits below.',
+ ? 'Only the legal limits below apply. Requires an age confirmation.'
+ : 'Only the legal limits below apply.',
},
]
}
@@ -110,8 +115,11 @@ export function ContentPolicySettings() {
return (
<div className="space-y-2" data-testid="content-policy">
<p className="text-[0.6rem] text-gray-500 leading-relaxed">
- Applies to images and video rendered in the cloud. Text is unaffected, and nothing on
- your own machine is.
+ {/* R5-4: Web-Wortlaut fuer die ersten beiden Saetze, der dritte ist ein
+ Desktop-Zusatz, den es im Web nicht braucht, weil dort nichts
+ lokal rendert. */}
+ Applies to images and video generated in the cloud. Text is unaffected. Nothing on your
+ own machine is affected.
</p>
{options(requiresAge).map((o) => (
diff --git a/src/components/settings/__tests__/content-policy-wording-parity.test.ts b/src/components/settings/__tests__/content-policy-wording-parity.test.ts
new file mode 100644
index 00000000..c159dab2
--- /dev/null
+++ b/src/components/settings/__tests__/content-policy-wording-parity.test.ts
@@ -0,0 +1,88 @@
+/**
+ * R5-4, R5-5, R5-6 — ContentPolicySettings.tsx had drifted from the Web
+ * wording in three spots: the "strict" and "off" hints (R5-5, R5-6) and the
+ * footnote about what the setting covers (R5-4). One wording is better than
+ * two for the two hints that mean the same thing on both sides; the footnote
+ * differs on purpose, since Desktop also renders locally and Web does not.
+ *
+ * This reads the SOURCE of both files rather than importing Web's component
+ * (which is a Next.js file the desktop bundle cannot import), matching the
+ * fixliste's "string comparison" test shape.
+ *
+ * Deliberately does NOT check this file against PUBLIC_FILTER_WORDS: that
+ * guard belongs to the public marketing site on the payment domain
+ * (locallyuncensored.com), not to this signed-in-only account setting. The
+ * word "filter" stays allowed here.
+ *
+ * Run: npx vitest run src/components/settings/__tests__/content-policy-wording-parity.test.ts
+ */
+import { describe, it, expect } from 'vitest'
+import { readFileSync } from 'node:fs'
+import { resolve } from 'node:path'
+
+const DESKTOP_SRC = readFileSync(resolve(__dirname, '../ContentPolicySettings.tsx'), 'utf8')
+
+// The web repo lives as a sibling checkout next to this one, same as the
+// safety.ts parity work for R5-9. Read-only reference, never imported.
+const WEB_PATH = resolve(
+ __dirname,
+ '../../../../../../lu-300-web/apps/web/components/settings/ContentPolicySettings.tsx',
+)
+const WEB_SRC = readFileSync(WEB_PATH, 'utf8')
+
+describe('R5-5, R5-6: the strict and off hints match Web word for word', () => {
+ it('the "strict" hint is identical', () => {
+ const hint = "The strictest setting we have. Choose this if others use your screen."
+ expect(DESKTOP_SRC).toContain(hint)
+ expect(WEB_SRC).toContain(hint)
+ })
+
+ it('the "off" hint (both branches) is identical', () => {
+ for (const hint of [
+ 'Only the legal limits below apply. Requires an age confirmation.',
+ 'Only the legal limits below apply.',
+ ]) {
+ expect(DESKTOP_SRC).toContain(hint)
+ expect(WEB_SRC).toContain(hint)
+ }
+ })
+
+ it('NEGATIVE CONTROL: the old, drifted wording is gone from Desktop', () => {
+ expect(DESKTOP_SRC).not.toContain('The tightest filter we have')
+ expect(DESKTOP_SRC).not.toContain('No filter beyond the legal limits below')
+ })
+
+ it('does not police this settings file against the marketing site word list', () => {
+ // PUBLIC_FILTER_WORDS is a public-copy guard for the payment domain. This
+ // file is a signed-in account setting, not public marketing copy, and
+ // "filter" (as in "Standard filter") is fine to use here.
+ expect(DESKTOP_SRC).toMatch(/filter/i)
+ })
+})
+
+describe('R5-4: the footnote keeps Web wording for its first two sentences', () => {
+ const sharedPrefix = 'Applies to images and video generated in the cloud. Text is unaffected.'
+
+ it('Desktop carries the shared prefix plus its own local-machine sentence', () => {
+ expect(DESKTOP_SRC).toContain(sharedPrefix)
+ // The JSX text wraps across two source lines; normalise whitespace before
+ // comparing so the test does not depend on exactly where the wrap falls.
+ expect(DESKTOP_SRC.replace(/\s+/g, ' ')).toContain('Nothing on your own machine is affected.')
+ })
+
+ it('Web carries the same shared prefix', () => {
+ expect(WEB_SRC).toContain(sharedPrefix)
+ })
+
+ it('NEGATIVE CONTROL: the Desktop-only sentence does not appear in Web', () => {
+ // Web has no local backend at all, so this addition is Desktop-specific
+ // and must stay that way.
+ expect(WEB_SRC).not.toContain('Nothing on your own machine is affected')
+ expect(WEB_SRC).not.toContain('own machine')
+ })
+
+ it('NEGATIVE CONTROL: the old, drifted footnote wording is gone from Desktop', () => {
+ expect(DESKTOP_SRC).not.toContain('rendered in the cloud')
+ expect(DESKTOP_SRC.replace(/\s+/g, ' ')).not.toContain('and nothing on your own machine is.')
+ })
+})