Skip to content

Fix/directory count#648

Merged
plastikfan merged 2 commits into
mainfrom
fix/directory-count
Jun 26, 2026
Merged

Fix/directory count#648
plastikfan merged 2 commits into
mainfrom
fix/directory-count

Conversation

@plastikfan

@plastikfan plastikfan commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • New Features

    • Progress displays now show separate file and directory totals alongside the combined total.
    • Status labels have been adjusted for steadier layout, reducing visual jumping as counts change.
    • Tree output alignment has been improved for cleaner spacing.
  • Bug Fixes

    • Completion progress now stays accurate when late updates arrive after a task finishes.
    • Final counts now reflect the actual tracked items shown in the interface.
    • Completion behavior no longer double-counts repeated paths after finishing.

@plastikfan plastikfan self-assigned this Jun 26, 2026
@plastikfan plastikfan added the bug Something isn't working label Jun 26, 2026
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown

Review Change Stack

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f935583e-6ddb-4b3f-a217-36b24d2fe5c2

📥 Commits

Reviewing files that changed from the base of the PR and between 6ca0206 and 9a74266.

📒 Files selected for processing (14)
  • src/prism/views/highway/model.go
  • src/prism/views/highway/model_test.go
  • src/prism/views/linear/linear-new.go
  • src/prism/views/linear/render-line.go
  • src/prism/views/porthole/model.go
  • src/prism/views/porthole/model_test.go
  • src/prism/widgets/status/accessors.go
  • src/prism/widgets/status/messages.go
  • src/prism/widgets/status/model.go
  • src/prism/widgets/status/status_test.go
  • src/prism/widgets/status/update.go
  • src/prism/widgets/status/view.go
  • src/prism/widgets/track/track_test.go
  • src/prism/widgets/track/update.go

📝 Walkthrough

Walkthrough

Status totals now carry file and directory breakdowns, completion counts in highway and porthole come from tracked counts, late motifs no longer reopen progress after completion, and the linear tree renderer changes its default width and branch-width measurement.

Changes

Progress totals and completion flow

Layer / File(s) Summary
Status totals and state
src/prism/widgets/status/messages.go, src/prism/widgets/status/accessors.go, src/prism/widgets/status/model.go, src/prism/widgets/status/update.go
TotalMsg now carries file and dir totals, the status model stores them, and count updates overwrite incoming values directly.
Status labels and layout
src/prism/widgets/status/model.go, src/prism/widgets/status/view.go, src/prism/widgets/status/status_test.go
Fixed-width file and dir labels now use total-aware text, and the render test uses the wider row width.
Track completion dedup
src/prism/widgets/track/update.go, src/prism/widgets/track/track_test.go
CompleteMsg keeps the counted-path map, and the test now expects repeated motifs with the same path to stay deduped.
Highway completion counts
src/prism/views/highway/model.go, src/prism/views/highway/model_test.go
CensusMsg sends split totals, MotifMsg still reaches track after completion, and CompleteMsg reads file and dir counts from the track child.
Porthole completion counts
src/prism/views/porthole/model.go, src/prism/views/porthole/model_test.go
CensusMsg sends split totals, and CompleteMsg uses the model’s counted files and dirs for the final status counts and done value.

Linear tree rendering

Layer / File(s) Summary
Branch prefix spacing
src/prism/views/linear/linear-new.go, src/prism/views/linear/render-line.go
linear.New starts at width 104, and branch prefix spacing uses glyph display width instead of rune count.

Sequence Diagram(s)

sequenceDiagram
  participant HighwayModel
  participant TrackModel
  participant StatusModel
  HighwayModel->>StatusModel: status.TotalMsg{Total, TotalFiles, TotalDirs}
  HighwayModel->>TrackModel: contract.MotifMsg
  HighwayModel->>StatusModel: status.IncDoneMsg + status.CountsMsg
  HighwayModel->>TrackModel: read Files() / Dirs() on contract.CompleteMsg
  HighwayModel->>StatusModel: status.CountsMsg + status.DoneMsg
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • snivilised/jaywalk#601: Adjusts the same highway/status progress-total wiring that this PR extends with file/dir split totals.
  • snivilised/jaywalk#605: Introduces the track child counting flow that this PR now keeps intact after completion.
  • snivilised/jaywalk#622: Adds the porthole counted-progress path that this PR changes to use internal counters at completion.

Poem

I hopped through counts with whiskers bright,
Through files and dirs, both left and right.
The track stayed true after the done,
And branchy trees now line up sun.
sniff—this carrot code feels just right 🐇

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/directory-count

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@plastikfan plastikfan linked an issue Jun 26, 2026 that may be closed by this pull request
@plastikfan
plastikfan merged commit 5d1eabd into main Jun 26, 2026
4 of 5 checks passed
@plastikfan
plastikfan deleted the fix/directory-count branch June 26, 2026 12:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

invalid directory count

1 participant