Skip to content

Settings: let the user rename the trash folder #27

@thetechjon

Description

@thetechjon

Context

The trash folder is currently hardcoded as .trash. Some users prefer .recycle or a custom name (especially when migrating from another markdown tool that uses a different convention). The underlying logic already supports the folder being arbitrary — there is a single magic constant in src/utils/systemFolder.ts that drives the synthetic sidebar row.

This is a chance to expose a Settings field that lets the user rename it without losing trashed items.

Where to look

  • src/utils/systemFolder.ts line 91-96 — TRASH_FOLDER_ID and the synthetic-folder logic.
  • src/stores/settingsStore.ts — vault-scoped settings live here; add the new field alongside trashMode.
  • src/components/modals/SettingsModal.tsx — the Vault section is the right home for the new input (search for trashMode to find the area).
  • src/utils/trashTree.ts — synthetic ".trash" sidebar view; references the constant.

Acceptance criteria

  • New persisted setting trashFolderName: string with default .trash.
  • Settings → Vault has a text input labeled "Trash folder" with the description text describing the trade-off.
  • Changing the value renames the synthetic sidebar row immediately.
  • Trashed items remain trashed across the rename (they reference the folder by its synthetic id, not by name).
  • Sanitization: the input rejects empty strings and characters that are illegal in filesystem paths (use the existing sanitizeFilename helper or a similar check).

Complexity

Small.

For first-time contributors

Read CONTRIBUTING.md. Run npm install then npm run dev for the local server at http://localhost:3001. Tests via npm test. Typecheck via npm run typecheck. Submit a PR against the dev branch.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions