From caa1bc405ba7cd67a6f1d3b293dc20016b6fbda6 Mon Sep 17 00:00:00 2001 From: Ayushi Gupta Date: Mon, 4 May 2026 02:42:52 +0530 Subject: [PATCH 1/2] admin: improve settings editor UX and restore comments #7603 --- admin/src/App.css | 22 ++++ admin/src/pages/SettingsPage.tsx | 167 ++++++++++++++++++++++--------- 2 files changed, 142 insertions(+), 47 deletions(-) diff --git a/admin/src/App.css b/admin/src/App.css index e69de29bb2d..378c4265a24 100644 --- a/admin/src/App.css +++ b/admin/src/App.css @@ -0,0 +1,22 @@ +/* src/admin/App.css */ + +.settings { + font-family: "Fira Code", "Cascadia Code", "Source Code Pro", monospace; + font-size: 14px; + line-height: 1.5; + tab-size: 4; /* Prevents the 'messy' look of inconsistent spacing */ + background-color: #1e1e1e; /* Standard 'Dark Mode' editor color */ + color: #d4d4d4; + padding: 20px; + border-radius: 4px; + border: 1px solid #333; + width: 100%; + min-height: 500px; + resize: vertical; + white-space: pre; /* Essential for preserving the line structure */ + overflow-x: auto; +} + +.settings:focus { + outline: 2px solid #007acc; /* Give it that 'VS Code' focus feel */ +} diff --git a/admin/src/pages/SettingsPage.tsx b/admin/src/pages/SettingsPage.tsx index 6c2f9bf333c..967e754152e 100644 --- a/admin/src/pages/SettingsPage.tsx +++ b/admin/src/pages/SettingsPage.tsx @@ -1,50 +1,123 @@ -import {useStore} from "../store/store.ts"; -import {isJSONClean, cleanComments} from "../utils/utils.ts"; -import {Trans} from "react-i18next"; -import {IconButton} from "../components/IconButton.tsx"; -import {RotateCw, Save} from "lucide-react"; +import { useStore } from "../store/store.ts"; +import { isJSONClean } from "../utils/utils.ts"; +import { Trans } from "react-i18next"; +import { IconButton } from "../components/IconButton.tsx"; +import { RotateCw, Save, AlignLeft } from "lucide-react"; // Added AlignLeft icon -export const SettingsPage = ()=>{ - const settingsSocket = useStore(state=>state.settingsSocket) - const settings = cleanComments(useStore(state=>state.settings)) +export const SettingsPage = () => { + const settingsSocket = useStore(state => state.settingsSocket) + const settings = useStore(state => state.settings) - return
-

-