Skip to content

Commit 2d6bdf9

Browse files
committed
frontend/settings: move editor symbol bar labels to editor settings, because it is just relevant for the editors
1 parent 9629bb3 commit 2d6bdf9

File tree

23 files changed

+157
-56
lines changed

23 files changed

+157
-56
lines changed

src/packages/frontend/account/account-preferences-appearance.tsx

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -267,18 +267,6 @@ export function AccountPreferencesAppearance() {
267267
hides some button tooltips (this is only partial)`}
268268
/>
269269
</Switch>
270-
<Switch
271-
checked={!!other_settings.get("show_symbol_bar_labels")}
272-
onChange={(e) =>
273-
on_change("show_symbol_bar_labels", e.target.checked)
274-
}
275-
>
276-
<FormattedMessage
277-
id="account.other-settings.symbol_bar_labels"
278-
defaultMessage={`<strong>Show Symbol Bar Labels:</strong>
279-
show labels in the frame editor symbol bar`}
280-
/>
281-
</Switch>
282270
<Switch
283271
checked={!!other_settings.get("time_ago_absolute")}
284272
onChange={(e) => on_change("time_ago_absolute", e.target.checked)}

src/packages/frontend/account/editor-settings/checkboxes.tsx

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ const EDITOR_SETTINGS_CHECKBOXES = {
9999
defaultMessage: `<strong>Disable the markdown code bar</strong> in all markdown documents.
100100
Checking this hides the extra run, copy, and explain buttons in fenced code blocks.`,
101101
}),
102+
show_symbol_bar_labels: defineMessage({
103+
id: "account.other-settings.symbol_bar_labels",
104+
defaultMessage:
105+
"<strong>Show Symbol Bar Labels:</strong> show labels in the frame editor symbol bar",
106+
}),
102107
} as const;
103108

104109
// Type for valid checkbox keys
@@ -111,6 +116,7 @@ const DISPLAY_SETTINGS: readonly CheckboxKey[] = [
111116
"jupyter_line_numbers",
112117
"show_trailing_whitespace",
113118
"show_my_other_cursors",
119+
"show_symbol_bar_labels",
114120
] as const;
115121

116122
const EDITING_BEHAVIOR: readonly CheckboxKey[] = [
@@ -144,6 +150,16 @@ const UI_ELEMENTS: readonly CheckboxKey[] = [
144150
"disable_markdown_codebar",
145151
] as const;
146152

153+
// Settings that come from other_settings instead of editor_settings
154+
const OTHER_SETTINGS_KEYS: readonly CheckboxKey[] = [
155+
"disable_markdown_codebar",
156+
"show_symbol_bar_labels",
157+
] as const;
158+
159+
function isOtherSetting(name: CheckboxKey): boolean {
160+
return OTHER_SETTINGS_KEYS.includes(name);
161+
}
162+
147163
interface Props {
148164
editor_settings;
149165
other_settings?;
@@ -156,7 +172,7 @@ export function EditorSettingsCheckboxes(props: Props) {
156172
const intl = useIntl();
157173

158174
function renderName(name: CheckboxKey) {
159-
if (name === "disable_markdown_codebar") return;
175+
if (isOtherSetting(name)) return;
160176
return (
161177
<strong>
162178
{capitalize(
@@ -186,8 +202,8 @@ export function EditorSettingsCheckboxes(props: Props) {
186202
name: CheckboxKey,
187203
desc: IntlMessage | Rendered | string,
188204
): Rendered {
189-
// Special handling for disable_markdown_codebar which is in other_settings
190-
const is_other_setting = name === "disable_markdown_codebar";
205+
// Special handling for settings that are in other_settings
206+
const is_other_setting = isOtherSetting(name);
191207
const checked = is_other_setting
192208
? !!props.other_settings?.get(name)
193209
: !!props.editor_settings.get(name);

src/packages/frontend/account/settings-index.tsx

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,19 +13,19 @@ import { Icon } from "@cocalc/frontend/components";
1313
import AIAvatar from "@cocalc/frontend/components/ai-avatar";
1414
import { cloudFilesystemsEnabled } from "@cocalc/frontend/compute";
1515
import { labels } from "@cocalc/frontend/i18n";
16+
import { COLORS } from "@cocalc/util/theme";
17+
import {
18+
VALID_PREFERENCES_SUB_TYPES,
19+
type NavigatePath,
20+
type PreferencesSubTabType,
21+
} from "@cocalc/util/types/settings";
1622
import { APPEARANCE_ICON_NAME } from "./account-preferences-appearance";
1723
import { COMMUNICATION_ICON_NAME } from "./account-preferences-communication";
1824
import { EDITOR_ICON_NAME } from "./account-preferences-editor";
1925
import { KEYBOARD_ICON_NAME } from "./account-preferences-keyboard";
2026
import { OTHER_ICON_NAME } from "./account-preferences-other";
2127
import { ACCOUNT_PROFILE_ICON_NAME } from "./account-preferences-profile";
2228
import { KEYS_ICON_NAME } from "./account-preferences-security";
23-
import {
24-
VALID_PREFERENCES_SUB_TYPES,
25-
type NavigatePath,
26-
type PreferencesSubTabType,
27-
} from "@cocalc/util/types/settings";
28-
// import { COLORS } from "@cocalc/util/theme";
2929

3030
const MESSAGES = defineMessages({
3131
title: {
@@ -40,7 +40,7 @@ const MESSAGES = defineMessages({
4040
appearance: {
4141
id: "account.settings.overview.appearance",
4242
defaultMessage:
43-
"Customize the visual experience via color themes, dark mode, language, and visual settings.",
43+
"Customize the visual experience via color themes, {dark_mode}, language, and visual settings.",
4444
},
4545
editor: {
4646
id: "account.settings.overview.editor",
@@ -183,7 +183,20 @@ export function SettingsOverview() {
183183
<Card.Meta
184184
avatar={<Icon name={APPEARANCE_ICON_NAME} />}
185185
title={intl.formatMessage(labels.appearance)}
186-
description={intl.formatMessage(MESSAGES.appearance)}
186+
description={intl.formatMessage(MESSAGES.appearance, {
187+
dark_mode: (
188+
<span
189+
style={{
190+
backgroundColor: COLORS.GRAY_DD,
191+
color: COLORS.GRAY_LLL,
192+
paddingLeft: "3px",
193+
paddingRight: "3px",
194+
}}
195+
>
196+
dark mode
197+
</span>
198+
),
199+
})}
187200
/>
188201
</Card>
189202
<Card

src/packages/frontend/antd-bootstrap.tsx

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -289,20 +289,19 @@ export function Switch(props: {
289289
labelStyle?: CSS;
290290
children?: any;
291291
}) {
292-
const { style = {}, labelStyle = {} } = props;
293-
294292
// Default font weight for label
295-
const finalLabelStyle: CSS = {
293+
const labelStyle: CSS = {
296294
fontWeight: 400,
297-
...labelStyle,
298-
};
295+
...props.labelStyle,
296+
cursor: props.disabled ? "default" : "pointer",
297+
} as const;
299298

300-
const handleChange = (checked: boolean) => {
299+
function handleChange(checked: boolean) {
301300
if (props.onChange) {
302301
// Call onChange with same signature as Checkbox - event object with target.checked
303302
props.onChange({ target: { checked } });
304303
}
305-
};
304+
}
306305

307306
return (
308307
<div style={{ margin: "15px 0" }}>
@@ -311,7 +310,7 @@ export function Switch(props: {
311310
display: "flex",
312311
alignItems: "center",
313312
gap: 8,
314-
...style,
313+
...props.style,
315314
}}
316315
>
317316
<AntdSwitch
@@ -321,10 +320,7 @@ export function Switch(props: {
321320
/>
322321
<span
323322
onClick={() => !props.disabled && handleChange(!props.checked)}
324-
style={{
325-
...finalLabelStyle,
326-
cursor: props.disabled ? "default" : "pointer",
327-
}}
323+
style={labelStyle}
328324
>
329325
{props.children}
330326
</span>

src/packages/frontend/i18n/trans/ar_EG.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"account.settings.email-verification.unknown": "غير معروف",
118118
"account.settings.email-verification.verified": "موثوق",
119119
"account.settings.overview.ai": "تهيئة إعدادات وتكاملات المساعد الذكي.",
120-
"account.settings.overview.appearance": "تخصيص التجربة البصرية عبر ثيمات الألوان، الوضع الداكن، اللغة، والإعدادات البصرية.",
120+
"account.settings.overview.appearance": "خصص التجربة المرئية عبر ثيمات الألوان، {dark_mode}، اللغة، والإعدادات المرئية.",
121121
"account.settings.overview.billing": "إدارة الاشتراكات والتراخيص ومعلومات الفوترة.",
122122
"account.settings.overview.cloud": "إدارة تخزين نظام الملفات السحابي.",
123123
"account.settings.overview.communication": "تفضيلات الإشعارات وإعدادات الاتصال.",
@@ -1037,6 +1037,7 @@
10371037
"labels.keys": "مفاتيح API و SSH",
10381038
"labels.language": "اللغة",
10391039
"labels.last_active": "آخر نشاط",
1040+
"labels.last_edited": "آخر تعديل",
10401041
"labels.latex_document": "LaTeX",
10411042
"labels.license": "رخصة",
10421043
"labels.licenses": "التراخيص",
@@ -1130,6 +1131,7 @@
11301131
"labels.ssh_keys": "مفاتيح SSH",
11311132
"labels.starred": "المفضلة",
11321133
"labels.start_all": "ابدأ الكل",
1134+
"labels.state": "الحالة",
11331135
"labels.statements": "البيانات",
11341136
"labels.status": "الحالة",
11351137
"labels.stop": "توقف",
@@ -1428,6 +1430,7 @@
14281430
"projects.operations.delete.button": "{deleted, select, true {استعادة الكل} other {حذف الكل}}",
14291431
"projects.operations.delete.confirm": "نعم، {deleted, select, true {استرجاع} other {حذف}}",
14301432
"projects.operations.delete.description": "هل أنت متأكد أنك تريد {deleted, select, true {استعادة} other {حذف}} {count, plural, one {# مشروع} other {# مشاريع}}؟",
1433+
"projects.operations.delete.ownership": "{ownership, select, none {أنت لا تملك أيًا من المشاريع المدرجة.} some {أنت مالك {ownedCount} من {totalCount} المشاريع المدرجة.} all {أنت مالك كل المشاريع المدرجة.} other {} }",
14311434
"projects.operations.delete.title": "{deleted, select, true {استعادة الحذف} other {حذف}} المشاريع",
14321435
"projects.operations.delete.warning": "سيقوم هذا {deleted, select, true {باستعادة} other {بحذف}} {count, plural, one {المشروع} other {المشاريع}} لجميع المتعاونين.",
14331436
"projects.operations.hide.button": "{hidden, select, true {إظهار الكل} other {إخفاء الكل}}",
@@ -1453,6 +1456,7 @@
14531456
"projects.table-controls.hashtags.placeholder": "التصفية حسب الوسوم...",
14541457
"projects.table-controls.hidden.label": "مخفي",
14551458
"projects.table-controls.search.placeholder": "ابحث عن المشاريع...",
1459+
"projects.table.last-edited": "آخر تعديل",
14561460
"purchases.automatic-payments-warning.description": "المدفوعات التلقائية هي <b>أكثر ملاءمة</b> بكثير، وست<b>وفر لك الوقت</b>، و<b>تضمن عدم إلغاء الاشتراكات</b> عن طريق الخطأ.",
14571461
"purchases.automatic-payments-warning.title": "الدفع التلقائي ليس مطلوبًا للاشتراك",
14581462
"purchases.automatic-payments.are-enabled": "المدفوعات التلقائية مفعلة",

src/packages/frontend/i18n/trans/de_DE.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"account.settings.email-verification.unknown": "Unbekannt",
118118
"account.settings.email-verification.verified": "Verifiziert",
119119
"account.settings.overview.ai": "Konfigurieren Sie die Einstellungen und Integrationen des KI-Assistenten.",
120-
"account.settings.overview.appearance": "Passen Sie das visuelle Erlebnis über Farbthemen, den Dunkelmodus, die Sprache und visuelle Einstellungen an.",
120+
"account.settings.overview.appearance": "Passen Sie das visuelle Erlebnis durch Farbthemen, {dark_mode}, Sprache und visuelle Einstellungen an.",
121121
"account.settings.overview.billing": "Verwalten Sie Abonnements, Lizenzen und Abrechnungsinformationen.",
122122
"account.settings.overview.cloud": "Verwalten Sie den Cloud-Dateisystemspeicher.",
123123
"account.settings.overview.communication": "Benachrichtigungseinstellungen und Kommunikationseinstellungen.",
@@ -1037,6 +1037,7 @@
10371037
"labels.keys": "API- & SSH-Schlüssel",
10381038
"labels.language": "Sprache",
10391039
"labels.last_active": "Zuletzt aktiv",
1040+
"labels.last_edited": "Zuletzt bearbeitet",
10401041
"labels.latex_document": "LaTeX",
10411042
"labels.license": "Lizenz",
10421043
"labels.licenses": "Lizenzen",
@@ -1130,6 +1131,7 @@
11301131
"labels.ssh_keys": "SSH Schlüssel",
11311132
"labels.starred": "Markiert",
11321133
"labels.start_all": "Alle starten",
1134+
"labels.state": "Zustand",
11331135
"labels.statements": "Belege",
11341136
"labels.status": "Status",
11351137
"labels.stop": "Stop",
@@ -1428,6 +1430,7 @@
14281430
"projects.operations.delete.button": "{deleted, select, true {Alle wiederherstellen} other {Alle löschen}}",
14291431
"projects.operations.delete.confirm": "Ja, {deleted, select, true {wiederherstellen} other {löschen}}",
14301432
"projects.operations.delete.description": "Sind Sie sicher, dass Sie {deleted, select, true {wiederherstellen} other {löschen}} {count, plural, one {# Projekt} other {# Projekte}} möchten?",
1433+
"projects.operations.delete.ownership": "{ownership, select, none {Sie besitzen keines der aufgeführten Projekte.} some {Sie sind der Eigentümer von {ownedCount} der {totalCount} aufgeführten Projekte.} all {Sie sind der Eigentümer jedes aufgeführten Projekts.} other {} }",
14311434
"projects.operations.delete.title": "{deleted, select, true {Wiederherstellen} other {Löschen}} Projekte",
14321435
"projects.operations.delete.warning": "Dies wird {deleted, select, true {wiederherstellen} other {löschen}} das {count, plural, one {Projekt} other {Projekte}} für alle Mitwirkenden.",
14331436
"projects.operations.hide.button": "{hidden, select, true {Alle einblenden} other {Alle ausblenden}}",
@@ -1453,6 +1456,7 @@
14531456
"projects.table-controls.hashtags.placeholder": "Nach Hashtags filtern...",
14541457
"projects.table-controls.hidden.label": "Versteckt",
14551458
"projects.table-controls.search.placeholder": "Projekte durchsuchen...",
1459+
"projects.table.last-edited": "Zuletzt bearbeitet",
14561460
"purchases.automatic-payments-warning.description": "Automatische Zahlungen sind viel <b>bequemer</b>, <b>ersparen Ihnen Zeit</b> und <b>stellen sicher, dass Abonnements nicht versehentlich gekündigt werden</b>.",
14571461
"purchases.automatic-payments-warning.title": "Automatische Zahlungen sind NICHT erforderlich, um ein Abonnement zu haben",
14581462
"purchases.automatic-payments.are-enabled": "Automatische Zahlungen sind aktiviert",

src/packages/frontend/i18n/trans/es_ES.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"account.settings.email-verification.unknown": "Desconocido",
118118
"account.settings.email-verification.verified": "Verificado",
119119
"account.settings.overview.ai": "Configurar ajustes e integraciones del asistente de IA.",
120-
"account.settings.overview.appearance": "Personaliza la experiencia visual mediante temas de color, modo oscuro, idioma y configuraciones visuales.",
120+
"account.settings.overview.appearance": "Personaliza la experiencia visual a través de temas de color, {dark_mode}, idioma y configuraciones visuales.",
121121
"account.settings.overview.billing": "Gestionar suscripciones, licencias e información de facturación.",
122122
"account.settings.overview.cloud": "Gestionar el almacenamiento del sistema de archivos en la nube.",
123123
"account.settings.overview.communication": "Preferencias de notificación y configuración de comunicación.",
@@ -1037,6 +1037,7 @@
10371037
"labels.keys": "Claves API y SSH",
10381038
"labels.language": "Idioma",
10391039
"labels.last_active": "Última actividad",
1040+
"labels.last_edited": "Última edición",
10401041
"labels.latex_document": "LaTeX",
10411042
"labels.license": "Licencia",
10421043
"labels.licenses": "Licencias",
@@ -1130,6 +1131,7 @@
11301131
"labels.ssh_keys": "Claves SSH",
11311132
"labels.starred": "Destacados",
11321133
"labels.start_all": "Iniciar Todo",
1134+
"labels.state": "Estado",
11331135
"labels.statements": "Declaraciones",
11341136
"labels.status": "Estado",
11351137
"labels.stop": "Detener",
@@ -1428,6 +1430,7 @@
14281430
"projects.operations.delete.button": "{deleted, select, true {Restaurar todo} other {Eliminar todo}}",
14291431
"projects.operations.delete.confirm": "Sí, {deleted, select, true {restaurar} other {eliminar}}",
14301432
"projects.operations.delete.description": "¿Está seguro de que desea {deleted, select, true {recuperar} other {eliminar}} {count, plural, one {# proyecto} other {# proyectos}}?",
1433+
"projects.operations.delete.ownership": "{ownership, select, none {No posees ninguno de los proyectos listados.} some {Eres el propietario de {ownedCount} de los {totalCount} proyectos listados.} all {Eres el propietario de todos los proyectos listados.} other {} }",
14311434
"projects.operations.delete.title": "{deleted, select, true {Recuperar} other {Eliminar}} Proyectos",
14321435
"projects.operations.delete.warning": "Esto {deleted, select, true {restaurará} other {eliminará}} el {count, plural, one {proyecto} other {proyectos}} para todos los colaboradores.",
14331436
"projects.operations.hide.button": "{hidden, select, true {Mostrar todo} other {Ocultar todo}}",
@@ -1453,6 +1456,7 @@
14531456
"projects.table-controls.hashtags.placeholder": "Filtrar por hashtags...",
14541457
"projects.table-controls.hidden.label": "Oculto",
14551458
"projects.table-controls.search.placeholder": "Buscar proyectos...",
1459+
"projects.table.last-edited": "Última edición",
14561460
"purchases.automatic-payments-warning.description": "Los pagos automáticos son mucho <b>más convenientes</b>, te <b>ahorrarán tiempo</b> y <b>asegurarán que las suscripciones no se cancelen</b> por accidente.",
14571461
"purchases.automatic-payments-warning.title": "Los pagos automáticos NO son necesarios para tener una suscripción",
14581462
"purchases.automatic-payments.are-enabled": "Los pagos automáticos están habilitados",

src/packages/frontend/i18n/trans/es_PV.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
"account.settings.email-verification.unknown": "Ezezaguna",
118118
"account.settings.email-verification.verified": "Egiaztatua",
119119
"account.settings.overview.ai": "Konfiguratu AI laguntzailearen ezarpenak eta integrazioak.",
120-
"account.settings.overview.appearance": "Pertsonalizatu ikusizko esperientzia kolore gai, modu ilun, hizkuntza eta ikusizko ezarpenen bidez.",
120+
"account.settings.overview.appearance": "Pertsonalizatu ikus-entzunezko esperientzia kolore gaiak, {dark_mode}, hizkuntza eta ikusizko ezarpenak erabiliz.",
121121
"account.settings.overview.billing": "Kudeatu harpidetzak, lizentziak eta fakturazio-informazioa.",
122122
"account.settings.overview.cloud": "Kudeatu hodeiko fitxategi-sistemaren biltegiratzea.",
123123
"account.settings.overview.communication": "Jakinarazpen hobespenak eta komunikazio ezarpenak.",
@@ -1037,6 +1037,7 @@
10371037
"labels.keys": "API eta SSH gakoak",
10381038
"labels.language": "Hizkuntza",
10391039
"labels.last_active": "Azken Aktiboa",
1040+
"labels.last_edited": "Azken aldaketa",
10401041
"labels.latex_document": "LaTeX Dokumentua",
10411042
"labels.license": "Lizentzia",
10421043
"labels.licenses": "Lizentziak",
@@ -1130,6 +1131,7 @@
11301131
"labels.ssh_keys": "SSH Giltzak",
11311132
"labels.starred": "Izarretakoak",
11321133
"labels.start_all": "Hasi Guztiak",
1134+
"labels.state": "Egoera",
11331135
"labels.statements": "Aitorpenak",
11341136
"labels.status": "Egoera",
11351137
"labels.stop": "Gelditu",
@@ -1428,6 +1430,7 @@
14281430
"projects.operations.delete.button": "{deleted, select, true {Berreskuratu Guztiak} other {Ezabatu Guztiak}}",
14291431
"projects.operations.delete.confirm": "Bai, {deleted, select, true {berreskuratu} other {ezabatu}}",
14301432
"projects.operations.delete.description": "Ziur zaude {deleted, select, true {berreskuratu} other {ezabatu}} nahi duzula {count, plural, one {# proiektu} other {# proiektu}}?",
1433+
"projects.operations.delete.ownership": "{ownership, select, none {Ez duzu zerrendatutako proiektuen jaberik.} some {Zerrendatutako {totalCount} proiektuen artean {ownedCount} proiekturen jabea zara.} all {Zerrendatutako proiektu guztien jabea zara.} other {} }",
14311434
"projects.operations.delete.title": "{deleted, select, true {Berreskuratu} other {Ezabatu}} Proiektuak",
14321435
"projects.operations.delete.warning": "Honek lankide guztientzako {deleted, select, true {berrezarri} other {ezabatu}} {count, plural, one {proiektua} other {proiektuak}}.",
14331436
"projects.operations.hide.button": "{hidden, select, true {Denak Agertu} other {Denak Ezkutatu}}",
@@ -1453,6 +1456,7 @@
14531456
"projects.table-controls.hashtags.placeholder": "Iragazi etiketen arabera...",
14541457
"projects.table-controls.hidden.label": "Ezkutua",
14551458
"projects.table-controls.search.placeholder": "Proiektuak bilatu...",
1459+
"projects.table.last-edited": "Azken aldiz editatua",
14561460
"purchases.automatic-payments-warning.description": "Ordainketa automatikoak askoz <b>erosoagoak</b> dira, <b>denbora aurreztuko dizute</b> eta <b>harpidetzak ez direla istripuz bertan behera geldituko</b> ziurtatuko dute.",
14571461
"purchases.automatic-payments-warning.title": "Ez da beharrezkoa ordainketa automatikoak izatea harpidetza izateko",
14581462
"purchases.automatic-payments.are-enabled": "Ordainketa Automatikoak Gaituta Daude",

0 commit comments

Comments
 (0)