diff --git a/.erb/configs/webpack.config.renderer.dev.mts b/.erb/configs/webpack.config.renderer.dev.mts index 79e3da3..900794b 100644 --- a/.erb/configs/webpack.config.renderer.dev.mts +++ b/.erb/configs/webpack.config.renderer.dev.mts @@ -109,18 +109,21 @@ const configuration: webpack.Configuration = { __dirname: false, __filename: false, }, - devServer: { port, compress: true, hot: true, headers: { 'Access-Control-Allow-Origin': '*' }, + devMiddleware: { + writeToDisk: true, + }, static: { publicPath: '/', }, historyApiFallback: { verbose: true, }, + setupMiddlewares(middlewares) { console.log('Starting preload.js builder...'); const preloadProcess = spawn('npm', ['run', 'start:preload'], { diff --git a/src-rust/src/invokables/image.rs b/src-rust/src/invokables/image.rs index 7480e6b..12c435a 100644 --- a/src-rust/src/invokables/image.rs +++ b/src-rust/src/invokables/image.rs @@ -2,6 +2,7 @@ use crate::{invokables::Invokable, state::AppState}; use anyhow::{anyhow, Context, Result}; use image::RgbaImage; use serde::{Deserialize, Serialize}; +use std::io::BufReader; use stracciatella::file_formats::stci::{Stci, StciRgb888}; #[derive(Debug)] @@ -61,7 +62,7 @@ impl Invokable for Render { fn invoke(&self, state: &AppState) -> Result { let state = state.read(); - let mut f = state.open_file(&self.file).context("failed to read file")?; + let mut f = BufReader::new(state.open_file(&self.file).context("failed to read file")?); let stci = Stci::from_input(&mut f)?; let sub_image = self.subimage.unwrap_or(0); let size = match &stci { @@ -162,7 +163,7 @@ impl Invokable for ReadMetadata { fn invoke(&self, state: &AppState) -> Result { let state = state.read(); - let mut f = state.open_file(&self.file).context("failed to read file")?; + let mut f = BufReader::new(state.open_file(&self.file).context("failed to read file")?); let stci = Stci::from_input(&mut f)?; let images = match stci { Stci::Indexed { sub_images, .. } => sub_images diff --git a/src-rust/src/invokables/sounds.rs b/src-rust/src/invokables/sounds.rs index 8e818d4..e47da8c 100644 --- a/src-rust/src/invokables/sounds.rs +++ b/src-rust/src/invokables/sounds.rs @@ -1,6 +1,7 @@ use crate::{invokables::Invokable, state}; use anyhow::{anyhow, Context, Result}; use serde::{Deserialize, Serialize}; +use std::io::{BufReader, Read as _}; #[derive(Debug)] pub enum Base64Sound { @@ -47,7 +48,7 @@ impl Invokable for Read { fn invoke(&self, state: &state::AppState) -> Result { let state = state.read(); - let mut f = state.open_file(&self.file).context("failed to open file")?; + let mut f = BufReader::new(state.open_file(&self.file).context("failed to open file")?); let mut content = vec![]; f.read_to_end(&mut content).context("failed to read file")?; diff --git a/src/renderer/App.css b/src/renderer/App.css index 4f4e1f2..da555b8 100644 --- a/src/renderer/App.css +++ b/src/renderer/App.css @@ -2,10 +2,3 @@ body { overflow-x: hidden; overflow-y: hidden; } - -/* Fix cursor turning white while transitioning the input border color on Windows */ -body .ant-input-outlined, -body .ant-input-number-outlined, -body .ant-select-outlined .ant-select-selector { - transition: none !important; -} diff --git a/src/renderer/App.tsx b/src/renderer/App.tsx index c8e4607..2efcbb3 100644 --- a/src/renderer/App.tsx +++ b/src/renderer/App.tsx @@ -44,6 +44,8 @@ export function AppWithoutProviders() { const appStore = createAppStore(); const THEME_CONFIG: ThemeConfig = { token: { + // Disable all animations because of https://issues.chromium.org/issues/40239916 + motion: false, colorPrimary: '#9d1e1c', }, };