diff --git a/src/components/DynamicPropertiesPanel.test.tsx b/src/components/DynamicPropertiesPanel.test.tsx index 8c069b22..aeb5bc0a 100644 --- a/src/components/DynamicPropertiesPanel.test.tsx +++ b/src/components/DynamicPropertiesPanel.test.tsx @@ -93,17 +93,6 @@ describe('DynamicPropertiesPanel', () => { expect(screen.getByText('Note')).toBeInTheDocument() }) - it('renders word count', () => { - render( - - ) - expect(screen.getByText('Words')).toBeInTheDocument() - }) - it('renders status as colored pill', () => { render( { }) }) - it('renders modified date', () => { - render( - - ) - expect(screen.getByText('Modified')).toBeInTheDocument() - }) - it('opens status dropdown on click and selects a status', () => { render( { }) describe('editable vs read-only distinction', () => { - it('renders Info section header', () => { - render( - - ) - expect(screen.getByText('Info')).toBeInTheDocument() - }) - - it('renders Modified and Words in read-only Info section', () => { - render( - - ) - const readOnlyRows = screen.getAllByTestId('readonly-property') - const labels = readOnlyRows.map(row => row.querySelector('span')?.textContent) - expect(labels).toContain('Modified') - expect(labels).toContain('Words') - }) - - it('renders Created date in Info section', () => { - render( - - ) - const readOnlyRows = screen.getAllByTestId('readonly-property') - const labels = readOnlyRows.map(row => row.querySelector('span')?.textContent) - expect(labels).toContain('Created') - }) - - it('renders file size in Info section', () => { - render( - - ) - expect(screen.getByText('Size')).toBeInTheDocument() - expect(screen.getByText('4.2 KB')).toBeInTheDocument() - }) - - it('shows em dash for null timestamps in Info section', () => { - render( - - ) - // Two em dashes for null Modified and Created - const dashes = screen.getAllByText('\u2014') - expect(dashes.length).toBeGreaterThanOrEqual(2) - }) - it('editable properties have hover styling via data-testid', () => { render( { expect(row.className).toContain('hover:bg-muted') }) }) - - it('read-only rows do not have hover styling', () => { - render( - - ) - const readOnlyRows = screen.getAllByTestId('readonly-property') - readOnlyRows.forEach(row => { - expect(row.className).not.toContain('hover:bg-muted') - }) - }) - - it('formats file sizes correctly', () => { - // Small file — bytes - const { rerender } = render( - - ) - expect(screen.getByText('500 B')).toBeInTheDocument() - - // KB range - rerender( - - ) - expect(screen.getByText('2.0 KB')).toBeInTheDocument() - - // MB range - rerender( - - ) - expect(screen.getByText('1.0 MB')).toBeInTheDocument() - }) }) describe('property row 50/50 layout', () => { @@ -680,21 +549,6 @@ describe('DynamicPropertiesPanel', () => { expect(row.className).toContain('grid-cols-2') }) }) - - it('uses CSS grid with two equal columns on read-only rows', () => { - render( - - ) - const readOnlyRows = screen.getAllByTestId('readonly-property') - readOnlyRows.forEach(row => { - expect(row.className).toContain('grid') - expect(row.className).toContain('grid-cols-2') - }) - }) }) describe('URL property rendering', () => { diff --git a/src/components/DynamicPropertiesPanel.tsx b/src/components/DynamicPropertiesPanel.tsx index 3d245261..e7718f8c 100644 --- a/src/components/DynamicPropertiesPanel.tsx +++ b/src/components/DynamicPropertiesPanel.tsx @@ -6,7 +6,6 @@ import { getEffectiveDisplayMode, detectPropertyType } from '../utils/propertyTy import { SmartPropertyValueCell, DisplayModeSelector } from './PropertyValueCells' import { TypeSelector } from './TypeSelector' import { AddPropertyForm } from './AddPropertyForm' -import { countWords } from '../utils/wikilinks' import type { PropertyDisplayMode } from '../utils/propertyTypes' function toSentenceCase(key: string): string { @@ -22,20 +21,6 @@ export function containsWikilinks(value: FrontmatterValue): boolean { return false } -function formatDate(timestamp: number | null): string { - if (!timestamp) return '\u2014' - const d = new Date(timestamp * 1000) - return d.toLocaleDateString('en-US', { year: 'numeric', month: 'short', day: 'numeric' }) -} - -function formatFileSize(bytes: number): string { - if (bytes < 1024) return `${bytes} B` - const kb = bytes / 1024 - if (kb < 1024) return `${kb.toFixed(1)} KB` - const mb = kb / 1024 - return `${mb.toFixed(1)} MB` -} - function PropertyRow({ propKey, value, editingKey, displayMode, autoMode, vaultStatuses, vaultTags, onStartEdit, onSave, onSaveList, onUpdate, onDelete, onDisplayModeChange }: { propKey: string; value: FrontmatterValue; editingKey: string | null displayMode: PropertyDisplayMode; autoMode: PropertyDisplayMode @@ -68,15 +53,6 @@ function PropertyRow({ propKey, value, editingKey, displayMode, autoMode, vaultS ) } -function InfoRow({ label, value }: { label: string; value: string }) { - return ( -
- {label} - {value} -
- ) -} - function AddPropertyButton({ onClick, disabled }: { onClick: () => void; disabled: boolean }) { return (