paginate open streams #252

Merged
talksik merged 4 commits from paginate-open-streams into main 2026-06-09 17:43:27 +00:00
5 changed files with 28 additions and 8 deletions
Showing only changes of commit 38cecd84bd - Show all commits
+10 -4
View File
@@ -56,10 +56,16 @@ function DeepLinkNavigationListener() {
const navigate = useNavigate();
coderabbitai[bot] commented 2026-06-09 17:15:43 +00:00 (Migrated from github.com)
Review

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Description: Find logError definition and check if it's globally available

# Search for logError exports
echo "=== Searching for logError exports ==="
rg -n --type=ts --type=tsx 'export.*logError' js/

# Search for logError declarations
echo -e "\n=== Searching for logError declarations ==="
rg -n --type=ts --type=tsx 'function logError|const logError|let logError' js/

# Check if logError is used elsewhere in the codebase
echo -e "\n=== Other usages of logError ==="
rg -n --type=ts --type=tsx 'logError\(' js/ -A1 -B1

Repository: flowy-live/llink

Length of output: 280


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Inspect js/desktop/src/App.tsx (imports + deepLink catch) ==="
sed -n '1,120p' js/desktop/src/App.tsx | nl -ba | sed -n '1,120p'

echo -e "\n=== Find logError usage in App.tsx ==="
rg -n "logError\(" js/desktop/src/App.tsx || true

echo -e "\n=== Find logError definitions across js/ ==="
rg -n "export\s+(function|const|let)\s+logError|function\s+logError|const\s+logError|let\s+logError" js/ || true

echo -e "\n=== Find logError imports across js/ ==="
rg -n "import\s+\{[^}]*\blogError\b[^}]*\}\s+from|from\s+['\"][^'\"]+['\"];\s*$" js/ || true

echo -e "\n=== Find all logError(...) callsites across js/ ==="
rg -n "logError\(" js/ -S || true

Repository: flowy-live/llink

Length of output: 187


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Check target file exists ==="
ls -la js/desktop/src/App.tsx || true

echo -e "\n=== App.tsx imports + deepLink block (line-numbered) ==="
# Use cat -n since nl isn't available
cat -n js/desktop/src/App.tsx | sed -n '1,140p'

echo -e "\n=== Find logError usage in App.tsx ==="
rg -n "logError\s*\(" js/desktop/src/App.tsx || true

echo -e "\n=== Find logError imports in App.tsx ==="
rg -n "import\s+\{[^}]*\blogError\b[^}]*\}\s+from" js/desktop/src/App.tsx || true

echo -e "\n=== Find logError definitions/exports across js/ ==="
rg -n "export\s+(function|const|let)\s+logError|function\s+logError|const\s+logError|let\s+logError" js/ || true

echo -e "\n=== Find all logError(...) callsites across js/ ==="
rg -n "logError\s*\(" js/ || true

Repository: flowy-live/llink

Length of output: 9928


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo "=== Inspect js/desktop/src/lib/errors.ts around logError ==="
sed -n '1,140p' js/desktop/src/lib/errors.ts | cat -n

echo -e "\n=== Check for barrel exports (desktop src/lib index) ==="
for f in js/desktop/src/lib/index.ts js/desktop/src/lib/index.tsx js/desktop/src/lib.ts js/desktop/src/lib/index.js js/desktop/src/lib/index.ts; do
  if [ -f "$f" ]; then
    echo "--- $f ---"
    sed -n '1,200p' "$f" | cat -n
  fi
done

echo -e "\n=== Search for re-export of logError in desktop lib ==="
rg -n "export\s+\*\s+from|export\s+\{[^}]*\blogError\b[^}]*\}" js/desktop/src/lib/ || true

echo -e "\n=== Search for logError exports outside lib/errors.ts (desktop) ==="
rg -n "export\s+function\s+logError|export\s+\{\s*logError\s*\}" js/desktop/src/ || true

Repository: flowy-live/llink

Length of output: 4013


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo -e "=== logError import usages in desktop ==="
rg -n "import\s+\{[^}]*\blogError\b[^}]*\}\s+from" js/desktop/src || true

echo -e "\n=== Possible global declarations ==="
rg -n "declare\s+(const|function)\s+logError|globalThis\.logError|window\.logError" js/ || true

echo -e "\n=== Does App.tsx import '`@/lib/errors`' or similar? ==="
rg -n "from\s+['\"]`@/lib/`(errors|error|logger)['\"]" js/desktop/src/App.tsx || true

echo -e "\n=== Any re-export barrel that could make logError available without local import? ==="
rg -n "export\s+\*\s+from\s+['\"][^'\"]*errors['\"]|export\s+\{\s*logError\s*\}" js/desktop/src/lib js/desktop/src || true

Repository: flowy-live/llink

Length of output: 942


🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n "declare\s+(var|const|let|function)\s+logError|globalThis\[['\"]logError['\"]\]|globalThis\.(logError)|window\[['\"]logError['\"]\]|window\.(logError)" js/ || true

Repository: flowy-live/llink

Length of output: 42


🏁 Script executed:

#!/bin/bash
set -euo pipefail
rg -n "declare\s+(var|const|let|function)\s+logError|globalThis\.(logError)|window\.(logError)|global\s+logError|logError:\s*\(.*\)\s*=>" . || true

Repository: flowy-live/llink

Length of output: 42


Fix missing logError import in DeepLinkNavigationListener

platform.deepLink
  .getPending()
  .then((path) => {
    if (path) navigate(path);
  })
  .catch((err) => {
    logError(err, { scope: 'deepLink.getPending' });
  });

js/desktop/src/App.tsx (line 65) calls logError, but the file has no import. logError is exported from @/lib/errors (js/desktop/src/lib/errors.ts), and other desktop files import it from there—so this call will fail at runtime (and/or typecheck).

Add:

  • import { logError } from '@/lib/errors';
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@js/desktop/src/App.tsx` around lines 59 - 66, The call to logError inside the
deep link handler (platform.deepLink.getPending().catch(...)) is missing its
import and will fail; add an import for logError from the desktop errors module
(import { logError } from '`@/lib/errors`';) at the top of js/desktop/src/App.tsx
so the catch handler inside the DeepLinkNavigationListener /
platform.deepLink.getPending() block can call logError correctly.

Addressed in commit 89d7824

_⚠️ Potential issue_ | _🔴 Critical_ <details> <summary>🧩 Analysis chain</summary> 🏁 Script executed: ```shell #!/bin/bash # Description: Find logError definition and check if it's globally available # Search for logError exports echo "=== Searching for logError exports ===" rg -n --type=ts --type=tsx 'export.*logError' js/ # Search for logError declarations echo -e "\n=== Searching for logError declarations ===" rg -n --type=ts --type=tsx 'function logError|const logError|let logError' js/ # Check if logError is used elsewhere in the codebase echo -e "\n=== Other usages of logError ===" rg -n --type=ts --type=tsx 'logError\(' js/ -A1 -B1 ``` Repository: flowy-live/llink Length of output: 280 --- 🏁 Script executed: ```shell #!/bin/bash set -euo pipefail echo "=== Inspect js/desktop/src/App.tsx (imports + deepLink catch) ===" sed -n '1,120p' js/desktop/src/App.tsx | nl -ba | sed -n '1,120p' echo -e "\n=== Find logError usage in App.tsx ===" rg -n "logError\(" js/desktop/src/App.tsx || true echo -e "\n=== Find logError definitions across js/ ===" rg -n "export\s+(function|const|let)\s+logError|function\s+logError|const\s+logError|let\s+logError" js/ || true echo -e "\n=== Find logError imports across js/ ===" rg -n "import\s+\{[^}]*\blogError\b[^}]*\}\s+from|from\s+['\"][^'\"]+['\"];\s*$" js/ || true echo -e "\n=== Find all logError(...) callsites across js/ ===" rg -n "logError\(" js/ -S || true ``` Repository: flowy-live/llink Length of output: 187 --- 🏁 Script executed: ```shell #!/bin/bash set -euo pipefail echo "=== Check target file exists ===" ls -la js/desktop/src/App.tsx || true echo -e "\n=== App.tsx imports + deepLink block (line-numbered) ===" # Use cat -n since nl isn't available cat -n js/desktop/src/App.tsx | sed -n '1,140p' echo -e "\n=== Find logError usage in App.tsx ===" rg -n "logError\s*\(" js/desktop/src/App.tsx || true echo -e "\n=== Find logError imports in App.tsx ===" rg -n "import\s+\{[^}]*\blogError\b[^}]*\}\s+from" js/desktop/src/App.tsx || true echo -e "\n=== Find logError definitions/exports across js/ ===" rg -n "export\s+(function|const|let)\s+logError|function\s+logError|const\s+logError|let\s+logError" js/ || true echo -e "\n=== Find all logError(...) callsites across js/ ===" rg -n "logError\s*\(" js/ || true ``` Repository: flowy-live/llink Length of output: 9928 --- 🏁 Script executed: ```shell #!/bin/bash set -euo pipefail echo "=== Inspect js/desktop/src/lib/errors.ts around logError ===" sed -n '1,140p' js/desktop/src/lib/errors.ts | cat -n echo -e "\n=== Check for barrel exports (desktop src/lib index) ===" for f in js/desktop/src/lib/index.ts js/desktop/src/lib/index.tsx js/desktop/src/lib.ts js/desktop/src/lib/index.js js/desktop/src/lib/index.ts; do if [ -f "$f" ]; then echo "--- $f ---" sed -n '1,200p' "$f" | cat -n fi done echo -e "\n=== Search for re-export of logError in desktop lib ===" rg -n "export\s+\*\s+from|export\s+\{[^}]*\blogError\b[^}]*\}" js/desktop/src/lib/ || true echo -e "\n=== Search for logError exports outside lib/errors.ts (desktop) ===" rg -n "export\s+function\s+logError|export\s+\{\s*logError\s*\}" js/desktop/src/ || true ``` Repository: flowy-live/llink Length of output: 4013 --- 🏁 Script executed: ```shell #!/bin/bash set -euo pipefail echo -e "=== logError import usages in desktop ===" rg -n "import\s+\{[^}]*\blogError\b[^}]*\}\s+from" js/desktop/src || true echo -e "\n=== Possible global declarations ===" rg -n "declare\s+(const|function)\s+logError|globalThis\.logError|window\.logError" js/ || true echo -e "\n=== Does App.tsx import '`@/lib/errors`' or similar? ===" rg -n "from\s+['\"]`@/lib/`(errors|error|logger)['\"]" js/desktop/src/App.tsx || true echo -e "\n=== Any re-export barrel that could make logError available without local import? ===" rg -n "export\s+\*\s+from\s+['\"][^'\"]*errors['\"]|export\s+\{\s*logError\s*\}" js/desktop/src/lib js/desktop/src || true ``` Repository: flowy-live/llink Length of output: 942 --- 🏁 Script executed: ```shell #!/bin/bash set -euo pipefail rg -n "declare\s+(var|const|let|function)\s+logError|globalThis\[['\"]logError['\"]\]|globalThis\.(logError)|window\[['\"]logError['\"]\]|window\.(logError)" js/ || true ``` Repository: flowy-live/llink Length of output: 42 --- 🏁 Script executed: ```shell #!/bin/bash set -euo pipefail rg -n "declare\s+(var|const|let|function)\s+logError|globalThis\.(logError)|window\.(logError)|global\s+logError|logError:\s*\(.*\)\s*=>" . || true ``` Repository: flowy-live/llink Length of output: 42 --- </details> **Fix missing `logError` import in `DeepLinkNavigationListener`** ```ts platform.deepLink .getPending() .then((path) => { if (path) navigate(path); }) .catch((err) => { logError(err, { scope: 'deepLink.getPending' }); }); ``` `js/desktop/src/App.tsx` (line 65) calls `logError`, but the file has no import. `logError` is exported from `@/lib/errors` (`js/desktop/src/lib/errors.ts`), and other desktop files import it from there—so this call will fail at runtime (and/or typecheck). Add: - `import { logError } from '`@/lib/errors`';` <details> <summary>🤖 Prompt for AI Agents</summary> ``` Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@js/desktop/src/App.tsx` around lines 59 - 66, The call to logError inside the deep link handler (platform.deepLink.getPending().catch(...)) is missing its import and will fail; add an import for logError from the desktop errors module (import { logError } from '`@/lib/errors`';) at the top of js/desktop/src/App.tsx so the catch handler inside the DeepLinkNavigationListener / platform.deepLink.getPending() block can call logError correctly. ``` </details> <!-- fingerprinting:phantom:poseidon:puma --> <!-- cr-comment:v1:c9a314090a6b41810a7fe1e2 --> <!-- This is an auto-generated comment by CodeRabbit --> ✅ Addressed in commit 89d7824
useEffect(() => {
window.electronDeepLink.getPending().then((path) => {
if (path) navigate(path);
});
return window.electronDeepLink.onNavigate((path) => navigate(path));
platform.deepLink
.getPending()
.then((path) => {
if (path) navigate(path);
})
.catch((err) => {
logError(err, { scope: 'deepLink.getPending' });
});
return platform.deepLink.onNavigate((path) => navigate(path));
}, [navigate]);
return null;
+1 -4
View File
@@ -30,8 +30,7 @@ export default function NetworkRoot() {
setSearchParams(
(prev) => {
const params = new URLSearchParams(prev);
if (next === 'open') params.delete('status');
else params.set('status', next);
params.set('status', next);
return params;
},
{ replace: true },
@@ -56,7 +55,6 @@ export default function NetworkRoot() {
return (
<div className="relative flex min-h-0 flex-1 flex-col">
{/* Top bar — stays in place */}
<div className="flex shrink-0 items-center p-1 border-b">
<Tabs
value={statusTab}
@@ -75,7 +73,6 @@ export default function NetworkRoot() {
</Tabs>
</div>
{/* Scrollable content */}
<div className="min-h-0 flex-1 overflow-y-auto overscroll-contain pb-14 py-2">
<ParticleListView
streams={streams}
+5
View File
@@ -55,4 +55,9 @@ export const electronPlatform: Platform = {
setDockBadge: (count) => window.electronApp.setDockBadge(count),
getVersion: () => window.electronApp.getVersion(),
},
deepLink: {
getPending: () => window.electronDeepLink.getPending(),
onNavigate: (cb) => window.electronDeepLink.onNavigate(cb),
},
};
+5
View File
@@ -60,6 +60,11 @@ export interface Platform {
setDockBadge: (count: number) => void;
getVersion: () => Promise<string>;
};
deepLink: {
getPending: () => Promise<string | null>;
onNavigate: (callback: (path: string) => void) => () => void;
};
}
export const DESKTOP_DOWNLOAD_URL = 'https://flowylabs.ai/llink/download';
+7
View File
@@ -117,4 +117,11 @@ export const webPlatform: Platform = {
setDockBadge: applyDockBadge,
getVersion: async () => __APP_VERSION__,
},
deepLink: {
getPending: () => Promise.resolve(null),
onNavigate: (_) => {
return () => {};
},
},
};