This commit is contained in:
jasongwq 2025-04-20 00:30:32 +00:00 committed by GitHub
commit 34ae72ba4f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 16 deletions

View File

@ -40,12 +40,6 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
config: config:
- os: ubuntu-latest
arch: x86_64
rust_target: x86_64-unknown-linux-gnu
- os: macos-latest
arch: aarch64
rust_target: x86_64-apple-darwin,aarch64-apple-darwin
- os: windows-latest - os: windows-latest
arch: x86_64 arch: x86_64
rust_target: x86_64-pc-windows-msvc rust_target: x86_64-pc-windows-msvc
@ -77,12 +71,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }} TAURI_PRIVATE_KEY: ${{ secrets.TAURI_PRIVATE_KEY }}
TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }} TAURI_KEY_PASSWORD: ${{ secrets.TAURI_KEY_PASSWORD }}
APPLE_CERTIFICATE: ${{ secrets.APPLE_CERTIFICATE }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
APPLE_SIGNING_IDENTITY: ${{ secrets.APPLE_SIGNING_IDENTITY }}
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_PASSWORD: ${{ secrets.APPLE_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
with: with:
releaseId: ${{ needs.create-release.outputs.release_id }} releaseId: ${{ needs.create-release.outputs.release_id }}
args: ${{ matrix.config.os == 'macos-latest' && '--target universal-apple-darwin' || '' }} args: ${{ matrix.config.os == 'macos-latest' && '--target universal-apple-darwin' || '' }}

View File

@ -995,6 +995,8 @@ function _Chat() {
const fontSize = config.fontSize; const fontSize = config.fontSize;
const fontFamily = config.fontFamily; const fontFamily = config.fontFamily;
const slashOffsetRef = useRef(0);
const [showExport, setShowExport] = useState(false); const [showExport, setShowExport] = useState(false);
const inputRef = useRef<HTMLTextAreaElement>(null); const inputRef = useRef<HTMLTextAreaElement>(null);
@ -1093,10 +1095,13 @@ function _Chat() {
setPromptHints([]); setPromptHints([]);
} else if (text.match(ChatCommandPrefix)) { } else if (text.match(ChatCommandPrefix)) {
setPromptHints(chatCommands.search(text)); setPromptHints(chatCommands.search(text));
} else if (!config.disablePromptHint && n < SEARCH_TEXT_LIMIT) { } else if (
!config.disablePromptHint &&
text.length < slashOffsetRef.current + SEARCH_TEXT_LIMIT
) {
// check if need to trigger auto completion // check if need to trigger auto completion
if (text.startsWith("/")) { if (text.slice(slashOffsetRef.current).startsWith("/")) {
let searchText = text.slice(1); let searchText = text.slice(slashOffsetRef.current + 1);
onSearch(searchText); onSearch(searchText);
} }
} }
@ -1134,7 +1139,7 @@ function _Chat() {
setUserInput(""); setUserInput("");
} else { } else {
// or fill the prompt // or fill the prompt
setUserInput(prompt.content); setUserInput(prompt.content + userInput.slice(0, slashOffsetRef.current));
} }
inputRef.current?.focus(); inputRef.current?.focus();
}, 30); }, 30);
@ -1185,6 +1190,8 @@ function _Chat() {
setUserInput(chatStore.lastInput ?? ""); setUserInput(chatStore.lastInput ?? "");
e.preventDefault(); e.preventDefault();
return; return;
} else if (e.key === "/") {
slashOffsetRef.current = userInput.length;
} }
if (shouldSubmit(e) && promptHints.length === 0) { if (shouldSubmit(e) && promptHints.length === 0) {
doSubmit(userInput); doSubmit(userInput);