UI consistency & code quality improvements

- Standardized InvoiceEditor CreateNew tab styling to match ObjectEditor design
- Fixed CodeMirror focus issues during editing by removing problematic dependencies
- Removed copy button from mindmap view for cleaner interface
- Resolved ESLint warnings in PostmanTreeTable.js with useCallback optimization
- Enhanced PDF generation with dynamic style swapping for better print output
- Updated commits.json with latest changes
This commit is contained in:
dwindown
2025-09-28 23:30:44 +07:00
parent 78570f04f0
commit 68db19e076
13 changed files with 789 additions and 156 deletions

View File

@@ -1,4 +1,4 @@
import React, { useState, useMemo } from 'react';
import React, { useState, useMemo, useCallback } from 'react';
import { ChevronRight, ChevronDown, Copy, Search, Filter } from 'lucide-react';
import CopyButton from './CopyButton';
@@ -8,7 +8,7 @@ const PostmanTreeTable = ({ data, title = "JSON Data" }) => {
const [filterType, setFilterType] = useState('all');
// Flatten the data structure for table display
const flattenData = (obj, path = '', level = 0) => {
const flattenData = useCallback((obj, path = '', level = 0) => {
const result = [];
if (obj === null || obj === undefined) {
@@ -74,7 +74,7 @@ const PostmanTreeTable = ({ data, title = "JSON Data" }) => {
}
return result;
};
}, [expandedPaths]);
const toggleExpanded = (path) => {
const newExpanded = new Set(expandedPaths);
@@ -86,7 +86,7 @@ const PostmanTreeTable = ({ data, title = "JSON Data" }) => {
setExpandedPaths(newExpanded);
};
const flatData = useMemo(() => flattenData(data), [data, expandedPaths]);
const flatData = useMemo(() => flattenData(data), [data, flattenData]);
const filteredData = useMemo(() => {
return flatData.filter(item => {
@@ -129,7 +129,7 @@ const PostmanTreeTable = ({ data, title = "JSON Data" }) => {
};
const getKeyDisplay = (key, level) => {
const parts = key.split(/[.\[\]]+/).filter(Boolean);
const parts = key.split(/[.[\]]+/).filter(Boolean);
return parts[parts.length - 1] || key;
};