Skip to content

Commit 2341e04

Browse files
committed
fix: hotkey focus steal, toggle-to-close, update changelog
- Sidebar now takes keyboard focus immediately on open (no manual click needed) - Pressing the hotkey while sidebar is open closes it - CHANGELOG updated for v1.3.2
1 parent 572fca4 commit 2341e04

3 files changed

Lines changed: 30 additions & 40 deletions

File tree

CHANGELOG.md

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -9,38 +9,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
99

1010
## [1.3.2] - 2026-04-15
1111

12-
### Fixed
13-
- **Installer .NET detection** — Detection now checks six distinct locations (system-wide
14-
64-bit path, hard-coded `C:\Program Files\dotnet`, 32-bit path, per-user install path,
15-
registry `HKLM\SOFTWARE\dotnet\Setup\...`, and WOW6432Node). If all checks fail but
16-
the user knows .NET is installed, a new "Continue anyway" option lets them proceed
17-
without being hard-blocked.
18-
- **Item outlines / pointy corners** — WPF's default dotted focus rectangle (grey square
19-
outline around selected items) is suppressed via `FocusVisualStyle="{x:Null}"`. Item
20-
corners are now rounded (6 px radius) with no border, giving a clean card look.
21-
- **Search icon** — Replaced emoji with native Segoe MDL2 Assets glyph (``).
22-
Crisp at all DPI settings.
23-
- **Sidebar background on Windows 11** — Acrylic backdrop no longer overwrites the dark
24-
`#CC1A1A1A` theme with a washed-out system grey tint.
25-
- **Standalone EXE** — Native DLLs (SQLite, WPF) are now embedded; standalone no longer
26-
crashes on launch.
27-
- **Uninstaller** — ClipHive is forcefully terminated via `taskkill` before file removal,
28-
ensuring a clean uninstall with no locked-file errors.
29-
- **Duplicate clipboard entries** — Copying the same content multiple times no longer adds
30-
duplicate rows. The existing entry is bumped to the top (timestamp updated) using a
31-
SHA-256 content hash — no decryption overhead on copy.
12+
### Added
13+
- **Per-item delete button** — Each clipboard entry now has a × button to remove it instantly
14+
- **Pin toggle** — Click the pin icon on any item to keep it at the top; click again to unpin
15+
- **Hotkey toggle** — Pressing Ctrl+Shift+V while the sidebar is open now closes it
3216

33-
### Changed
34-
- **Two release artifacts:**
35-
- **Setup installer** (~20 MB) — framework-dependent; requires .NET 8 Windows Desktop
36-
Runtime. Installer checks multiple locations and offers "Continue anyway" if auto-
37-
detection cannot find an existing install.
38-
- **Standalone EXE** (~90 MB) — fully self-contained with compressed runtime; no .NET
39-
installation required.
40-
41-
### Build
42-
- Replaced `ICSharpCode.AvalonEdit` (unavailable on NuGet) with a plain read-only
43-
`TextBox` for the code detail panel. Feature is identical — scrollable monospace view.
17+
### Fixed
18+
- **Keyboard focus on open** — Typing works immediately after opening with Ctrl+Shift+V; no need to click the window first
19+
- **Image duplicates** — Copying the same image no longer creates duplicate entries on each reopen
20+
- **Window rounded corners** — Eliminated grey anti-aliasing on the window's rounded corners
21+
- **Item separation** — Clipboard items now appear as distinct cards with visible spacing
22+
- **Arrow key navigation** — Up/Down keys now work reliably after clicking an item
23+
- **Installer .NET detection** — Checks six locations before prompting; offers "Continue anyway" instead of blocking
24+
- **Uninstaller cleanup** — Uninstalling now removes all files including any added after installation
25+
- **Dark tooltip** — Hover tooltips now match the dark theme instead of showing a white popup
4426

4527
## [1.3.0] - 2026-04-15
4628

src/ClipHive/App.xaml.cs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,8 @@ private void ShowSidebar()
200200
{
201201
if (_sidebar is not null)
202202
{
203-
// Already open — bring to front.
204-
_sidebar.Activate();
203+
// Already open — toggle: pressing the hotkey again closes it.
204+
_sidebar.Close();
205205
return;
206206
}
207207

@@ -217,6 +217,10 @@ private void ShowSidebar()
217217

218218
_sidebar.Closed += (_, _) => _sidebar = null;
219219
_sidebar.Show();
220+
// Explicitly steal foreground — Show() alone does not move keyboard focus
221+
// from the previous app because the hotkey fires on a hidden HWND, not on
222+
// a visible foreground window.
223+
_sidebar.Activate();
220224
}
221225

222226
private void OpenSettings()

src/ClipHive/Views/SidebarWindow.xaml.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,19 @@ private IntPtr WndProc(IntPtr hwnd, int msg, IntPtr wParam,
124124

125125
private void Window_Loaded(object sender, RoutedEventArgs e)
126126
{
127-
SearchBox.Focus();
128-
Keyboard.Focus(SearchBox);
129-
130-
// Enable deactivation-close only after the dispatcher has fully rendered
131-
// the window. This prevents the hotkey's own keypress from immediately
132-
// deactivating the window before the user sees it.
127+
// Defer focus and _isReady to Input priority so:
128+
// • The Ctrl+Shift+V key-up event has already been processed (no stray deactivation).
129+
// • Activate() runs after the window is fully shown, so SetForegroundWindow succeeds
130+
// and SearchBox.Focus() actually lands keyboard input in this window.
133131
Dispatcher.BeginInvoke(
134132
System.Windows.Threading.DispatcherPriority.Input,
135-
new Action(() => _isReady = true));
133+
new Action(() =>
134+
{
135+
Activate();
136+
SearchBox.Focus();
137+
Keyboard.Focus(SearchBox);
138+
_isReady = true;
139+
}));
136140
}
137141

138142
// Keep Deactivated as a secondary safety net for edge cases the WndProc misses.

0 commit comments

Comments
 (0)