Skip to content

feat: add delete files by default setting for chat conversations#84

Merged
chenyme merged 2 commits into
devfrom
auto_files_delete
Jun 2, 2026
Merged

feat: add delete files by default setting for chat conversations#84
chenyme merged 2 commits into
devfrom
auto_files_delete

Conversation

@chenyme

@chenyme chenyme commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Add a user-level chat preference for deleting conversation files by default.

Users can now enable a setting in chat preferences so delete conversation confirmations default to also deleting files. The confirmation checkbox remains visible and can still be changed per deletion. Existing backend deletion behavior is preserved: files referenced by other conversations are kept.

A shared useChatPreferences hook was added so frontend chat preferences are read consistently and cached across conversation UI entry points.

image

Change type

  • Bug fix
  • Feature
  • Documentation
  • Refactor
  • Configuration / deployment
  • Security hardening
  • Other

Affected areas

  • Frontend / UI
  • Backend / API
  • Authentication / authorization
  • Conversations / streaming
  • Files / RAG / extraction
  • Model routing / providers
  • MCP / tools
  • Billing / payments
  • Admin console
  • Deployment / Docker / configuration
  • Documentation

Verification

  • cd backend && go test ./internal/application/usersettings
  • cd frontend && pnpm lint
  • git diff --check

Screenshots, API examples, or logs

N/A

Configuration, migration, and compatibility notes

Adds user setting key chat.delete_conversation_files_by_default, defaulting to false.

No database migration is required because this uses the existing user settings table. Existing users keep the current behavior unless they enable the new setting.

Documentation

  • Documentation is not needed for this change.
  • Documentation was updated.
  • Documentation still needs to be updated.

Security and privacy

  • No secrets, tokens, credentials, local config, or personal data are included.
  • User data access remains scoped by authenticated user context unless an admin-only path explicitly requires broader access.
  • Security-sensitive behavior was reviewed, including authentication, authorization, provider routing, file processing, billing, and admin APIs where relevant.

Checklist

  • I searched existing issues and pull requests.
  • Changes are focused and do not include unrelated refactors.
  • Tests or static verification were run where practical.
  • User-facing behavior, deployment steps, API contracts, or configuration changes are documented.
  • Generated artifacts are included only when this project explicitly requires them.
  • Caches, build output, .pyc files, .env files, and local storage data are not committed.

@chenyme
chenyme merged commit 837c6cb into dev Jun 2, 2026
2 checks passed
@chenyme
chenyme deleted the auto_files_delete branch June 2, 2026 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: 删除会话的「同时删除会话中的文件」功能希望同时可以作为一个设置存在

1 participant