mattermost-claude-code 0.10.5 → 0.10.6

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/CHANGELOG.md CHANGED
@@ -7,6 +7,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.10.6] - 2025-12-28
11
+
12
+ ### Fixed
13
+ - **Fixed diff display** - Removed misleading line numbers and noise from diffs
14
+ - No more fake `@@ -1,1 +1,1 @@` headers (we don't have real line numbers)
15
+ - No more `` noise
16
+ - Uses `diffLines()` for proper line-by-line change detection
17
+ - Shows context lines (unchanged parts) naturally
18
+
10
19
  ## [0.10.5] - 2025-12-28
11
20
 
12
21
  ### Changed
@@ -853,17 +853,40 @@ export class SessionManager {
853
853
  const filePath = short(input.file_path);
854
854
  const oldStr = (input.old_string || '');
855
855
  const newStr = (input.new_string || '');
856
- // Show unified diff if we have old/new strings
856
+ // Show diff if we have old/new strings
857
857
  if (oldStr || newStr) {
858
- // Generate unified diff with 3 lines of context
859
- const patch = Diff.createPatch(filePath, oldStr, newStr, '', '', { context: 3 });
860
- // Remove the header lines (first 4 lines: ---, +++, and two index lines)
861
- const patchLines = patch.split('\n').slice(4);
862
- const maxLines = 25;
858
+ // Use diff library to compute actual line-by-line changes
859
+ const changes = Diff.diffLines(oldStr, newStr);
860
+ const maxLines = 20;
861
+ let lineCount = 0;
862
+ const diffLines = [];
863
+ for (const change of changes) {
864
+ const lines = change.value.replace(/\n$/, '').split('\n');
865
+ for (const line of lines) {
866
+ if (lineCount >= maxLines)
867
+ break;
868
+ if (change.added) {
869
+ diffLines.push(`+ ${line}`);
870
+ lineCount++;
871
+ }
872
+ else if (change.removed) {
873
+ diffLines.push(`- ${line}`);
874
+ lineCount++;
875
+ }
876
+ else {
877
+ // Context line (unchanged)
878
+ diffLines.push(` ${line}`);
879
+ lineCount++;
880
+ }
881
+ }
882
+ if (lineCount >= maxLines)
883
+ break;
884
+ }
885
+ const totalLines = changes.reduce((sum, c) => sum + c.value.split('\n').length - 1, 0);
863
886
  let diff = `✏️ **Edit** \`${filePath}\`\n\`\`\`diff\n`;
864
- diff += patchLines.slice(0, maxLines).join('\n');
865
- if (patchLines.length > maxLines) {
866
- diff += `\n... (+${patchLines.length - maxLines} more lines)`;
887
+ diff += diffLines.join('\n');
888
+ if (totalLines > maxLines) {
889
+ diff += `\n... (+${totalLines - maxLines} more lines)`;
867
890
  }
868
891
  diff += '\n```';
869
892
  return diff;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mattermost-claude-code",
3
- "version": "0.10.5",
3
+ "version": "0.10.6",
4
4
  "description": "Share Claude Code sessions live in a Mattermost channel with interactive features",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",