Skip to content

fix(tauri): UI fixes - mic button state and window persistence#9

Merged
wilcorrea merged 22 commits intomainfrom
fix/tauri-ui-fixes
Feb 23, 2026
Merged

fix(tauri): UI fixes - mic button state and window persistence#9
wilcorrea merged 22 commits intomainfrom
fix/tauri-ui-fixes

Conversation

@wilcorrea
Copy link
Copy Markdown
Contributor

@wilcorrea wilcorrea commented Feb 23, 2026

Summary

  • Remove mic button state changes (color/animation) - now it's just a static link to open the recording window
  • Simplify CSS by removing unused recording state classes and animations
  • Fix window opening on startup without a document loaded
  • Enable window-state plugin to persist window position/size between sessions
  • Mark macOS native app as deprecated in CLAUDE.md (Tauri is now the primary version)
  • Add debug build support for macOS with "dev" version display

Changes

Tauri UI fixes

  • apps/tauri/src/main.js: Remove setRecordingState() function and event listeners that changed button appearance
  • apps/tauri/src/app.css: Remove .recording-active, .recording-processing classes and @keyframes pulse-recording
  • apps/tauri/src/index.html: Update mic button tooltip to "Open voice-to-text"
  • apps/tauri/src-tauri/src/lib.rs: Initialize tauri_plugin_window_state plugin

Documentation & macOS

  • CLAUDE.md: Mark macOS native app as deprecated, focus documentation on Tauri version
  • apps/macos/project.yml: Add BUNDLE_VERSION variable for Debug/Release configs
  • apps/macos/Info.plist: Use $(BUNDLE_VERSION) for dynamic version strings
  • apps/macos/Makefile: Add make dev and make build-debug targets

Test plan

  • Build and run Tauri: cd apps/tauri && npx tauri dev
  • Verify mic button maintains static gray color (no red/orange states)
  • Click mic button - recording window opens correctly
  • Close app without opening a file - window should NOT reopen on next launch
  • Open a markdown file, resize/move window, close app - window position/size should be restored on next launch
  • Verify CLAUDE.md clearly indicates macOS version is deprecated

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features

    • Outline scroll tracking: active section highlights and auto-scrolls into view.
    • Window maximize toggle enabled; additional window state controls.
  • UI/UX Improvements

    • Unified modal button styling and updated recording button title/behavior.
    • Increased toolbar spacing and stronger active-outline visuals.
  • Build & Development

    • New Makefile-driven Tauri workflow and a dev-build script for development versions; updated quick-start/build instructions.
    • Dynamic bundle versioning for debug/release builds.
  • Permissions

    • Microphone permission string added for voice-to-text transcription.
  • Deprecations

    • Native macOS app deprecated in favor of the Tauri-based app.

…opening

- Remove recording button color changes (now just a link to recording window)
- Simplify CSS by removing recording state classes and animations
- Fix window opening without document on startup
- Add BUNDLE_VERSION variable in project.yml (dev for Debug, 0.2.0 for Release)
- Update Info.plist to use $(BUNDLE_VERSION) for version strings
- Add 'make dev' and 'make build-debug' targets for Debug builds
- About panel now shows 'Version dev' in development builds
The Tauri version is now the primary and actively maintained version.
macOS native (apps/macos/) is no longer receiving updates.
The plugin was installed but not initialized. Now windows will save and restore their position/size between sessions.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 23, 2026

Warning

Rate limit exceeded

@wilcorrea has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 6 minutes and 55 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

📥 Commits

Reviewing files that changed from the base of the PR and between b72b06a and fa99890.

📒 Files selected for processing (2)
  • CLAUDE.md
  • apps/tauri/src-tauri/src/whisper/audio.rs
📝 Walkthrough

Walkthrough

This PR shifts the project to a Tauri‑centric architecture (deprecating the macOS native path), adds Makefile-driven build workflows and a git‑hash development build script, adjusts Tauri permissions and window‑state handling, updates the Whisper transcriber hint, and implements outline scroll‑tracking plus UI/CSS tweaks.

Changes

Cohort / File(s) Summary
Docs & Quick Start
CLAUDE.md, README.md
Consolidate docs around Tauri, deprecate macOS native path; rename Run locally → Quick Start; add Makefile-driven build commands and set-version guidance.
macOS app config & build
apps/macos/Makefile, apps/macos/Sources/Arandu/Info.plist, apps/macos/project.yml
Add dev and build-debug targets; make Info.plist bundle version dynamic via $(BUNDLE_VERSION); add Debug/Release BUNDLE_VERSION entries.
Tauri build tooling & scripts
apps/tauri/Makefile, scripts/build-dev.sh
Add Tauri Makefile (help/dev/build/build-dev/install/clean) and build-dev.sh to produce dev builds tagged with git hash and safely patch/restore config files.
Tauri config & backend
apps/tauri/src-tauri/capabilities/default.json, apps/tauri/src-tauri/src/lib.rs, apps/tauri/src-tauri/src/whisper/transcriber.rs
Add core:window:allow-toggle-maximize capability; register window_state plugin with denylist for "recording"; change Whisper language hint from "auto" to None.
Tauri UI & frontend logic
apps/tauri/src/app.css, apps/tauri/src/index.html, apps/tauri/src/main.js
UI: increase toolbar padding, active outline item styling, remove recording animation, normalize modal button classes. JS: add IntersectionObserver outline scroll‑tracking with lifecycle cleanup, toolbar double‑click maximize toggle, adjust recording state handling, await initial file load.
Plist / Entitlements
apps/tauri/src-tauri/Info.plist
Add NSMicrophoneUsageDescription explaining microphone use for voice‑to‑text.
Misc / packaging
package.json, other small edits...`
Minor manifest/packaging adjustments to align build and dev workflows.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Poem

🐰 A hop, a tweak, the Tauri way—
Makefiles hum and scripts display,
Headings watched as outlines scroll,
Versions named from git‑hash soul,
I nibble bugs and leap to play! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 14.29% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title captures the main fixes (UI updates to mic button state and window persistence), but the PR also includes significant secondary work: macOS native app deprecation, debug build support for macOS, documentation updates, and build infrastructure changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/tauri-ui-fixes

Comment @coderabbitai help to get the list of available commands and usage tips.

Replace modal-btn with btn and modal-btn-primary with btn-primary
to fix styling in dark theme.
The recording window should always start hidden, not restore previous visibility state.
Adds native macOS behavior - double-clicking the title bar toggles maximize/restore.
- Add apps/tauri/Makefile with targets: dev, build, build-dev, install, clean
- Add scripts/build-dev.sh for local builds with git hash (0.0.0-{hash})
- Update CLAUDE.md with Makefile usage and build documentation
- Local builds clearly show version 0.0.0-abc1234 to differentiate from releases
- Highlight current visible heading in outline sidebar
- Use IntersectionObserver to track scroll position
- Auto-scroll outline to keep active heading visible
- Add visual styling for active heading with border and color
Changed from Some("auto") to None as per whisper.cpp API specification for automatic language detection
Persist last active heading when scrolling between sections to prevent outline from losing active state
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
apps/macos/Makefile (1)

1-12: ⚠️ Potential issue | 🟡 Minor

Add dev to .PHONY to avoid file-name collisions.

Without this, a file named dev could prevent the target from running.

🔧 Proposed fix
-.PHONY: all generate build build-debug install install-script uninstall clean dist
+.PHONY: all generate build build-debug dev install install-script uninstall clean dist
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@apps/macos/Makefile` around lines 1 - 12, The .PHONY declaration currently
lists targets but omits the dev target, which can cause a real file named "dev"
to block running the dev recipe; update the .PHONY line to include dev (i.e.,
add "dev" to the list alongside all, generate, build, build-debug, install,
install-script, uninstall, clean, dist) so the dev target is always treated as
phony and not shadowed by a filesystem entry.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@apps/tauri/Makefile`:
- Around line 35-48: The install target in the Makefile currently copies
"$(BUNDLE_DIR)/$(APP_NAME)" into "$(APP_DEST)" but doesn't ensure the
destination exists; update the install recipe (install target) to create the
"$(APP_DEST)" directory (and parent directories if needed) before running cp -R,
and likewise ensure the "$(CLI_DEST)" directory exists prior to copying the CLI
script; modify the install target commands to run a mkdir -p on "$(APP_DEST)"
(and on the directory portion of "$(CLI_DEST)" if different) so cp won't fail on
fresh machines/CI.

In `@CLAUDE.md`:
- Around line 53-54: The documentation line for scripts/set-version.sh omits
that Info.plist is updated; update the CLAUDE.md entry that currently lists
"updates Cargo.toml, tauri.conf.json, package.json" to include Info.plist as
well so it reads that scripts/set-version.sh updates Info.plist, Cargo.toml,
tauri.conf.json, and package.json; reference the script name
scripts/set-version.sh and the config file names Info.plist, Cargo.toml,
tauri.conf.json, package.json when making the change.

---

Outside diff comments:
In `@apps/macos/Makefile`:
- Around line 1-12: The .PHONY declaration currently lists targets but omits the
dev target, which can cause a real file named "dev" to block running the dev
recipe; update the .PHONY line to include dev (i.e., add "dev" to the list
alongside all, generate, build, build-debug, install, install-script, uninstall,
clean, dist) so the dev target is always treated as phony and not shadowed by a
filesystem entry.

Comment thread apps/tauri/Makefile
Comment thread CLAUDE.md Outdated
@wilcorrea
Copy link
Copy Markdown
Contributor Author

Sobre o comentario outside-diff do CodeRabbit (adicionar dev ao .PHONY no apps/macos/Makefile): implementado em 9818cd2.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@CLAUDE.md`:
- Around line 42-49: The "Local development builds" section references
./scripts/build-dev.sh but doesn't state the required working directory; update
the doc near the "Local development builds:" header to add a single-line cue
that scripts/build-dev.sh must be run from the repository root (e.g., "Run this
from the repo root: cd <repo-root> && ./scripts/build-dev.sh") so readers don't
mistakenly run it from apps/tauri; mention the script path
"scripts/build-dev.sh" and the command " ./scripts/build-dev.sh" explicitly to
make it unambiguous.

---

Duplicate comments:
In `@apps/tauri/Makefile`:
- Around line 35-49: The install target can fail because the CLI destination
directory may not exist; update the install recipe (install target) to create
the CLI destination directory before copying the script by running mkdir -p
"$(CLI_DEST)" (or mkdir -p "$(CLI_DIR)" if you keep a directory variable) prior
to sudo cp and chmod so that the CLI copy commands using CLI_DEST succeed;
modify the block that checks for "../../scripts/arandu" to first ensure the
destination directory exists, then copy and chmod the file.

Comment thread CLAUDE.md
macOS requires NSMicrophoneUsageDescription in Info.plist for apps
that access the microphone. Without it, the system silently blocks
microphone access when the app is launched via Finder/Spotlight,
causing Whisper transcription to return [BLANK_AUDIO].

The app worked when launched from terminal because it inherited
permissions from Terminal.app.
Implements Drop trait for AudioRecorder to explicitly close the
audio stream when the recorder is destroyed. Adds a 100ms delay
after stopping the stream to give macOS time to update the
microphone indicator icon in the menu bar.

This prevents the microphone icon from staying active after
recording is stopped or cancelled.
@wilcorrea
Copy link
Copy Markdown
Contributor Author

✅ Implementado em 004c926

Adicionado comentário clarificando que ./scripts/build-dev.sh deve ser executado da raiz do repositório.

Ref: #9 (comment)

Calls stream.pause() before dropping to ensure the audio device
is properly released. Increases delay from 100ms to 200ms to give
macOS more time to update the microphone indicator in the menu bar.

Applies to both stop() method and Drop trait implementation.
@wilcorrea wilcorrea merged commit 05f835a into main Feb 23, 2026
@wilcorrea wilcorrea deleted the fix/tauri-ui-fixes branch February 23, 2026 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant