Skip to content

Settings: let the user rename the attachments folder #31

@thetechjon

Description

@thetechjon

Context

Attachments default to Files/ (configurable in code via attachmentsFolder in src/utils/systemFolder.ts) but the Settings UI does not surface this. Some users prefer attachments/, _assets/, or whatever convention their Obsidian vault used — and currently they have to know the internal helper exists to override it.

Mirrors issue #27 (trash folder rename) — same shape, different field.

Where to look

  • src/utils/systemFolder.tsattachmentsFolder helper with .get() / .set().
  • src/stores/settingsStore.ts — where the persisted field lives.
  • src/components/modals/SettingsModal.tsx — Settings → Vault section, near the trash settings.
  • src/utils/attachments.tssaveAttachment reads attachmentsFolder.get() for new saves.

Acceptance criteria

  • Settings → Vault gains a text input "Attachments folder" with default Files.
  • Changing the value affects NEW attachments only. Existing attachments at the old path are not moved (rename of existing files is out of scope for this issue — open a follow-up if needed).
  • Sanitization: reject empty strings and filesystem-illegal characters.
  • The setting persists per vault (same shape as trashMode).

Complexity

Small.

For first-time contributors

Read CONTRIBUTING.md. npm install, npm run dev. PR against dev. If you also tackle the rename-on-update case, mention it in the PR and we can keep both behind one shipped feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions