Skip to content

Commit

Permalink
Merge pull request #134 from solaoi/main
Browse files Browse the repository at this point in the history
v0.9.10
  • Loading branch information
solaoi authored Apr 14, 2024
2 parents 0683637 + e578ace commit fa017ef
Show file tree
Hide file tree
Showing 22 changed files with 687 additions and 666 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: main

on:
push:
branches:
- main

jobs:
contrib-readme-job:
runs-on: ubuntu-latest
name: A job to automate contrib in readme
steps:
- name: Contribute List
uses: akhilmhdh/contributors-readme-action@v2.3.6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 0 additions & 5 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,3 @@ jobs:
releaseDraft: true
prerelease: false
args: --target aarch64-apple-darwin

- name: Contribute List
uses: akhilmhdh/contributors-readme-action@v2.3.6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,4 +81,21 @@ yarn tauri build
## Contributors

<!-- readme: contributors -start -->
<table>
<tr>
<td align="center">
<a href="https://github.com/solaoi">
<img src="https://avatars.githubusercontent.com/u/46414076?v=4" width="100;" alt="solaoi"/>
<br />
<sub><b>Solaoi</b></sub>
</a>
</td>
<td align="center">
<a href="https://github.com/mohemohe">
<img src="https://avatars.githubusercontent.com/u/5028163?v=4" width="100;" alt="mohemohe"/>
<br />
<sub><b>Mohemohe</b></sub>
</a>
</td></tr>
</table>
<!-- readme: contributors -end -->
32 changes: 16 additions & 16 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "lycoris",
"private": true,
"version": "0.9.9",
"version": "0.9.10",
"type": "module",
"license": "MIT",
"engines": {
Expand All @@ -16,27 +16,27 @@
"debug:rs": "RUST_BACKTRACE=1 tauri dev --verbose"
},
"dependencies": {
"@tauri-apps/api": "^1.2.0",
"dayjs": "^1.11.7",
"@tauri-apps/api": "^1.5.3",
"dayjs": "^1.11.10",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-h5-audio-player": "^3.8.6",
"react-h5-audio-player": "^3.9.1",
"recoil": "^0.7.7",
"tauri-plugin-sql-api": "github:tauri-apps/tauri-plugin-sql#release",
"zenn-content-css": "^0.1.141",
"zenn-markdown-html": "^0.1.141"
"zenn-content-css": "^0.1.153",
"zenn-markdown-html": "^0.1.153"
},
"devDependencies": {
"@tauri-apps/cli": "^1.5.11",
"@types/markdown-it": "^13.0.7",
"@types/react": "^18.0.29",
"@types/react-dom": "^18.0.11",
"@vitejs/plugin-react": "^3.1.0",
"autoprefixer": "^10.4.14",
"daisyui": "^2.52.0",
"postcss": "^8.4.31",
"tailwindcss": "^3.2.7",
"typescript": "^5.0.2",
"vite": "^4.2.3"
"@types/markdown-it": "^14.0.0",
"@types/react": "^18.2.77",
"@types/react-dom": "^18.2.25",
"@vitejs/plugin-react": "^4.2.1",
"autoprefixer": "^10.4.19",
"daisyui": "^3.9.4",
"postcss": "^8.4.38",
"tailwindcss": "^3.4.3",
"typescript": "^5.4.5",
"vite": "^5.2.8"
}
}
12 changes: 6 additions & 6 deletions src-tauri/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions src-tauri/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lycoris"
version = "0.9.9"
version = "0.9.10"
description = "Lycoris is an offline voice memo"
authors = ["solaoi"]
license = "MIT"
Expand Down Expand Up @@ -44,9 +44,9 @@ objc-foundation = "0.1"
objc_id = "0.1"

[target.'cfg(target_arch = "x86_64")'.dependencies]
whisper-rs = { version = "0.10.0" }
whisper-rs = { version = "0.11.1", features = ["metal"] }
[target.'cfg(target_arch = "aarch64")'.dependencies]
whisper-rs = { version = "0.10.0", features = ["coreml"] }
whisper-rs = { version = "0.11.1", features = ["metal", "coreml"] }

[dependencies.tauri-plugin-sql]
git = "https://github.com/tauri-apps/plugins-workspace"
Expand Down
6 changes: 5 additions & 1 deletion src-tauri/src/module/deleter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ impl NoteDeleter {
let sqlite = Sqlite::new();
let speeches = sqlite.select_all_speeches_by(note_id).unwrap();
let _ = speeches.iter().for_each(|speech| {
remove_file(&speech.wav).expect("File delete failed");
if speech.wav != "" {
if let Err(e) = remove_file(&speech.wav) {
eprintln!("Failed to delete file {}: {}", &speech.wav, e);
}
}
});

let _ = sqlite.delete_speeches_by(note_id);
Expand Down
2 changes: 1 addition & 1 deletion src-tauri/tauri.conf.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
},
"package": {
"productName": "Lycoris",
"version": "0.9.9"
"version": "0.9.10"
},
"tauri": {
"allowlist": {
Expand Down
17 changes: 14 additions & 3 deletions src/components/Header.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,30 @@
import { useSetRecoilState } from "recoil"
import { getVersion } from '@tauri-apps/api/app';
import { featureState } from "../store/atoms/featureState"
import { selectedNoteState } from "../store/atoms/selectedNoteState"
import { AudioDevices } from "./molecules/AudioDevice"
import { SpeakerLanguage } from "./molecules/SpeakerLanguage"
import { TranscriptionAccuracy } from "./molecules/TranscriptionAccuracy"
import { useEffect, useState } from "react";

const Header = (): JSX.Element => {
const setFeature = useSetRecoilState(featureState)
const setSelectedNote = useSetRecoilState(selectedNoteState);
const [appVersion, setAppVersion] = useState<string | null>(null);
useEffect(() => {
const fetchVersion = async () => {
const version = await getVersion();
setAppVersion(version);
};
fetchVersion();
}, []);

return (
<header className="sticky top-0 z-10" style={{ minWidth: "770px", height: "64px" }}>
<div className="navbar bg-base-200">
<div className="flex-1">
<a className="ml-2 font-bold text-xl text-primary select-none" href="https://github.com/solaoi/lycoris" target="_blank">Lycoris</a>
<div className="flex flex-1 items-baseline select-none">
<a className="ml-2 font-bold text-xl text-primary mr-1" href="https://github.com/solaoi/lycoris" target="_blank">Lycoris</a>
<p className="text-xs text-slate-500">v{appVersion}</p>
</div>
<div className="flex-none mr-1">
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" className="w-5 h-5">
Expand All @@ -38,7 +49,7 @@ const Header = (): JSX.Element => {
<path d="M5.5 9.643a.75.75 0 00-1.5 0V10c0 3.06 2.29 5.585 5.25 5.954V17.5h-1.5a.75.75 0 000 1.5h4.5a.75.75 0 000-1.5h-1.5v-1.546A6.001 6.001 0 0016 10v-.357a.75.75 0 00-1.5 0V10a4.5 4.5 0 01-9 0v-.357z" />
</svg>
</div>
<div className="flex-none mr-2">
<div className="flex-none mr-4">
<AudioDevices />
</div>
<div className="group cursor-pointer select-none flex-none mr-2" onClick={() => { setFeature("settings"); setSelectedNote(null); }}>
Expand Down
6 changes: 3 additions & 3 deletions src/components/molecules/AudioDevice.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ const AudioDevices = (): JSX.Element => {
style={{ backgroundColor: "hsl(var(--b1) / var(--tw-bg-opacity))", border: "1px solid hsl(var(--bc) / 0.2)" }}
>
<li>
<div className="bg-inherit">
<div className="!bg-inherit">
<label className="cursor-pointer label">
<span className="label-text inline-flex">
<span className="mr-2">
Expand All @@ -140,7 +140,7 @@ const AudioDevices = (): JSX.Element => {
<>
<hr />
<li>
<div className="bg-inherit">
<div className="!bg-inherit">
<label className="cursor-pointer label">
<span className="label-text inline-flex">
<span className="mr-2">
Expand All @@ -159,7 +159,7 @@ const AudioDevices = (): JSX.Element => {
style={{ borderTopLeftRadius: 0, borderTopRightRadius: 0 }}>
{audioDevices.map((device, i) => (
<li key={"audio-device_" + i}>
<label className="label inline-flex active:bg-inherit">
<label className="label inline-flex active:!bg-inherit">
<input type="radio" name="device-option" className="radio radio-accent" onChange={change} value={device.label} defaultChecked={audioDevice === device.label} />
<a className="grow">{device.label}</a>
</label>
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/ModelDownloadVoskButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const ModelDownloadVoskButton = (props: Props): JSX.Element => {
const is_downloading = downloadingModels.filter(m => m === modelType).length > 0

return (
<button className="btn gap-2 glass text-secondary select-none" onClick={click} disabled={is_downloaded || is_downloading}>
<button className="btn gap-2 glass border border-solid border-neutral-300 text-secondary select-none" onClick={click} disabled={is_downloaded || is_downloading}>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor" className="w-6 h-6">
<path strokeLinecap="round" strokeLinejoin="round" d="M9 12.75l3 3m0 0l3-3m-3 3v-7.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/ModelDownloadWhisperButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const ModelDownloadWhisperButton = (props: Props): JSX.Element => {
const is_downloading = downloadingModels.filter(m => m === modelType).length > 0

return (
<button className="btn gap-2 glass text-secondary select-none" onClick={click} disabled={is_downloaded || is_downloading}>
<button className="btn glass border border-solid border-neutral-300 gap-2 text-secondary select-none" onClick={click} disabled={is_downloaded || is_downloading}>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth="1.5" stroke="currentColor" className="w-6 h-6">
<path strokeLinecap="round" strokeLinejoin="round" d="M9 12.75l3 3m0 0l3-3m-3 3v-7.5M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
</svg>
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/NoteDeleteButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const NoteDeleteButton = (props: NoteDeleteProps): JSX.Element => {
}, []);

return (
<button className={(hidden ? "" : "hidden ") + "btn gap-2 glass text-secondary animate-spread hover:bg-white"} onClick={(e => {
<button className={(hidden ? "" : "hidden ") + "btn gap-2 glass border border-solid border-neutral-300 text-secondary animate-spread hover:bg-white"} onClick={(e => {
animateAction();
const id = setTimeout(() => {
deleteAction(e);
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/RecordPreparingButton.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const RecordPreparingButton = (): JSX.Element => {
return (
<button className="btn gap-2 glass text-secondary" disabled>
<button className="btn gap-2 glass border border-solid border-neutral-300 text-secondary" disabled>
<div className="radial-progress animate-spin-slow" style={{ "--value": 85, "--size": "1.4rem", "--thickness": "2px" } as React.CSSProperties} />
録音準備中
</button>
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/RecordStartButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const RecordStartButton = (): JSX.Element => {
}

return (
<button className="btn gap-2 glass text-primary" disabled={(deviceLabel === null && !hasDesktopAudio) || speakerLanguage === null || isTracing || (isRecording && recordingNote !== selectedNote?.note_id)} onClick={click}>
<button className="btn gap-2 glass border border-solid border-neutral-300 text-primary" disabled={(deviceLabel === null && !hasDesktopAudio) || speakerLanguage === null || isTracing || (isRecording && recordingNote !== selectedNote?.note_id)} onClick={click}>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor" className="w-6 h-6">
<path strokeLinecap="round" strokeLinejoin="round" d="M12 18.75a6 6 0 006-6v-1.5m-6 7.5a6 6 0 01-6-6v-1.5m6 7.5v3.75m-3.75 0h7.5M12 15.75a3 3 0 01-3-3V4.5a3 3 0 116 0v8.25a3 3 0 01-3 3z" />
</svg>
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/RecordStopButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const RecordStopButton = (): JSX.Element => {
}

return (
<button className="btn gap-2 glass text-secondary" onClick={click}>
<button className="btn gap-2 glass border border-solid border-neutral-300 text-secondary" onClick={click}>
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" strokeWidth={1.5} stroke="currentColor" className="w-6 h-6">
<path strokeLinecap="round" strokeLinejoin="round" d="M5.25 7.5A2.25 2.25 0 017.5 5.25h9a2.25 2.25 0 012.25 2.25v9a2.25 2.25 0 01-2.25 2.25h-9a2.25 2.25 0 01-2.25-2.25v-9z" />
</svg>
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/SettingModel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useRecoilState } from 'recoil';
import { settingKeyState } from "../../store/atoms/settingKeyState";

const SettingModel = (): JSX.Element => {
const settingModels = ["gpt-3.5-turbo", "gpt-3.5-turbo-1106", "gpt-4", "gpt-4-1106-preview", "gpt-4-turbo-preview"]
const settingModels = ["gpt-3.5-turbo", "gpt-3.5-turbo-1106", "gpt-4", "gpt-4-1106-preview", "gpt-4-turbo-preview", "gpt-4-turbo"]
const [settingKey, setSettingKey] = useRecoilState(settingKeyState("settingModel"))

const change = (e: ChangeEvent<HTMLSelectElement>) => {
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/SpeakerLanguage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ const SpeakerLanguage = (): JSX.Element => {
{downloadedModels.length > 0 && <ul className="max-h-56 overflow-y-scroll rounded-box scrollbar-transparent">
{downloadedModels.map((model, i) => (
<li key={"speaker-language_" + i}>
<label className="label inline-flex active:bg-inherit">
<label className="label inline-flex active:!bg-inherit">
<input type="radio" name="language-option" className="radio radio-accent" onChange={change} value={model} checked={model === speakerLanguage} />
<a className="grow">{mapModel(model)}</a>
</label>
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/TraceStartButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const TraceStartButton = (): JSX.Element => {
}, [recordingNote])

return (
<button className="btn gap-2 glass text-warning" onClick={click} disabled={transcriptionAccuracy === "off" || isRecording || isTracing || !isTracable}>
<button className="btn gap-2 glass border border-solid border-neutral-300 text-warning" onClick={click} disabled={transcriptionAccuracy === "off" || isRecording || isTracing || !isTracable}>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" className="w-6 h-6">
<path d="M15.98 1.804a1 1 0 00-1.96 0l-.24 1.192a1 1 0 01-.784.785l-1.192.238a1 1 0 000 1.962l1.192.238a1 1 0 01.785.785l.238 1.192a1 1 0 001.962 0l.238-1.192a1 1 0 01.785-.785l1.192-.238a1 1 0 000-1.962l-1.192-.238a1 1 0 01-.785-.785l-.238-1.192zM6.949 5.684a1 1 0 00-1.898 0l-.683 2.051a1 1 0 01-.633.633l-2.051.683a1 1 0 000 1.898l2.051.684a1 1 0 01.633.632l.683 2.051a1 1 0 001.898 0l.683-2.051a1 1 0 01.633-.633l2.051-.683a1 1 0 000-1.898l-2.051-.683a1 1 0 01-.633-.633L6.95 5.684zM13.949 13.684a1 1 0 00-1.898 0l-.184.551a1 1 0 01-.632.633l-.551.183a1 1 0 000 1.898l.551.183a1 1 0 01.633.633l.183.551a1 1 0 001.898 0l.184-.551a1 1 0 01.632-.633l.551-.183a1 1 0 000-1.898l-.551-.184a1 1 0 01-.633-.632l-.183-.551z" />
</svg>
Expand Down
2 changes: 1 addition & 1 deletion src/components/molecules/TraceStopButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ const TraceStopButton = (): JSX.Element => {
}, [])

return (
<button className="btn gap-2 glass text-secondary" onClick={click} disabled={transcriptionAccuracy === "off"}>
<button className="btn gap-2 glass border border-solid border-neutral-300 text-secondary" onClick={click} disabled={transcriptionAccuracy === "off"}>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" className="w-6 h-6">
<path d="M15.98 1.804a1 1 0 00-1.96 0l-.24 1.192a1 1 0 01-.784.785l-1.192.238a1 1 0 000 1.962l1.192.238a1 1 0 01.785.785l.238 1.192a1 1 0 001.962 0l.238-1.192a1 1 0 01.785-.785l1.192-.238a1 1 0 000-1.962l-1.192-.238a1 1 0 01-.785-.785l-.238-1.192zM6.949 5.684a1 1 0 00-1.898 0l-.683 2.051a1 1 0 01-.633.633l-2.051.683a1 1 0 000 1.898l2.051.684a1 1 0 01.633.632l.683 2.051a1 1 0 001.898 0l.683-2.051a1 1 0 01.633-.633l2.051-.683a1 1 0 000-1.898l-2.051-.683a1 1 0 01-.633-.633L6.95 5.684zM13.949 13.684a1 1 0 00-1.898 0l-.184.551a1 1 0 01-.632.633l-.551.183a1 1 0 000 1.898l.551.183a1 1 0 01.633.633l.183.551a1 1 0 001.898 0l.184-.551a1 1 0 01.632-.633l.551-.183a1 1 0 000-1.898l-.551-.184a1 1 0 01-.633-.632l-.183-.551z" />
</svg>
Expand Down
Loading

0 comments on commit fa017ef

Please sign in to comment.