From c92e56269c87df403981317a8764fbdef75650d0 Mon Sep 17 00:00:00 2001 From: anuphilipp3 Date: Fri, 21 Aug 2026 18:44:55 +0530 Subject: [PATCH] feat(formatters): migrate all 14 Formatters onto the shared tool kit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Phase 1 of the tool-consistency pass. Every Formatter now renders through ToolShell + IOPanel/ToolTextArea/CodeEditor instead of hand-rolled Cards + raw textareas, so they share one visual language (panel surfaces, headers, borders, spacing, states) with base64/json-formatter. Refactored (logic preserved — same state, handlers, i18n, editors): - beautify-minify, json-schema-generator, json-to-code, json-diff, jsonpath-playground, yaml-formatter, sql-formatter, format-converter, markdown-preview-html, json-visualizer, diff-checker, graphql-formatter, regex-tester - json-formatter kept as the gold reference (unchanged) Notes: - CodeEditor panes (sql/yaml/graphql/format-converter) kept as-is inside the new panels; json-visualizer's graph pane surface aligned to the kit while its canvas + floating node card are untouched. - markdown-preview-html and graphql keep their tabs; regex-tester keeps its highlight-overlay textarea and match navigation. 0 type errors; all 14 pages render. Co-Authored-By: Claude Opus 4.8 --- .../beautify-minify-layout.tsx | 197 ++++++------ .../diff-checker/diff-checker-layout.tsx | 128 ++++---- .../format-converter-layout.tsx | 174 +++++------ .../graphql-formatter-layout.tsx | 283 +++++++++--------- .../components/json-diff/json-diff-layout.tsx | 197 ++++++------ .../json-schema-generator-layout.tsx | 213 ++++++------- .../json-to-code/json-to-code-layout.tsx | 149 +++++---- .../json-visualizer-layout.tsx | 58 ++-- .../jsonpath-playground-layout.tsx | 202 ++++++------- .../markdown-preview-html-layout.tsx | 147 +++++---- .../regex-tester/regex-tester-layout.tsx | Bin 10649 -> 9732 bytes .../sql-formatter/sql-formatter-layout.tsx | 216 +++++++------ .../yaml-formatter/yaml-formatter-layout.tsx | 196 ++++++------ 13 files changed, 1011 insertions(+), 1149 deletions(-) diff --git a/apps/desktop-ui/src/components/beautify-minify/beautify-minify-layout.tsx b/apps/desktop-ui/src/components/beautify-minify/beautify-minify-layout.tsx index 74b344a9..e04ffe43 100644 --- a/apps/desktop-ui/src/components/beautify-minify/beautify-minify-layout.tsx +++ b/apps/desktop-ui/src/components/beautify-minify/beautify-minify-layout.tsx @@ -4,7 +4,6 @@ import React, { useMemo, useState } from 'react' import { useCopyToClipboard } from '@/hooks/use-copy-to-clipboard' import { useTranslations } from 'next-intl' import { Button } from '@/components/ui/button' -import { Card } from '@/components/ui/card' import { Label } from '@/components/ui/label' import { Select, @@ -14,11 +13,10 @@ import { SelectValue, } from '@/components/ui/select' import { ToggleGroup, ToggleGroupItem } from '@/components/ui/toggle-group' -import { Check, Copy, FileText, Trash2 } from 'lucide-react' +import { Check, Copy, Trash2 } from 'lucide-react' import { IconWand } from '@tabler/icons-react' -import { ToolPageHeader } from '@/components/tools/tool-page-header' -import { RevealItem } from '@/components/dashboard/dashboard-reveal' -import { CATEGORY_ACCENT } from '@/components/dashboard/types' +import { ToolShell } from '@/components/tools/tool-shell' +import { ToolPanels, IOPanel, ToolTextArea } from '@/components/tools/io-panel' import { BEAUTIFY_LANGS, beautify, minify, type BeautifyLang } from '@/lib/beautify-minify' type Action = 'beautify' | 'minify' @@ -41,105 +39,118 @@ export function BeautifyMinifyLayout() { ) const inBytes = useMemo(() => (input ? new TextEncoder().encode(input).length : 0), [input]) - return ( -
-
- - - - - - -
- - -
-
- - v && setAction(v as Action)} - className="justify-start" - > - {t('beautify')} - {t('minify')} - -
-
+ const toolbar = ( +
+
+ + +
+
+ + v && setAction(v as Action)} + className="justify-start" + > + + {t('beautify')} + + + {t('minify')} + + +
+
+ ) -
- -
-
- - -
-
- {t('bytes', { count: inBytes.toLocaleString() })} - -
-
-
-