Skip to content

feat: complete the first ready-to-use workspace tree #7

Description

@AshGreyG

Problem

Chitin needs a first ready-to-use workspace tree before richer panels, document views, and molecule viewers can be built productively.

The current tree work has established lazy directory loading and virtualized row rendering, but the workspace tree is not yet a complete user workflow. Users still need reliable selection, file open behavior, loading/error/empty states, keyboard navigation, and a clean command boundary so mouse, keyboard, and future command palette actions trigger the same logic.

This aligns with the roadmap's Phase 1 workspace system: Activity Bar, Primary Sidebar, Editor Area, Status Bar, and Command Palette should be built around reusable workspace state instead of one-off UI callbacks.

Proposal

Complete the first production-ready workspace tree MVP.

Scope:

  • Add selected/focused workspace tree entry state.
  • Separate directory toggle behavior from file open behavior.
  • Open files from the tree into the main document/editor area, initially with a simple placeholder document view.
  • Add row states for loading, empty directory, inaccessible/error entry, selected, focused, and hover.
  • Add keyboard navigation:
    • Up/down moves focus.
    • Right expands directories.
    • Left collapses directories or moves to parent.
    • Enter opens focused file or toggles focused directory.
    • Home/End jumps to first/last visible row.
  • Keep directory child loading asynchronous.
  • Keep tree rendering virtualized.
  • Preserve non-UTF-8 path correctness by avoiding lossy display-string identifiers.
  • Introduce or prepare command-style actions for:
    • workspace.toggle_entry
    • workspace.open_entry
    • workspace.refresh_entry
    • workspace.reveal_active_file

Product Area

Desktop workspace

Acceptance Criteria

  • Running cargo run -p chitin-desktop -- . shows a usable workspace tree.
  • Clicking a directory expands/collapses it without blocking the UI.
  • Clicking a file selects it and opens a placeholder document view in the main panel.
  • Selected and focused rows have visible, theme-driven styling.
  • Large directories remain responsive through virtualized rendering.
  • Empty directories and loading directories render distinct rows.
  • Keyboard navigation works for visible rows.
  • Tree actions are structured so mouse and keyboard triggers can share the same command logic later.
  • Existing non-UTF-8 path and symlink tests remain passing.
  • Add tests for selection/open state and visible-row navigation where practical.

Out Of Scope

  • Full text editor implementation.
  • PDB/mmCIF parsing or 3D structure rendering.
  • File watching/live refresh.
  • Command palette UI.
  • Persisted workspace session restore.

Notes

This issue should be completed before starting the first molecule viewer panel. The molecule viewer needs a reliable path from project tree selection to document/view activation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions