snapexcel 1.2.5 → 1.2.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "snapexcel",
3
- "version": "1.2.5",
3
+ "version": "1.2.7",
4
4
  "description": "Desktop Screenshot Logger for UI Testing - Capture any window including Android emulators",
5
5
  "main": "src/main.js",
6
6
  "bin": {
package/publish.sh ADDED
@@ -0,0 +1,5 @@
1
+ #!/bin/bash
2
+
3
+ # SnapExcel - Publish to npm script
4
+
5
+ git add . && git commit -m "fix: responsive layout, prevent focus stealing, UI improvements" && npm version patch && npm publish
package/src/main.js CHANGED
@@ -74,14 +74,15 @@ ipcMain.handle('get-always-on-top', () => {
74
74
  // Capture entire screen at native resolution (optimized for 250 screenshot capacity)
75
75
  ipcMain.handle('capture-screen', async () => {
76
76
  try {
77
- // Hide the main window before capturing so it doesn't appear in screenshot
78
- if (mainWindow) {
77
+ // Only hide window if it's visible and not minimized (to avoid pulling user back)
78
+ const shouldHideWindow = mainWindow && mainWindow.isVisible() && !mainWindow.isMinimized();
79
+
80
+ if (shouldHideWindow) {
79
81
  mainWindow.hide();
82
+ // Small delay to ensure window is fully hidden
83
+ await new Promise(resolve => setTimeout(resolve, 150));
80
84
  }
81
85
 
82
- // Small delay to ensure window is fully hidden
83
- await new Promise(resolve => setTimeout(resolve, 150));
84
-
85
86
  // Get actual screen size for full resolution capture
86
87
  const primaryDisplay = screen.getPrimaryDisplay();
87
88
  const { width, height } = primaryDisplay.size;
@@ -96,9 +97,9 @@ ipcMain.handle('capture-screen', async () => {
96
97
  thumbnailSize: { width: captureWidth, height: captureHeight }
97
98
  });
98
99
 
99
- // Show the main window again after capture
100
- if (mainWindow) {
101
- mainWindow.show();
100
+ // Only show window again if we hid it (don't disturb user on other screens)
101
+ if (shouldHideWindow && mainWindow) {
102
+ mainWindow.showInactive(); // Show without stealing focus
102
103
  if (isAlwaysOnTop) {
103
104
  mainWindow.setAlwaysOnTop(true);
104
105
  }
@@ -113,8 +114,8 @@ ipcMain.handle('capture-screen', async () => {
113
114
  return { success: false, error: 'No screen found' };
114
115
  } catch (error) {
115
116
  // Make sure to show window even if there's an error
116
- if (mainWindow) {
117
- mainWindow.show();
117
+ if (mainWindow && !mainWindow.isMinimized()) {
118
+ mainWindow.showInactive();
118
119
  }
119
120
  return { success: false, error: error.message };
120
121
  }
@@ -194,16 +195,20 @@ ipcMain.handle('start-region-capture', async () => {
194
195
  regionWindow.webContents.send('set-background', fullScreenshot, display.size);
195
196
  });
196
197
 
197
- // Function to restore main window properly
198
+ // Function to restore main window without stealing focus
198
199
  const restoreMainWindow = () => {
199
- if (mainWindow && mainWindowBounds) {
200
- // Use setTimeout to let the region window fully close first
200
+ if (mainWindow) {
201
+ // Just restore the window state without bringing it to foreground
202
+ // This prevents pulling user to SnapExcel window when they're on different screen
201
203
  setTimeout(() => {
202
- mainWindow.restore();
203
- mainWindow.setSize(mainWindowBounds.width, mainWindowBounds.height);
204
- mainWindow.setPosition(mainWindowBounds.x, mainWindowBounds.y);
205
- // Don't focus - let user continue with their app
206
- mainWindow.blur();
204
+ if (mainWindow.isMinimized()) {
205
+ // Use showInactive to restore without stealing focus
206
+ mainWindow.showInactive();
207
+ }
208
+ // Don't change size/position - keep window where it was
209
+ if (isAlwaysOnTop) {
210
+ mainWindow.setAlwaysOnTop(true);
211
+ }
207
212
  }, 100);
208
213
  }
209
214
  };
package/src/renderer.js CHANGED
@@ -733,6 +733,9 @@ async function captureScreenshot() {
733
733
 
734
734
  state.sheets[state.currentSheetIndex].screenshots.push(screenshot);
735
735
  saveState();
736
+
737
+ // Small delay to let window fully restore before updating UI
738
+ await new Promise(resolve => setTimeout(resolve, 100));
736
739
  updateUI();
737
740
  lastCaptureTime = Date.now();
738
741
 
@@ -798,6 +801,10 @@ async function captureRegion() {
798
801
 
799
802
  state.sheets[state.currentSheetIndex].screenshots.push(screenshot);
800
803
  saveState();
804
+
805
+ // Small delay to let window fully restore before updating UI
806
+ await new Promise(resolve => setTimeout(resolve, 100));
807
+
801
808
  // Don't call updateUI() which might resize the window - just update the grid
802
809
  updateScreenshotsGrid(state.sheets[state.currentSheetIndex].screenshots);
803
810
  elements.screenshotCount.textContent = state.sheets[state.currentSheetIndex].screenshots.length;
package/src/styles.css CHANGED
@@ -47,8 +47,7 @@ body {
47
47
  .app-container {
48
48
  display: flex;
49
49
  flex-direction: column;
50
- min-height: 100vh;
51
- max-height: 100vh;
50
+ height: 100vh;
52
51
  overflow: hidden;
53
52
  }
54
53
 
@@ -159,7 +158,9 @@ body {
159
158
  display: flex;
160
159
  flex-direction: column;
161
160
  overflow-y: auto;
161
+ overflow-x: hidden;
162
162
  padding: 16px;
163
+ flex: 1;
163
164
  }
164
165
 
165
166
  .view.hidden {
@@ -534,6 +535,9 @@ body {
534
535
  border-radius: 5px;
535
536
  border: 0.5px solid rgba(4, 30, 66, 0.04);
536
537
  padding: 5px;
538
+ flex: 1;
539
+ min-height: 100px;
540
+ overflow: hidden;
537
541
  }
538
542
 
539
543
  .section-header {
@@ -559,14 +563,16 @@ body {
559
563
 
560
564
  .screenshots-grid {
561
565
  display: grid;
562
- grid-template-columns: repeat(4, 1fr);
566
+ grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
567
+ grid-auto-rows: min-content;
568
+ align-content: start;
563
569
  gap: 8px;
564
570
  overflow-y: auto;
565
571
  padding: 5px;
566
572
  background: rgba(255, 255, 255, 0.5);
567
573
  border-radius: 3px;
574
+ flex: 1;
568
575
  min-height: 70px;
569
- max-height: 200px;
570
576
  }
571
577
 
572
578
  /* Ultra thin scrollbar - both vertical and horizontal */