Skip to content

Commit 00d8c47

Browse files
authored
Merge pull request #209 from solaoi/main
v0.9.28
2 parents 5295107 + 90ddfca commit 00d8c47

File tree

14 files changed

+112
-44
lines changed

14 files changed

+112
-44
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Describe the bug**
11+
A clear and concise description of what the bug is.
12+
13+
**To Reproduce**
14+
Steps to reproduce the behavior:
15+
1. Go to '...'
16+
2. Click on '....'
17+
3. Scroll down to '....'
18+
4. See error
19+
20+
**Expected behavior**
21+
A clear and concise description of what you expected to happen.
22+
23+
**Screenshots**
24+
If applicable, add screenshots to help explain your problem.
25+
26+
**Mac Environment (please complete the following information):**
27+
- OS: [e.g. Sequoia 15.3.1, Sonoma 14.7.4]
28+
- CPU: [e.g. Intel, M1, M2, M3, M4]
29+
- Memory [e.g. 24GB]
30+
- StorageUsage [e.g. 256GB/1TB]
31+
32+
**Additional context**
33+
Add any other context about the problem here.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: ''
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "lycoris",
33
"private": true,
4-
"version": "0.9.27",
4+
"version": "0.9.28",
55
"type": "module",
66
"license": "MIT",
77
"engines": {

src-tauri/Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "lycoris"
3-
version = "0.9.27"
3+
version = "0.9.28"
44
description = "Lycoris is an offline voice memo"
55
authors = ["solaoi"]
66
license = "MIT"

src-tauri/tauri.conf.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
},
99
"package": {
1010
"productName": "Lycoris",
11-
"version": "0.9.27"
11+
"version": "0.9.28"
1212
},
1313
"tauri": {
1414
"allowlist": {

src/components/molecules/SettingModel.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ const SettingModel = (): JSX.Element => {
1212
}
1313

1414
return (
15-
<div className="flex items-center mb-2">
16-
<p className="w-[12rem]">利用モデル</p>
17-
<div className="flex flex-col w-full">
15+
<div className="flex items-center">
16+
<p className="mr-4">利用モデル</p>
17+
<div>
1818
<select className="select select-bordered focus:outline-none text-xs w-fit" name="setting-model" onChange={change} >
1919
{settingModels?.map((model, i) => (
2020
<option key={"setting-model" + i} value={model} selected={model === settingKey}>{model}</option>

src/components/molecules/SpeechHistory.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ const SpeechHistory = (props: SpeechHistoryProps): JSX.Element => {
101101
{c.action_type === "chat" &&
102102
<>
103103
<div className="chat chat-start">
104-
<div className="flex chat-bubble bg-white text-slate-500 shadow-sm">
104+
<div className="flex chat-bubble bg-white text-slate-500 shadow-sm w-full">
105105
<MyMarkdown content={c.content} title={`${selectedNote?.note_title.trim()}_action-start_${i}`} />
106106
</div>
107107
</div>
@@ -164,12 +164,12 @@ const SpeechHistory = (props: SpeechHistoryProps): JSX.Element => {
164164
{c.action_type === "tool" &&
165165
<>
166166
<div className="chat chat-start">
167-
<div className="flex chat-bubble bg-white text-slate-500 shadow-sm">
167+
<div className="flex chat-bubble bg-white text-slate-500 shadow-sm w-full">
168168
<MyMarkdown content={c.content} title={`${selectedNote?.note_title.trim()}_action-start_${i}`} />
169169
</div>
170170
</div>
171171
<div className="chat chat-end">
172-
<div className="flex chat-bubble bg-white text-slate-500 py-5 w-full relative shadow-sm">
172+
<div className="flex chat-bubble bg-white text-slate-500 py-5 w-full shadow-sm">
173173
{c.content_2 ?
174174
<ToolCard
175175
id={c.id!}

src/components/molecules/ToolCard.tsx

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
import { clipboard, invoke } from "@tauri-apps/api";
2-
import { useRef, useState } from "react";
3-
import { useRecoilState } from "recoil";
2+
import { useEffect, useRef, useState } from "react";
43
import { toast } from "react-toastify";
54

65
import DB from "../../lib/sqlite";
7-
import { showExecutedToolsState } from "../../store/atoms/showExecutedToolsState";
86
import { ArrowPath } from "../atoms/ArrowPath";
97
import { Check } from "../atoms/Check";
108
import { CheckBadge } from "../atoms/CheckBadge";
@@ -28,7 +26,10 @@ const ToolCard = ({ id, tool_results, note_id, note_title, clear, updateToolResu
2826
const [dialogName, setDialogName] = useState<string>("");
2927
const [dialogMethod, setDialogMethod] = useState<string>("");
3028
const [dialogDescription, setDialogDescription] = useState<string>("");
31-
const [showExecuted, setShowExecuted] = useRecoilState(showExecutedToolsState);
29+
const [showExecutedTool, setShowExecutedTool] = useState(false);
30+
useEffect(() => {
31+
setShowExecutedTool(false);
32+
}, [id]);
3233
const obj = (() => {
3334
try {
3435
return JSON.parse(tool_results) as { "is_required_user_permission": boolean, "content": string | null, "cmds": { "call_id": string, "args": Object, "name": string, "method": string, "description": string, "result": string | null }[] }
@@ -90,14 +91,14 @@ const ToolCard = ({ id, tool_results, note_id, note_title, clear, updateToolResu
9091
<div>
9192
{hasExecutedTools &&
9293
<button className="mt-4 mb-2 cursor-pointer flex items-center"
93-
onClick={() => setShowExecuted(!showExecuted)}>
94-
{showExecuted ?
94+
onClick={() => setShowExecutedTool(!showExecutedTool)}>
95+
{showExecutedTool ?
9596
<ChevronDown /> :
9697
<ChevronRight />
9798
}
9899
<span>実行済みのツール({executedTools}</span>
99100
</button>}
100-
{showExecuted && (
101+
{showExecutedTool && (
101102
cmds.filter(cmd => cmd.result !== null).reverse().map(({ call_id, args, name, method, description, result }) => {
102103
return (
103104
<div key={call_id} className="cursor-default h-full py-3 px-6 border border-neutral-300 rounded-md shadow mb-2">
@@ -152,14 +153,14 @@ const ToolCard = ({ id, tool_results, note_id, note_title, clear, updateToolResu
152153
<div>
153154
{hasExecutedTools &&
154155
<button className="mt-4 mb-2 cursor-pointer flex items-center"
155-
onClick={() => setShowExecuted(!showExecuted)}>
156-
{showExecuted ?
156+
onClick={() => setShowExecutedTool(!showExecutedTool)}>
157+
{showExecutedTool ?
157158
<ChevronDown /> :
158159
<ChevronRight />
159160
}
160161
<span>実行済みのツール({executedTools}</span>
161162
</button>}
162-
{showExecuted && (
163+
{showExecutedTool && (
163164
cmds.filter(cmd => cmd.result !== null).reverse().map(({ call_id, args, name, method, description, result }) => {
164165
return (
165166
<div key={call_id} className="cursor-default h-full py-3 px-6 border border-neutral-300 rounded-md shadow mb-2">

src/components/organisms/NoteFooter.tsx

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { AppWindow } from '../molecules/AppWindow'
66
import { ActionSet } from '../molecules/ActionSet'
77
import { settingKeyState } from '../../store/atoms/settingKeyState'
88
import { actionState } from '../../store/atoms/actionState'
9+
import { SettingModel } from '../molecules/SettingModel'
910

1011
type NoteFooterProps = {
1112
titleRef: React.RefObject<HTMLInputElement>
@@ -24,6 +25,8 @@ const NoteFooter = (props: NoteFooterProps): JSX.Element => {
2425
const selectedNote = useRecoilValue(selectedNoteState)
2526
const setHistories = useSetRecoilState(speechHistoryState(selectedNote!.note_id))
2627
const targetAction = useRecoilValue(actionState)
28+
const settingKey = useRecoilValue(settingKeyState("settingModel"))
29+
const dialogRef = useRef<HTMLDialogElement>(null)
2730
const update = (type: "memo" | "action", action_type?: "chat" | "suggest" | "tool") => {
2831
if (type === "memo") {
2932
if (inputValue === "") {
@@ -206,6 +209,38 @@ const NoteFooter = (props: NoteFooterProps): JSX.Element => {
206209
{!isMemo &&
207210
<div className={"flex flex-col items-center w-52" + (isMemo ? " hidden" : "")}>
208211
<ActionSet />
212+
{targetAction === "チャット" &&
213+
<div className="flex items-center absolute right-2 bottom-2 bg-base-100 border border-base-200 rounded-lg px-3 py-[2px] text-black/60 text-xs hover:shadow-inner shadow-sm">
214+
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" fill="currentColor" className="size-3">
215+
<path d="M6.5 2.25a.75.75 0 0 0-1.5 0v3a.75.75 0 0 0 1.5 0V4.5h6.75a.75.75 0 0 0 0-1.5H6.5v-.75ZM11 6.5a.75.75 0 0 0-1.5 0v3a.75.75 0 0 0 1.5 0v-.75h2.25a.75.75 0 0 0 0-1.5H11V6.5ZM5.75 10a.75.75 0 0 1 .75.75v.75h6.75a.75.75 0 0 1 0 1.5H6.5v.75a.75.75 0 0 1-1.5 0v-3a.75.75 0 0 1 .75-.75ZM2.75 7.25H8.5v1.5H2.75a.75.75 0 0 1 0-1.5ZM4 3H2.75a.75.75 0 0 0 0 1.5H4V3ZM2.75 11.5H4V13H2.75a.75.75 0 0 1 0-1.5Z" />
216+
</svg>
217+
<button className="ml-1" onClick={((e) => {
218+
e.stopPropagation();
219+
dialogRef.current?.showModal();
220+
})}>{settingKey}</button>
221+
<dialog
222+
ref={dialogRef}
223+
className="modal cursor-default"
224+
onClick={e => {
225+
e.stopPropagation();
226+
if (e.target === dialogRef.current) {
227+
dialogRef.current?.close();
228+
}
229+
}}
230+
>
231+
<div className="modal-box w-[320px]">
232+
<h3 className="font-bold text-lg">チャット利用モデルの変更</h3>
233+
<div className="mt-6 flex justify-end">
234+
<SettingModel />
235+
</div>
236+
<div className="modal-action">
237+
<form method="dialog">
238+
<button className="btn">OK</button>
239+
</form>
240+
</div>
241+
</div>
242+
</dialog>
243+
</div>}
209244
</div>
210245
}
211246
</div>

0 commit comments

Comments
 (0)