fix: hide is_a/Is A from editable properties (already shown as TypeRow)

The is_a frontmatter key was appearing both as the TypeRow badge and
as a regular editable property. Added both 'is_a' and 'Is A' variants
to SKIP_KEYS to prevent duplication (snake_case used in mock data,
space-separated used in real vault YAML).

Added test verifying is_a is skipped when TypeRow is present.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
lucaronin
2026-02-23 15:35:50 +01:00
parent d2b97a2c38
commit 4438e9c4ef
2 changed files with 18 additions and 1 deletions

View File

@@ -128,6 +128,23 @@ describe('DynamicPropertiesPanel', () => {
expect(screen.getByText('cadence')).toBeInTheDocument()
})
it('skips is_a key since it is shown via TypeRow', () => {
render(
<DynamicPropertiesPanel
entry={makeEntry({ isA: 'Project' })}
content=""
frontmatter={{ is_a: 'Project', Status: 'Active' }}
/>
)
// Type is shown via TypeRow, is_a should NOT appear as a separate editable property
const editableRows = screen.getAllByTestId('editable-property')
const editableLabels = editableRows.map(row => row.querySelector('span')?.textContent?.replace('×', '').trim())
expect(editableLabels).not.toContain('is_a')
// But Type row should still show
expect(screen.getByText('Type')).toBeInTheDocument()
expect(screen.getByText('Project')).toBeInTheDocument()
})
it('renders boolean property as toggle', () => {
render(
<DynamicPropertiesPanel

View File

@@ -28,7 +28,7 @@ export const RELATIONSHIP_KEYS = new Set([
])
// Keys to skip showing in Properties
const SKIP_KEYS = new Set(['aliases', 'notion_id', 'workspace'])
const SKIP_KEYS = new Set(['aliases', 'notion_id', 'workspace', 'is_a', 'Is A'])
// eslint-disable-next-line react-refresh/only-export-components -- utility co-located with component
export function containsWikilinks(value: FrontmatterValue): boolean {