Skip to content

Removed workspace folders still shown in FOLDERS tab #3

Description

@zhanglei

Problem description

After removing a folder from the workspace on the desktop app, the FOLDERS tab in the Android app still shows that folder (tapping it shows it empty or stale). Keeping it in the CHATS tab (where sessions are grouped by folder) is acceptable, but the FOLDERS tab acts as a project list and should not show folders that are no longer in the workspace.

Steps to reproduce

  1. Desktop codeg: remove a folder from the workspace (right-click -> Remove from workspace, or via workspace settings).
  2. Open the Android app and go to the FOLDERS tab.
  3. The removed folder still appears in the list.

Root cause

  • Server side: remove_folder_from_workspace_core (src-tauri/src/commands/folders.rs) does not delete the record. It only calls set_folder_open(false) — the record is kept intentionally so session/folder association can be resolved by id.
  • list_all_folder_details (src-tauri/src/db/service/folder_service.rs) filters only by deleted_at, not by is_open (the comment in code says this is intentional, to keep resolving active sessions by folder id).
  • Android client: both the CHATS and FOLDERS tabs call listFolders() (= list_all_folder_details). The client already has listOpenFolders() (= list_open_folder_details, which only returns is_open = true) but it is only used in the folder picker when creating a new session.

Suggested fix

  • FOLDERS tab: use listOpenFolders() instead of listFolders() (one-line change).
  • CHATS tab: keep as-is (grouping history sessions by folder is reasonable behavior).

Environment

  • codeg Android client (latest)
  • codeg desktop latest

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions