MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / ConfigFileSection

Function ConfigFileSection

packages/app-core/src/components/SettingsModal.tsx:3885–3929  ·  view source on GitHub ↗

Desktop-only: surfaces the on-disk config file so users can find, copy, or * open the plain-text TOML they sync across machines (issue #203).

()

Source from the content-addressed store, hash-verified

3883/** Desktop-only: surfaces the on-disk config file so users can find, copy, or
3884 * open the plain-text TOML they sync across machines (issue #203). */
3885function ConfigFileSection(): JSX.Element {
3886 const [configPath, setConfigPath] = useState<string | null>(null)
3887 useEffect(() => {
3888 let active = true
3889 void window.zen.getConfigPath().then((p) => {
3890 if (active) setConfigPath(p)
3891 })
3892 return () => {
3893 active = false
3894 }
3895 }, [])
3896
3897 const platform = window.zen.platformSync()
3898 const revealLabel =
3899 platform === 'darwin' ? 'Finder' : platform === 'win32' ? 'File Explorer' : 'file manager'
3900
3901 return (
3902 <Section
3903 title="Configuration file"
3904 description="Your preferences — theme, editor, vim, keymaps, and more — are mirrored to a plain-text TOML file. Sync it across machines with git, stow, or chezmoi; edit it by hand and changes apply live."
3905 settingId="config-file"
3906 >
3907 <div className="flex flex-col gap-3 px-5 py-4">
3908 <div className="flex flex-wrap items-center gap-2">
3909 <Button onClick={() => void window.zen.revealConfigFile()}>
3910 Reveal in {revealLabel}
3911 </Button>
3912 {configPath && (
3913 <Button variant="ghost" onClick={() => window.zen.clipboardWriteText(configPath)}>
3914 Copy path
3915 </Button>
3916 )}
3917 </div>
3918 {configPath && (
3919 <code
3920 className="block truncate rounded-lg border border-paper-300/70 bg-paper-100/70 px-3 py-2 font-mono text-xs text-ink-600"
3921 title={configPath}
3922 >
3923 {configPath}
3924 </code>
3925 )}
3926 </div>
3927 </Section>
3928 )
3929}
3930
3931const DATE_NOTE_PATTERN_TOKENS = [
3932 { token: 'yyyy', output: '2026', meaning: 'year; ISO week-year for weekly notes' },

Callers

nothing calls this directly

Calls 4

getConfigPathMethod · 0.80
platformSyncMethod · 0.80
revealConfigFileMethod · 0.80
clipboardWriteTextMethod · 0.80

Tested by

no test coverage detected