Skip to content

Commit 82cfd44

Browse files
committed
Bump version to 1.0.9 with spacebar preview improvements
- Preview now replaces card area inline instead of expanding panel - Fixed preview state persisting after panel close - Arrow keys update preview while browsing items
1 parent 981d988 commit 82cfd44

6 files changed

Lines changed: 65 additions & 53 deletions

File tree

PasteClip/AppState.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ final class AppState {
2727
clipboardMonitor.start(modelContext: modelContext)
2828
panelController.onPanelWillHide = { [weak self] in
2929
self?.searchState.reset()
30+
self?.previewItem = nil
3031
}
3132
setupHotkey()
3233
}
@@ -37,12 +38,7 @@ final class AppState {
3738
}
3839

3940
func selectForPreview(_ item: ClipboardItem?) {
40-
let wasShowing = previewItem != nil
41-
let willShow = item != nil
4241
previewItem = item
43-
if wasShowing != willShow {
44-
panelController.resizePanel(showPreview: willShow)
45-
}
4642
}
4743

4844
func hidePanel() {

PasteClip/Info.plist

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@
1515
<key>CFBundlePackageType</key>
1616
<string>APPL</string>
1717
<key>CFBundleShortVersionString</key>
18-
<string>1.0.8</string>
18+
<string>1.0.9</string>
1919
<key>CFBundleVersion</key>
20-
<string>8</string>
20+
<string>9</string>
2121
<key>LSMinimumSystemVersion</key>
2222
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
2323
<key>LSUIElement</key>

PasteClip/Panel/PanelController.swift

Lines changed: 8 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ final class PanelController {
1313
weak var appState: AppState?
1414

1515
private let baseHeight: CGFloat = 320
16-
private let previewHeight: CGFloat = 420
1716

1817
func toggle(modelContainer: ModelContainer, appState: AppState) {
1918
if isVisible {
@@ -102,25 +101,6 @@ final class PanelController {
102101
})
103102
}
104103

105-
func resizePanel(showPreview: Bool) {
106-
guard isVisible, let panel else { return }
107-
let screenFrame = (NSScreen.main ?? NSScreen.screens.first!).visibleFrame
108-
let targetHeight = showPreview ? baseHeight + previewHeight : baseHeight
109-
110-
let newFrame = NSRect(
111-
x: panel.frame.origin.x,
112-
y: screenFrame.origin.y,
113-
width: panel.frame.width,
114-
height: targetHeight
115-
)
116-
117-
NSAnimationContext.runAnimationGroup { context in
118-
context.duration = 0.25
119-
context.timingFunction = CAMediaTimingFunction(name: .easeInEaseOut)
120-
panel.animator().setFrame(newFrame, display: true)
121-
}
122-
}
123-
124104
// MARK: - Click Monitor (dismiss on outside click)
125105

126106
private func installClickMonitor() {
@@ -193,10 +173,18 @@ final class PanelController {
193173

194174
case 123: // Left arrow
195175
appState.searchState.moveSelection(by: -1, maxIndex: maxIndex)
176+
if appState.previewItem != nil,
177+
let idx = appState.searchState.selectedIndex, idx < items.count {
178+
appState.previewItem = items[idx]
179+
}
196180
return true
197181

198182
case 124: // Right arrow
199183
appState.searchState.moveSelection(by: 1, maxIndex: maxIndex)
184+
if appState.previewItem != nil,
185+
let idx = appState.searchState.selectedIndex, idx < items.count {
186+
appState.previewItem = items[idx]
187+
}
200188
return true
201189

202190
case 49: // Space - toggle preview

PasteClip/Views/HistoryPanelView.swift

Lines changed: 32 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,42 @@ struct HistoryPanelView: View {
1818
.padding(.top, 8)
1919
.padding(.bottom, 2)
2020

21-
if let previewItem = appState.previewItem {
22-
PreviewView(
23-
item: previewItem,
24-
onClose: {
25-
withAnimation(.easeOut(duration: 0.2)) {
26-
appState.searchState.selectedIndex = nil
27-
appState.selectForPreview(nil)
28-
}
29-
},
30-
onPaste: {
31-
appState.clipboardMonitor.skipNextChange()
32-
appState.pasteService.paste(item: previewItem)
33-
appState.hidePanel()
34-
}
35-
)
36-
}
37-
3821
NavigationBarView()
3922

4023
ZStack {
41-
CardGridView()
42-
.opacity(appState.selectedTab == .history ? 1 : 0)
43-
.allowsHitTesting(appState.selectedTab == .history)
24+
// Cards layer
25+
Group {
26+
CardGridView()
27+
.opacity(appState.selectedTab == .history ? 1 : 0)
28+
.allowsHitTesting(appState.selectedTab == .history)
4429

45-
if case .pinboard(let id) = appState.selectedTab {
46-
PinboardGridView(pinboardId: id)
47-
.id(id)
30+
if case .pinboard(let id) = appState.selectedTab {
31+
PinboardGridView(pinboardId: id)
32+
.id(id)
33+
}
34+
}
35+
.opacity(appState.previewItem == nil ? 1 : 0)
36+
37+
// Preview layer (replaces cards)
38+
if let previewItem = appState.previewItem {
39+
PreviewView(
40+
item: previewItem,
41+
onClose: {
42+
withAnimation(.easeOut(duration: 0.2)) {
43+
appState.searchState.selectedIndex = nil
44+
appState.selectForPreview(nil)
45+
}
46+
},
47+
onPaste: {
48+
appState.clipboardMonitor.skipNextChange()
49+
appState.pasteService.paste(item: previewItem)
50+
appState.hidePanel()
51+
}
52+
)
53+
.transition(.asymmetric(
54+
insertion: .opacity.combined(with: .scale(scale: 0.96, anchor: .bottom)),
55+
removal: .opacity.combined(with: .scale(scale: 0.98, anchor: .bottom))
56+
))
4857
}
4958
}
5059
}

PasteClip/Views/PreviewView.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ struct PreviewView: View {
2929
)
3030
.shadow(color: .black.opacity(0.15), radius: 20, y: 6)
3131
.shadow(color: .black.opacity(0.05), radius: 4, y: 2)
32-
.padding(.horizontal, 16)
33-
.padding(.top, 8)
32+
.padding(.horizontal, 12)
33+
.padding(.vertical, 4)
3434
.transition(.asymmetric(
3535
insertion: .opacity.combined(with: .scale(scale: 0.96, anchor: .bottom)),
3636
removal: .opacity.combined(with: .scale(scale: 0.98, anchor: .bottom))
@@ -137,7 +137,7 @@ struct PreviewView: View {
137137
colorPreview
138138
}
139139
}
140-
.frame(height: 200)
140+
.frame(maxHeight: .infinity)
141141
.clipped()
142142
}
143143

appcast.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,25 @@
55
<link>https://raw.githubusercontent.com/minsang-alt/PasteClip/main/appcast.xml</link>
66
<description>Most recent changes with links to updates.</description>
77
<language>en</language>
8+
<item>
9+
<title>Version 1.0.9</title>
10+
<sparkle:version>9</sparkle:version>
11+
<sparkle:shortVersionString>1.0.9</sparkle:shortVersionString>
12+
<description><![CDATA[
13+
<ul>
14+
<li>Improved spacebar preview: compact inline design, no panel resize</li>
15+
<li>Fixed preview state persisting after closing panel</li>
16+
<li>Arrow keys now update preview while browsing</li>
17+
</ul>
18+
]]></description>
19+
<pubDate>Thu, 03 Apr 2026 10:00:00 +0900</pubDate>
20+
<enclosure
21+
url="https://github.com/minsang-alt/PasteClip/releases/download/v1.0.9/PasteClip-1.0.9.dmg"
22+
type="application/octet-stream"
23+
sparkle:edSignature="ELLhH28XIxAM90KLqRdH/VH/mFGm7GBvAfd7XuDdoTOMcaTzKxFoJAuG9d1yurngXhGEtcXER1yEgmbTp1rGAg=="
24+
length="4620378"
25+
/>
26+
</item>
827
<item>
928
<title>Version 1.0.8</title>
1029
<sparkle:version>8</sparkle:version>

0 commit comments

Comments
 (0)