fix: working drawing state (checkpoint)#2
Merged
Conversation
Root causes fixed: - tauri.conf.json: fullscreen:true + transparent:true on macOS forced opaque black backing layer. Switch to fullscreen:false + maximized:false. - skipTaskbar:false so overlay window can receive keyboard focus. - capabilities: add set-ignore-cursor-events, set-position, set-size, current-monitor permissions (were missing -> click-through + geometry calls silently failed). - lib.rs show_overlay(): explicitly position window to current monitor origin+size (fixes maximized/center conflict leaving window at -240,30), re-assert always-on-top, log results. - lib.rs do_toggle_draw_mode(): switch activation policy Regular<->Accessory so the overlay can become key window and capture mouse while drawing. - lib.rs: add debug logging for shortcut registration/toggle. - +page.svelte: add manual toggle button + debug overlay (work-in-progress while global shortcut capture is unreliable without Accessibility perm), sync initial draw mode from backend via is_draw_mode. Known issue: global shortcut Option+Shift+D not reaching app from physical keyboard (likely needs Accessibility/Input Monitoring permission). Manual toggle button added as workaround during dev. Follows PR #1 on develop.
- Toolbar: vertical layout, docked right-center on first paint, draggable. - Replace emoji icons with @lucide/svelte (Pen, Highlighter, Eraser, Undo2, Trash2, X). - Hover reveals keyboard shortcut badge on each tool button. - Remove debug overlay + dev toggle button from +page.svelte. - Add FAB (floating action button) bottom-right to enter draw mode. - Keyboard shortcuts: Esc=exit, P/H/E=tool, Cmd+Z=undo. - Startup click-through disabled so manual controls stay clickable.
- Startup: set_activation_policy(Regular) + show + set_focus + geometry + always_on_top so overlay is frontmost and clickable immediately. - Keep click-through OFF on exit-draw-mode so FAB/tray can re-enter. - Toolbar: replace emoji icons with @lucide/svelte (Pen, Highlighter, Eraser, Undo2, Trash2, X) at size=16. No logic changes. - Dev logging in toggle_draw_mode command for debugging phantom events.
…ugh false Rollback semua perubahan UI/lucide yang bikin toolbar hilang & click gagal. Kembali ke commit 7b2be16 state (emoji icons, debug overlay, toggle button) + startup click-through false (fix yang membuat drawing bisa dipakai).
Shortcut global Alt+Shift+D memicu toggle berulang tanpa input user, membatalkan klik tombol manual. Disable selama dev.
Kondisi working (drawing jalan): - startup: apply_click_through(false) + activation policy Regular - do_toggle: show_overlay() geometry, exit keep clickable + Regular - shortcut global disabled (phantom toggle) - UI: emoji toolbar + debug overlay + toggle button - page.svelte: pdown/strokes counter di debug untuk tracing pointer events
- show_overlay: collapse nested if let Ok+Some menjadi if let Ok(Some(monitor)) - startup: hapus let _ = pada app.set_activation_policy (App::method return unit, AppHandle::method return Result). do_toggle tetap pakai let _ = karena app: &AppHandle -> Result.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Checkpoint kondisi drawing yang sudah working sebelum lanjut polish UI (lucide, vertical toolbar, posisi kanan tengah).
Root causes yang diperbaiki
1. Black screen (overlay opaque)
fullscreen: true+transparent: truedi macOS = opaque black backing layerfullscreen: false,maximized: false,skipTaskbar: false2. Drawing tidak bisa (pointer events bocor)
apply_click_through(true)= window click-through = klik tidak sampai canvasapply_click_through(false)+set_activation_policy(Regular)3. Window geometry salah
maximized: true+center: truekonflik → window di posisi(-240, 30)show_overlay()daricurrent_monitor()4. Capabilities kurang
set-ignore-cursor-events,set-position,set-size,current-monitorbelum di-allowcapabilities/default.json5. Phantom toggle (shortcut global)
Alt+Shift+Dter-trigger berulang tanpa input user → toggle ON/OFF sendiriCara pakai (dev)
bun run tauri devTODO berikutnya (branch lain)
Test