fix: GStreamer PipeWire Plugin-Pfad im Nix-Launcher + Paste-Collapse (10 Zeilen) [appimage]
All checks were successful
Build AppImage / build (push) Successful in 6m9s
All checks were successful
Build AppImage / build (push) Successful in 6m9s
- GST_PLUGIN_SYSTEM_PATH_1_0 mit pipewire im wrapProgram gesetzt
- User-Nachrichten >10 Zeilen werden collapsed ("Eingefuegt: X Zeilen")
- Assistant-Nachrichten weiterhin ab 25 Zeilen
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
54b58cf166
commit
5eed2a36bb
2 changed files with 41 additions and 9 deletions
|
|
@ -37,6 +37,16 @@ let
|
|||
openssl
|
||||
];
|
||||
|
||||
# GStreamer-Plugins fuer WebKitGTK (Audio/Video, WebRTC, Mikrofon via PipeWire)
|
||||
gstPlugins = with pkgs.gst_all_1; [
|
||||
gst-plugins-base
|
||||
gst-plugins-good
|
||||
gst-plugins-bad
|
||||
];
|
||||
|
||||
gstPluginPath = pkgs.lib.concatMapStringsSep ":" (p: "${p}/lib/gstreamer-1.0") gstPlugins
|
||||
+ ":${pkgs.pipewire}/lib/gstreamer-1.0";
|
||||
|
||||
# Laufzeit-Binaries die die App spawnen muss (node fuer claude-bridge.js,
|
||||
# npm fuer apply_bundle_update, tar fuer Bundle-Extract)
|
||||
runtimeBins = [ pkgs.nodejs_22 pkgs.gnutar pkgs.gzip ];
|
||||
|
|
@ -109,9 +119,11 @@ pkgs.stdenv.mkDerivation {
|
|||
|
||||
# LD_LIBRARY_PATH + PATH dauerhaft ans Launcher-Script binden
|
||||
# PATH: node/npm/tar muessen fuer die Bridge und apply_bundle_update verfuegbar sein
|
||||
# GST_PLUGIN_SYSTEM_PATH_1_0: GStreamer-Plugins fuer WebKitGTK (Mikrofon/PipeWire)
|
||||
wrapProgram $out/bin/claude-desktop \
|
||||
--prefix LD_LIBRARY_PATH : ${pkgs.lib.makeLibraryPath runtimeLibs} \
|
||||
--prefix PATH : ${pkgs.lib.makeBinPath runtimeBins}
|
||||
--prefix PATH : ${pkgs.lib.makeBinPath runtimeBins} \
|
||||
--prefix GST_PLUGIN_SYSTEM_PATH_1_0 : ${gstPluginPath}
|
||||
|
||||
# 2) Installer: kopiert ein frisch gebautes Binary an den Ziel-Ort
|
||||
cat > $out/bin/claude-desktop-install <<'INSTALLER'
|
||||
|
|
|
|||
|
|
@ -27,8 +27,9 @@
|
|||
|
||||
marked.setOptions({ breaks: true, gfm: true, renderer });
|
||||
|
||||
// Collapse: Nachrichten mit > 25 Zeilen werden eingeklappt
|
||||
const COLLAPSE_LINES = 25;
|
||||
// Collapse: Nachrichten mit > X Zeilen werden eingeklappt (rollenabhängig)
|
||||
const COLLAPSE_LINES_USER = 10;
|
||||
const COLLAPSE_LINES_ASSISTANT = 25;
|
||||
let expandedMessages = $state<string[]>([]);
|
||||
|
||||
function toggleExpand(msgId: string) {
|
||||
|
|
@ -39,8 +40,13 @@
|
|||
}
|
||||
}
|
||||
|
||||
function shouldCollapse(content: string): boolean {
|
||||
return content.split('\n').length > COLLAPSE_LINES;
|
||||
function shouldCollapse(content: string, role: string = 'assistant'): boolean {
|
||||
const limit = role === 'user' ? COLLAPSE_LINES_USER : COLLAPSE_LINES_ASSISTANT;
|
||||
return content.split('\n').length > limit;
|
||||
}
|
||||
|
||||
function getCollapseLimit(role: string): number {
|
||||
return role === 'user' ? COLLAPSE_LINES_USER : COLLAPSE_LINES_ASSISTANT;
|
||||
}
|
||||
|
||||
function renderMarkdown(text: string): string {
|
||||
|
|
@ -917,16 +923,16 @@
|
|||
</div>
|
||||
{:else if message.role === 'assistant'}
|
||||
{#if message.content}
|
||||
{#if shouldCollapse(message.content) && !expandedMessages.includes(message.id) && !($isProcessing && isLastAssistantMessage(index))}
|
||||
{#if shouldCollapse(message.content, 'assistant') && !expandedMessages.includes(message.id) && !($isProcessing && isLastAssistantMessage(index))}
|
||||
<div class="msg-collapsed">
|
||||
{@html renderMarkdown(message.content.split('\n').slice(0, COLLAPSE_LINES).join('\n') + '\n...')}
|
||||
{@html renderMarkdown(message.content.split('\n').slice(0, COLLAPSE_LINES_ASSISTANT).join('\n') + '\n...')}
|
||||
</div>
|
||||
<button class="expand-btn" onclick={() => toggleExpand(message.id)}>
|
||||
▼ Mehr anzeigen ({message.content.split('\n').length} Zeilen)
|
||||
</button>
|
||||
{:else}
|
||||
{@html renderMarkdown(message.content)}
|
||||
{#if shouldCollapse(message.content) && !($isProcessing && isLastAssistantMessage(index))}
|
||||
{#if shouldCollapse(message.content, 'assistant') && !($isProcessing && isLastAssistantMessage(index))}
|
||||
<button class="expand-btn" onclick={() => toggleExpand(message.id)}>
|
||||
▲ Einklappen
|
||||
</button>
|
||||
|
|
@ -951,7 +957,21 @@
|
|||
</span>
|
||||
{/if}
|
||||
{:else}
|
||||
{message.content}
|
||||
{#if message.role === 'user' && message.content && shouldCollapse(message.content, 'user') && !expandedMessages.includes(message.id)}
|
||||
<div class="msg-collapsed">
|
||||
{message.content.split('\n').slice(0, COLLAPSE_LINES_USER).join('\n')}{'\n...'}
|
||||
</div>
|
||||
<button class="expand-btn" onclick={() => toggleExpand(message.id)}>
|
||||
▼ Eingefügt: {message.content.split('\n').length} Zeilen
|
||||
</button>
|
||||
{:else}
|
||||
{message.content}
|
||||
{#if message.role === 'user' && message.content && shouldCollapse(message.content, 'user')}
|
||||
<button class="expand-btn" onclick={() => toggleExpand(message.id)}>
|
||||
▲ Einklappen
|
||||
</button>
|
||||
{/if}
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue