Skip to content

feat(review): add grouped review mode with viewed/commented indicators - #11

Merged
jfyne merged 1 commit into
masterfrom
worktree-readme-update
Mar 8, 2026
Merged

feat(review): add grouped review mode with viewed/commented indicators#11
jfyne merged 1 commit into
masterfrom
worktree-readme-update

Conversation

@jfyne

@jfyne jfyne commented Mar 7, 2026

Copy link
Copy Markdown
Owner

What's changed

Adds grouped review mode with --groups flag, per-file viewed/commented indicators in the tree sidebar, mark-as-viewed navigation, and updates README documentation.

Functional Requirements (EARS)

  • When --groups flag is provided with a JSON file path, the system shall parse the file as an ordered array of {name, files} objects and organize the tree sidebar by groups
  • When a file is not assigned to any group, the system shall place it in an auto-created "Other" group at the bottom
  • When a user clicks "Mark as viewed" on a file, the system shall toggle the viewed state and navigate to the next unviewed file in the current group, then the next group
  • When all files are marked as viewed, the system shall stay on the current file
  • While a file within a group is selected, the system shall highlight the group header in the tree
  • The system shall show a checkmark indicator next to viewed files in the tree
  • The system shall show a comment dot indicator next to files with comments in the tree
  • When a comment is added or deleted, the system shall update the comment indicator in the tree

Acceptance Criteria

Feature: Grouped review mode with viewed and commented indicators

  Scenario: Groups flag loads and organizes files into groups
    Given a groups JSON file with groups "Auth" containing "auth.go" and "API" containing "handler.go"
    And meatcheck is invoked with --groups groups.json and files auth.go handler.go utils.go
    When the UI loads
    Then the tree sidebar shows group headers "Auth" and "API" in order
    And "auth.go" appears under "Auth"
    And "handler.go" appears under "API"
    And "utils.go" appears under an "Other" group at the bottom

  Scenario: Groups work with diff mode
    Given a groups JSON file with group "Frontend" containing "src/app.tsx" and group "Backend" containing "api/handler.go"
    And a unified diff file containing changes to "src/app.tsx", "api/handler.go", and "config.yaml"
    And meatcheck is invoked with --groups groups.json --diff changes.diff
    When the UI loads
    Then the tree sidebar shows group headers "Frontend" and "Backend" in order
    And "src/app.tsx" appears under "Frontend"
    And "api/handler.go" appears under "Backend"
    And "config.yaml" appears under an "Other" group at the bottom

  Scenario: Marking a file as viewed shows indicator and advances
    Given a file is selected in the review UI
    When the user clicks "Mark as viewed"
    Then a green checkmark appears next to the file in the tree
    And the file name is dimmed in the tree
    And the UI navigates to the next unviewed file

  Scenario: Mark as viewed advances across groups
    Given grouped mode with groups A and B
    And the last unviewed file in group A is selected
    When the user clicks "Mark as viewed"
    Then the UI navigates to the first unviewed file in group B

  Scenario: All files viewed stays on current file
    Given all files except the current one are marked as viewed
    When the user clicks "Mark as viewed" on the last unviewed file
    Then the file is marked as viewed
    And the UI stays on the current file

  Scenario: Comment indicator appears in tree after adding comment
    Given a file with no comments
    When the user adds a comment on a line in the file
    Then a comment dot indicator appears next to the file in the tree

  Scenario: Comment indicator disappears when last comment is deleted
    Given a file with exactly one comment
    When the user deletes the comment
    Then the comment dot indicator is removed from the file in the tree

  Scenario: Active group is highlighted when file is selected
    Given grouped mode with multiple groups
    When the user selects a file within a group
    Then the group header for that file's group is highlighted

  Scenario: Viewed and commented indicators work in ungrouped mode
    Given meatcheck is invoked without --groups flag
    When the user marks a file as viewed and adds a comment to another file
    Then the viewed checkmark appears on the viewed file
    And the comment dot appears on the commented file

  Scenario: Unmarking a viewed file removes indicator
    Given a file that has been marked as viewed
    When the user clicks the "Viewed" button on that file
    Then the checkmark is removed from the file in the tree
    And the file name is no longer dimmed
    And the button text changes back to "Mark as viewed"
    And the UI stays on the current file

  Scenario: Invalid groups JSON produces error
    Given a groups JSON file with invalid syntax
    When meatcheck is invoked with --groups pointing to it
    Then the CLI exits with an error message describing the JSON problem

Suggested Review Order

# File What it does Link
1 main.go Adds --groups CLI flag and calls ParseGroupsFile to load groups into config View
2 template.html Adds group headers, viewed/commented indicators, and mark-viewed button to the UI View
3 styles.css Adds CSS for group headers, indicators, viewed dimming, and mark-viewed button View
4 app.go Adds rebuildTree, selectFile helpers, mark-viewed handler, and updates comment handlers to rebuild tree View
5 model.go Adds Group type and extends Config, ReviewModel, TreeItem with group/viewed/comment fields View
6 io_helpers.go Adds ParseGroupsFile to read and validate groups JSON with path normalization View
7 tree.go Adds buildGroupedTree, fileHasComments, and updates buildTree signature for viewed/comments View
8 viewed.go Adds nextUnviewedFile navigation logic with group-aware wrap-around View
9 assets.go Minor go fix formatting cleanup View
10 groups_test.go Tests for ParseGroupsFile validation and parsing View
11 tree_test.go Tests for buildTree viewed/comments fields and buildGroupedTree View
12 viewed_test.go Tests for nextUnviewedFile navigation in grouped and ungrouped modes View
13 http_render_test.go Updates existing render test call sites for new buildTree signature View
14 skill.md Adds --groups usage and JSON format to agent skill documentation View
15 README.md Adds grouped review mode features, CLI examples, and groups JSON format docs View
16 grouped-review-mode.md (plan) Implementation plan with 11 tasks across 3 stages View
17 2026-03-06-grouped-review-mode.md (research) Architecture research and design decisions View

Add --groups flag usage, JSON format example, and feature descriptions for the grouped review mode including viewed/commented indicators and mark-as-viewed navigation.
@jfyne
jfyne marked this pull request as ready for review March 8, 2026 08:34
@jfyne
jfyne merged commit da2a960 into master Mar 8, 2026
1 check passed
@jfyne
jfyne deleted the worktree-readme-update branch March 8, 2026 08:35
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.

1 participant