Skip to content

Update architecture docs and rename manager variables to match Trash interface#121

Merged
babarot merged 2 commits intomainfrom
babarot/update-architecture-docs
Apr 4, 2026
Merged

Update architecture docs and rename manager variables to match Trash interface#121
babarot merged 2 commits intomainfrom
babarot/update-architecture-docs

Conversation

@babarot
Copy link
Copy Markdown
Owner

@babarot babarot commented Apr 4, 2026

WHAT

Update docs/architecture.md to reflect the Phase 1-3 refactoring changes, and rename manager variables across CLI and UI to trash to match the trash.Trash interface they now hold.

WHY

After introducing the Trash interface, variables like cli.CLI.manager and ui.Model.trashManager still carried the old Manager name despite holding an interface value. Variable names should reflect their type. The architecture documentation also lacked the new Trash interface in its class diagram.

babarot added 2 commits April 4, 2026 12:03
- Add Trash interface to class diagram (Manager implements it)
- Add Remove method to Manager
- Add ForceHomeTrash to Config
- Add mu sync.Mutex to LegacyStorage
- Add Trash Interface section explaining the decoupling
Now that CLI and UI depend on the trash.Trash interface rather than
*trash.Manager, rename variables to reflect the actual type:

- cli.CLI.manager -> cli.CLI.trash (c.trash.Put(), c.trash.List())
- ui.Model.trashManager -> ui.Model.trash (m.trash.Remove())
- Render(manager, ...) -> Render(t, ...)
- NewModel(manager, ...) -> NewModel(t, ...)
@github-actions github-actions bot added the area/website Changes related to the project's website and documentation label Apr 4, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 4, 2026

Code Metrics Report

main (b7d1d1f) #121 (d70623a) +/-
Coverage 44.2% 44.1% -0.1%
Code to Test Ratio 1:1.5 1:1.5 0.0
Test Execution Time 3s 3s 0s
Details
  |                     | main (b7d1d1f) | #121 (d70623a) |  +/-  |
  |---------------------|----------------|----------------|-------|
- | Coverage            |          44.2% |          44.1% | -0.1% |
  |   Files             |             24 |             24 |     0 |
  |   Lines             |           1821 |           1824 |    +3 |
  |   Covered           |            806 |            806 |     0 |
  | Code to Test Ratio  |          1:1.5 |          1:1.5 |   0.0 |
  |   Code              |           2772 |           2772 |     0 |
  |   Test              |           4248 |           4248 |     0 |
  | Test Execution Time |             3s |             3s |    0s |

Code coverage of files in pull request scope (35.3% → 35.2%)

Files Coverage +/- Status
internal/trash/legacy/storage.go 32.4% +0.3% affected
internal/trash/manager.go 42.5% -0.9% affected
internal/trash/xdg/storage.go 31.3% -0.2% affected

Reported by octocov

@babarot babarot marked this pull request as ready for review April 4, 2026 11:41
@babarot babarot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, issues, etc. label Apr 4, 2026
@babarot babarot merged commit d7e0503 into main Apr 4, 2026
6 checks passed
@babarot babarot deleted the babarot/update-architecture-docs branch April 4, 2026 11:42
@github-actions github-actions bot mentioned this pull request Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/website Changes related to the project's website and documentation kind/cleanup Categorizes issue or PR as related to cleaning up code, issues, etc.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant