mirror of
https://github.com/delibae/claude-prism.git
synced 2026-10-10 03:27:52 +00:00
Merge pull request #64 from delibae/release/v1.0.5
fix: macOS WKWebView black screen on focus restore & bump v1.0.5
This commit is contained in:
commit
99ddd3c92e
7 changed files with 51 additions and 8 deletions
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@claude-prism/desktop",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "claude-prism-desktop"
|
||||
version = "1.0.4"
|
||||
version = "1.0.5"
|
||||
description = "AI-powered LaTeX writing workspace"
|
||||
edition = "2021"
|
||||
|
||||
|
|
|
|||
|
|
@ -320,6 +320,39 @@ pub fn run() {
|
|||
tauri::RunEvent::Ready => {
|
||||
set_macos_app_icon();
|
||||
}
|
||||
// Workaround: WKWebView sometimes fails to repaint after the app
|
||||
// returns from background, leaving a black screen. We apply two
|
||||
// complementary fixes on focus-restore:
|
||||
// 1. Nudge the window size by 1 px and back (forces native
|
||||
// compositing layer to re-composite).
|
||||
// 2. Trigger a DOM reflow via JS (forces WKWebView render tree
|
||||
// rebuild without losing app state).
|
||||
// Either one alone may not cover all cases.
|
||||
// See https://github.com/tauri-apps/tauri/issues/5226
|
||||
// https://github.com/tauri-apps/tauri/issues/14843
|
||||
#[cfg(target_os = "macos")]
|
||||
tauri::RunEvent::WindowEvent {
|
||||
ref label,
|
||||
event: tauri::WindowEvent::Focused(true),
|
||||
..
|
||||
} => {
|
||||
if let Some(window) = app_handle.get_webview_window(label) {
|
||||
// 1) Native resize nudge
|
||||
if let Ok(size) = window.inner_size() {
|
||||
let _ = window.set_size(tauri::Size::Physical(tauri::PhysicalSize {
|
||||
width: size.width + 1,
|
||||
height: size.height,
|
||||
}));
|
||||
let _ = window.set_size(tauri::Size::Physical(size));
|
||||
}
|
||||
// 2) DOM reflow to force WKWebView render tree rebuild
|
||||
let _ = window.eval(
|
||||
"document.body.style.display='none';\
|
||||
document.body.offsetHeight;\
|
||||
document.body.style.display='';"
|
||||
);
|
||||
}
|
||||
}
|
||||
tauri::RunEvent::WindowEvent {
|
||||
label,
|
||||
event: tauri::WindowEvent::Destroyed,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
"$schema": "https://raw.githubusercontent.com/nicegui-unofficial/nicegui-tauri-template/main/src-tauri/tauri.conf-v2-schema.json",
|
||||
"identifier": "com.claude-prism.desktop",
|
||||
"productName": "ClaudePrism",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"build": {
|
||||
"beforeDevCommand": "pnpm dev",
|
||||
"beforeBuildCommand": "pnpm build",
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
import { useState, useCallback, useMemo, useRef, useEffect } from "react";
|
||||
import { getVersion } from "@tauri-apps/api/app";
|
||||
import {
|
||||
FileTextIcon,
|
||||
FolderIcon,
|
||||
|
|
@ -181,13 +182,22 @@ function getFileIcon(file: ProjectFile) {
|
|||
return <FileTextIcon className="size-4 shrink-0" />;
|
||||
}
|
||||
|
||||
// ─── Constants ───
|
||||
// ─── App Version (resolved once from Tauri) ───
|
||||
|
||||
const APP_VERSION = "0.0.1";
|
||||
let _appVersion = "";
|
||||
getVersion().then((v) => { _appVersion = v; });
|
||||
function useAppVersion() {
|
||||
const [version, setVersion] = useState(_appVersion);
|
||||
useEffect(() => {
|
||||
if (!version) getVersion().then(setVersion);
|
||||
}, [version]);
|
||||
return version || "…";
|
||||
}
|
||||
|
||||
// ─── Sidebar ───
|
||||
|
||||
export function Sidebar() {
|
||||
const appVersion = useAppVersion();
|
||||
const files = useDocumentStore((s) => s.files);
|
||||
const activeFileId = useDocumentStore((s) => s.activeFileId);
|
||||
const setActiveFile = useDocumentStore((s) => s.setActiveFile);
|
||||
|
|
@ -717,7 +727,7 @@ export function Sidebar() {
|
|||
|
||||
{/* Footer */}
|
||||
<div className="flex items-center justify-between border-sidebar-border border-t px-3 py-2 text-muted-foreground text-xs">
|
||||
<span className="truncate">ClaudePrism v{APP_VERSION}</span>
|
||||
<span className="truncate">ClaudePrism v{appVersion}</span>
|
||||
<div className="flex shrink-0 items-center gap-1">
|
||||
<Button variant="ghost" size="icon" className="size-6" asChild>
|
||||
<a
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit feb097a96ff205f60f990fbc6493cb17cf2f63d5
|
||||
Subproject commit c3d8dbe5163603bc80a842145697e6bfe24d7a05
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@claude-prism/root",
|
||||
"description": "Open-Source AI LaTeX writing workspace",
|
||||
"version": "1.0.4",
|
||||
"version": "1.0.5",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/delibae/claude-prism"
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue