Skip to content

Commit 8bc6496

Browse files
Nattuhanclaude
andcommitted
Fix macOS traffic light overlap and DMG installer UI
- Add platform detection to Header component - Add left padding on macOS to avoid traffic light button overlap - Use create-dmg for proper DMG creation with Applications shortcut 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 1117f4a commit 8bc6496

File tree

4 files changed

+25
-8
lines changed

4 files changed

+25
-8
lines changed

.github/workflows/release.yml

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ jobs:
4444
- name: Ad-hoc sign and repackage macOS apps
4545
if: matrix.platform == 'mac'
4646
run: |
47-
# Remove old DMGs
48-
rm -f release/*.dmg
47+
# Remove old DMGs and blockmaps
48+
rm -f release/*.dmg release/*.blockmap
4949
5050
# Sign all .app bundles with ad-hoc signature
5151
for dir in release/mac release/mac-arm64; do
@@ -60,20 +60,26 @@ jobs:
6060
fi
6161
done
6262
63-
# Recreate DMGs using hdiutil
63+
# Install create-dmg for proper DMG creation with Applications shortcut
64+
npm install -g create-dmg
65+
6466
VERSION=$(node -p "require('./package.json').version")
6567
APPNAME="Reference Viewer"
6668
67-
# x64 DMG
69+
# Create x64 DMG with Applications shortcut
6870
if [ -d "release/mac/$APPNAME.app" ]; then
6971
echo "Creating x64 DMG..."
70-
hdiutil create -volname "$APPNAME" -srcfolder "release/mac/$APPNAME.app" -ov -format UDZO "release/$APPNAME-$VERSION.dmg"
72+
create-dmg "release/mac/$APPNAME.app" release/ --overwrite || true
73+
# Rename to our naming convention
74+
mv "release/$APPNAME $VERSION.dmg" "release/$APPNAME-$VERSION.dmg" 2>/dev/null || true
7175
fi
7276
73-
# arm64 DMG
77+
# Create arm64 DMG with Applications shortcut
7478
if [ -d "release/mac-arm64/$APPNAME.app" ]; then
7579
echo "Creating arm64 DMG..."
76-
hdiutil create -volname "$APPNAME" -srcfolder "release/mac-arm64/$APPNAME.app" -ov -format UDZO "release/$APPNAME-$VERSION-arm64.dmg"
80+
create-dmg "release/mac-arm64/$APPNAME.app" release/ --overwrite || true
81+
# Rename to our naming convention
82+
mv "release/$APPNAME $VERSION.dmg" "release/$APPNAME-$VERSION-arm64.dmg" 2>/dev/null || true
7783
fi
7884
7985
ls -la release/

electron/preload.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,9 @@ const api = {
2323

2424
showInFolder: (filePath: string): Promise<void> =>
2525
ipcRenderer.invoke('app:showInFolder', filePath),
26+
27+
getPlatform: (): 'darwin' | 'win32' | 'linux' =>
28+
process.platform as 'darwin' | 'win32' | 'linux',
2629
},
2730

2831
// ===== Video Operations =====

src/components/layout/Header.css

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@
99
-webkit-app-region: drag;
1010
}
1111

12+
/* macOS traffic light buttons spacing */
13+
.header.platform-mac {
14+
padding-left: 80px;
15+
}
16+
1217
.header-left {
1318
display: flex;
1419
align-items: center;

src/components/layout/Header.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@ import { useVideoStore } from '../../stores/videoStore';
22
import { useUIStore } from '../../stores/uiStore';
33
import './Header.css';
44

5+
const platform = window.electronAPI?.app.getPlatform() ?? 'win32';
6+
const isMac = platform === 'darwin';
7+
58
export function Header() {
69
const { searchText, setSearchText } = useVideoStore();
710
const { openImportDialog, viewMode, setViewMode } = useUIStore();
811

912
return (
10-
<header className="header">
13+
<header className={`header ${isMac ? 'platform-mac' : ''}`}>
1114
<div className="header-left">
1215
<h1 className="app-title">Reference Viewer</h1>
1316
</div>

0 commit comments

Comments
 (0)