Commit 80d59e0
authored
Make diff stats indicator clickable to toggle review mode (#1560)
## TL;DR
The diff stats indicator in the message editor is now clickable to toggle between split and closed review modes, providing a more intuitive way for users to control the code review interface.
## Problem
Users need a quick way to toggle the code review mode without using alternative controls. Making the diff stats indicator interactive provides an obvious, discoverable control point.
## Changes
- **DiffStatsIndicator component**:
- Converted from a `Flex` container to a clickable `button` element with transparent background and pointer cursor
- Added `taskId` prop to identify which review task to control
- Integrated with `useReviewNavigationStore` to read and update review mode state
- Added click handler that toggles review mode between "closed" and "split" states
- Applied inline-flex styling to maintain visual layout while functioning as a button
- **MessageEditor component**:
- Passed `taskId` prop to `DiffStatsIndicator` component
## How did you test this?
The changes maintain the visual appearance of the diff stats while converting it to a functional button element. The component will properly read the current review mode state and toggle it when clicked.
---
*Created with [PostHog Code](https://posthog.com/code?ref=pr)*1 parent 316d23e commit 80d59e0
2 files changed
Lines changed: 22 additions & 3 deletions
File tree
- apps/code/src/renderer/features/message-editor/components
Lines changed: 21 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| 16 | + | |
14 | 17 | | |
15 | 18 | | |
16 | 19 | | |
| |||
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
29 | 36 | | |
30 | 37 | | |
31 | 38 | | |
32 | 39 | | |
33 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
34 | 47 | | |
35 | | - | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
36 | 54 | | |
37 | 55 | | |
38 | 56 | | |
| |||
61 | 79 | | |
62 | 80 | | |
63 | 81 | | |
64 | | - | |
| 82 | + | |
65 | 83 | | |
66 | 84 | | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| 107 | + | |
107 | 108 | | |
108 | 109 | | |
109 | 110 | | |
| |||
0 commit comments