Properties
+ {/* Always show Type from entry */}
{entry.isA && (
Type
{entry.isA}
)}
- {entry.status && (
-
-
Status
-
- {entry.status}
+
+ {/* Dynamic properties from frontmatter */}
+ {propertyEntries.map(([key, value]) => (
+
+
+ {key}
+ {onDeleteProperty && (
+
+ )}
+ {renderEditableValue(key, value)}
- )}
- {entry.owner && (
-
- Owner
- {entry.owner}
-
- )}
- {entry.cadence && (
-
- Cadence
- {entry.cadence}
-
- )}
+ ))}
+
+ {/* Always show Modified and Words (read-only) */}
Modified
{formatDate(entry.modifiedAt)}
@@ -135,9 +652,41 @@ function PropertiesPanel({ entry, content }: { entry: VaultEntry; content: strin
{wordCount}
-
+
+ {/* Add property UI */}
+ {showAddDialog ? (
+
+ ) : (
+
+ )}
)
}
@@ -168,6 +717,8 @@ function useBacklinks(
}
if (content.includes(`[[${stem}]]`)) return true
if (content.includes(`[[${pathStem}]]`)) return true
+ // Also check with pipe aliases
+ if (content.includes(`[[${pathStem}|`)) return true
return false
})
}, [entry, entries, allContent])
@@ -237,12 +788,43 @@ function GitHistoryPanel({ commits }: { commits: GitCommit[] }) {
)
}
-export function Inspector({ collapsed, onToggle, entry, content, entries, allContent, gitHistory, onNavigate }: InspectorProps) {
+export function Inspector({
+ collapsed,
+ onToggle,
+ entry,
+ content,
+ entries,
+ allContent,
+ gitHistory,
+ onNavigate,
+ onUpdateFrontmatter,
+ onDeleteProperty,
+ onAddProperty,
+}: InspectorProps) {
const backlinks = useBacklinks(entry, entries, allContent)
+ const frontmatter = useMemo(() => parseFrontmatter(content), [content])
+
+ const handleUpdateProperty = useCallback((key: string, value: FrontmatterValue) => {
+ if (entry && onUpdateFrontmatter) {
+ onUpdateFrontmatter(entry.path, key, value)
+ }
+ }, [entry, onUpdateFrontmatter])
+
+ const handleDeleteProperty = useCallback((key: string) => {
+ if (entry && onDeleteProperty) {
+ onDeleteProperty(entry.path, key)
+ }
+ }, [entry, onDeleteProperty])
+
+ const handleAddProperty = useCallback((key: string, value: FrontmatterValue) => {
+ if (entry && onAddProperty) {
+ onAddProperty(entry.path, key, value)
+ }
+ }, [entry, onAddProperty])
return (