diffwatch 2.0.8 → 2.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -28
- package/package.json +9 -2
- package/src/components/DiffViewer.tsx +3 -3
- package/src/components/FileList.tsx +4 -4
- package/src/version.ts +1 -1
package/README.md
CHANGED
|
@@ -19,22 +19,6 @@ A TUI app for watching git repository file changes with diffs.
|
|
|
19
19
|
|
|
20
20
|
## Installation
|
|
21
21
|
|
|
22
|
-
### Prerequisites
|
|
23
|
-
|
|
24
|
-
**Bun runtime is required** to run DiffWatch. If you don't have it installed, install it first:
|
|
25
|
-
|
|
26
|
-
**macOS/Linux:**
|
|
27
|
-
```bash
|
|
28
|
-
curl -fsSL https://bun.sh/install | bash
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
**Windows (PowerShell):**
|
|
32
|
-
```powershell
|
|
33
|
-
irm bun.sh/install.ps1 | iex
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
Or visit [bun.sh](https://bun.sh) for other installation methods.
|
|
37
|
-
|
|
38
22
|
### Option 1: Install from npm (recommended)
|
|
39
23
|
|
|
40
24
|
```bash
|
|
@@ -82,18 +66,6 @@ diffwatch [OPTIONS]
|
|
|
82
66
|
- `--help` or `-h` - Show help message
|
|
83
67
|
- `--version` or `-v` - Show version number
|
|
84
68
|
|
|
85
|
-
### Examples
|
|
86
|
-
|
|
87
|
-
Watch the repository in the current directory:
|
|
88
|
-
```bash
|
|
89
|
-
diffwatch
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
Watch a specific project:
|
|
93
|
-
```bash
|
|
94
|
-
diffwatch --path ~/projects/my-app
|
|
95
|
-
```
|
|
96
|
-
|
|
97
69
|
## Keyboard Shortcuts
|
|
98
70
|
|
|
99
71
|
- `↑` / `↓` - Navigate through the file list
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "diffwatch",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.9",
|
|
4
4
|
"description": "A TUI app for watching git repository file changes with diffs.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"git",
|
|
@@ -10,7 +10,14 @@
|
|
|
10
10
|
"cli",
|
|
11
11
|
"git-gui",
|
|
12
12
|
"git-diff",
|
|
13
|
-
"terminal-ui"
|
|
13
|
+
"terminal-ui",
|
|
14
|
+
"ai",
|
|
15
|
+
"agent",
|
|
16
|
+
"codex",
|
|
17
|
+
"claude",
|
|
18
|
+
"opencode",
|
|
19
|
+
"github-cli",
|
|
20
|
+
"gemini-cli"
|
|
14
21
|
],
|
|
15
22
|
"homepage": "https://github.com/sarfraznawaz2005/diffwatch#readme",
|
|
16
23
|
"bugs": {
|
|
@@ -117,14 +117,14 @@ const diffData = useMemo(() => {
|
|
|
117
117
|
}, [fileContent]);
|
|
118
118
|
|
|
119
119
|
// Calculate the max line width based on available width in the diff viewer
|
|
120
|
-
// The diff viewer takes up
|
|
120
|
+
// The diff viewer takes up 70% of the total width, and we need to account for:
|
|
121
121
|
// - Line numbers (6 chars: " 1234: ")
|
|
122
122
|
// - Prefix (+/-/space) (1 char)
|
|
123
123
|
// - Borders (2 chars: left and right)
|
|
124
124
|
// - Some padding (1 char)
|
|
125
125
|
// Total overhead: 6 (line numbers) + 1 (prefix) + 2 (borders) = 9 chars
|
|
126
126
|
const calculateMaxLineWidth = (): number => {
|
|
127
|
-
const estimatedWidth = Math.floor((renderer.width * 0.
|
|
127
|
+
const estimatedWidth = Math.floor((renderer.width * 0.70) - 9); // 9 chars for line numbers, prefix, and borders
|
|
128
128
|
return Math.max(20, estimatedWidth); // minimum width of 20
|
|
129
129
|
};
|
|
130
130
|
|
|
@@ -162,7 +162,7 @@ const diffData = useMemo(() => {
|
|
|
162
162
|
<box
|
|
163
163
|
border
|
|
164
164
|
title={` Diff (${filename || 'None'}) `}
|
|
165
|
-
width="
|
|
165
|
+
width="70%"
|
|
166
166
|
borderColor={focused ? 'yellow' : 'grey'}
|
|
167
167
|
flexDirection="column"
|
|
168
168
|
>
|
|
@@ -31,13 +31,13 @@ export function FileList({ files, selectedIndex, focused, searchQuery, onSelect,
|
|
|
31
31
|
// Calculate the max length for file paths based on available width
|
|
32
32
|
// Account for the symbol, space, and padding
|
|
33
33
|
const calculateMaxPathLength = (): number => {
|
|
34
|
-
// Get the width of the container (
|
|
34
|
+
// Get the width of the container (30% of total width)
|
|
35
35
|
// Since we can't directly measure the rendered width, we'll estimate based on a percentage
|
|
36
|
-
// considering that the container is
|
|
36
|
+
// considering that the container is 30% of the total width
|
|
37
37
|
// and we need to account for the symbol (1 char) + space (1 char) before the filename
|
|
38
38
|
// Also account for borders (left and right = 2 chars total)
|
|
39
39
|
// Total overhead: 1 (symbol) + 1 (space after symbol) + 2 (borders) = 4 chars
|
|
40
|
-
const estimatedWidth = Math.floor((renderer.width * 0.
|
|
40
|
+
const estimatedWidth = Math.floor((renderer.width * 0.30) - 4); // 4 chars for symbol + space + borders
|
|
41
41
|
return Math.max(10, estimatedWidth); // minimum length of 10
|
|
42
42
|
};
|
|
43
43
|
|
|
@@ -62,7 +62,7 @@ export function FileList({ files, selectedIndex, focused, searchQuery, onSelect,
|
|
|
62
62
|
<box
|
|
63
63
|
border
|
|
64
64
|
title={title}
|
|
65
|
-
width="
|
|
65
|
+
width="30%"
|
|
66
66
|
height="100%"
|
|
67
67
|
borderColor={focused ? 'yellow' : 'grey'}
|
|
68
68
|
flexDirection="column"
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const BUILD_VERSION = "2.0.
|
|
1
|
+
export const BUILD_VERSION = "2.0.9";
|