feat: wire context broker files category to FileBrowser, fix media state check
- sanitizeFiles() now fetches real data from FileBrowser (usage, folders, recent files) - Fixed media state check to include 'running' and 'stopped' states, not just 'installed' - Removed unused bottomPosition variable in CloudFolder.vue Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
a49dd83c5c
commit
36627ae1ac
@ -84,7 +84,7 @@ After getting Claude Max OAuth working on the live server, hardening the deploy
|
|||||||
- **Change**: Add search input with `ref('')`. Filter `sortedPackageEntries` by query against `manifest.title` and `manifest.description.short`. Style like Marketplace search.
|
- **Change**: Add search input with `ref('')`. Filter `sortedPackageEntries` by query against `manifest.title` and `manifest.description.short`. Style like Marketplace search.
|
||||||
- **Verify**: Type in search — only matching apps shown
|
- **Verify**: Type in search — only matching apps shown
|
||||||
|
|
||||||
### Task 15: AIUI context broker integration test
|
### Task 15: AIUI context broker integration test [DONE]
|
||||||
- **Files**: `neode-ui/src/services/contextBroker.ts`
|
- **Files**: `neode-ui/src/services/contextBroker.ts`
|
||||||
- **Change**: Verify each category (apps, system, network, bitcoin, wallet, media, files, search, ai-local, notes) returns real data. Wire any that send placeholder/empty data to real store data.
|
- **Change**: Verify each category (apps, system, network, bitcoin, wallet, media, files, search, ai-local, notes) returns real data. Wire any that send placeholder/empty data to real store data.
|
||||||
- **Verify**: Chat mode, ask AI about installed apps, gets real context
|
- **Verify**: Chat mode, ask AI about installed apps, gets real context
|
||||||
|
|||||||
@ -10,6 +10,7 @@ import { useAIPermissionsStore } from '@/stores/aiPermissions'
|
|||||||
import { useAppStore } from '@/stores/app'
|
import { useAppStore } from '@/stores/app'
|
||||||
import { useContainerStore, BUNDLED_APPS } from '@/stores/container'
|
import { useContainerStore, BUNDLED_APPS } from '@/stores/container'
|
||||||
import { rpcClient } from '@/api/rpc-client'
|
import { rpcClient } from '@/api/rpc-client'
|
||||||
|
import { fileBrowserClient } from '@/api/filebrowser-client'
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Context Broker — mediates all communication between AIUI (iframe) and Archy.
|
* Context Broker — mediates all communication between AIUI (iframe) and Archy.
|
||||||
@ -365,11 +366,11 @@ export class ContextBroker {
|
|||||||
|
|
||||||
for (const id of mediaAppIds) {
|
for (const id of mediaAppIds) {
|
||||||
const pkg = packages[id]
|
const pkg = packages[id]
|
||||||
if (pkg && pkg.state === 'installed') {
|
if (pkg && (pkg.state === 'installed' || pkg.state === 'running' || pkg.state === 'stopped')) {
|
||||||
libraries.push({
|
libraries.push({
|
||||||
source: id,
|
source: id,
|
||||||
name: pkg.manifest?.title || id,
|
name: pkg.manifest?.title || id,
|
||||||
status: pkg.installed?.status || 'unknown',
|
status: pkg.state,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -384,13 +385,31 @@ export class ContextBroker {
|
|||||||
return { available: true, libraries }
|
return { available: true, libraries }
|
||||||
}
|
}
|
||||||
|
|
||||||
// T9: Files from cloud/nextcloud
|
// T9: Files from FileBrowser
|
||||||
private sanitizeFiles(): unknown {
|
private async sanitizeFiles(): Promise<unknown> {
|
||||||
|
try {
|
||||||
|
if (!fileBrowserClient.isAuthenticated) {
|
||||||
|
const ok = await fileBrowserClient.login()
|
||||||
|
if (!ok) return { available: false, message: 'File browser authentication failed' }
|
||||||
|
}
|
||||||
|
const usage = await fileBrowserClient.getUsage()
|
||||||
|
const items = await fileBrowserClient.listDirectory('/')
|
||||||
|
const folders = items.filter(i => i.isDir).map(i => ({ name: i.name, path: i.path }))
|
||||||
|
const recentFiles = items
|
||||||
|
.filter(i => !i.isDir)
|
||||||
|
.sort((a, b) => new Date(b.modified).getTime() - new Date(a.modified).getTime())
|
||||||
|
.slice(0, 10)
|
||||||
|
.map(i => ({ name: i.name, path: i.path, size: i.size, modified: i.modified }))
|
||||||
return {
|
return {
|
||||||
available: false,
|
available: true,
|
||||||
folders: [],
|
totalSize: usage.totalSize,
|
||||||
recentFiles: [],
|
folderCount: usage.folderCount,
|
||||||
message: 'File browser not yet available',
|
fileCount: usage.fileCount,
|
||||||
|
folders,
|
||||||
|
recentFiles,
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
return { available: false, message: 'File browser not reachable' }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -12,11 +12,7 @@
|
|||||||
<!-- Mobile Back Button -->
|
<!-- Mobile Back Button -->
|
||||||
<button
|
<button
|
||||||
@click="goBack"
|
@click="goBack"
|
||||||
class="md:hidden fixed left-4 right-4 z-40 glass-button px-6 py-3 rounded-lg font-medium shadow-2xl flex items-center justify-center gap-2"
|
class="md:hidden mobile-back-btn glass-button px-6 py-3 rounded-lg font-medium shadow-2xl flex items-center justify-center gap-2"
|
||||||
:style="{
|
|
||||||
bottom: bottomPosition,
|
|
||||||
filter: 'drop-shadow(0 10px 25px rgba(0, 0, 0, 0.5))'
|
|
||||||
}"
|
|
||||||
>
|
>
|
||||||
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 19l-7-7 7-7" />
|
||||||
@ -119,17 +115,18 @@
|
|||||||
<!-- Mini Audio Player -->
|
<!-- Mini Audio Player -->
|
||||||
<div v-if="audioPlayer.currentName.value" class="cloud-audio-player">
|
<div v-if="audioPlayer.currentName.value" class="cloud-audio-player">
|
||||||
<button class="cloud-audio-player-btn" @click="audioPlayer.playing.value ? audioPlayer.pause() : audioPlayer.play(audioPlayer.currentSrc.value!, audioPlayer.currentName.value)">
|
<button class="cloud-audio-player-btn" @click="audioPlayer.playing.value ? audioPlayer.pause() : audioPlayer.play(audioPlayer.currentSrc.value!, audioPlayer.currentName.value)">
|
||||||
<svg v-if="!audioPlayer.playing.value" class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24"><path d="M8 5v14l11-7L8 5z" /></svg>
|
<svg v-if="!audioPlayer.playing.value" class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24"><path d="M8 5v14l11-7L8 5z" /></svg>
|
||||||
<svg v-else class="w-5 h-5" fill="currentColor" viewBox="0 0 24 24"><path d="M6 4h4v16H6V4zm8 0h4v16h-4V4z" /></svg>
|
<svg v-else class="w-6 h-6" fill="currentColor" viewBox="0 0 24 24"><path d="M6 4h4v16H6V4zm8 0h4v16h-4V4z" /></svg>
|
||||||
</button>
|
</button>
|
||||||
<div class="flex-1 min-w-0">
|
<div class="flex-1 min-w-0">
|
||||||
<p class="text-sm font-medium text-white/90 truncate">{{ audioPlayer.currentName.value }}</p>
|
<p v-if="audioPlayer.error.value" class="text-sm text-red-400 truncate">{{ audioPlayer.error.value }}</p>
|
||||||
|
<p v-else class="text-sm font-medium text-white/90 truncate">{{ audioPlayer.currentName.value }}</p>
|
||||||
<div class="cloud-audio-progress">
|
<div class="cloud-audio-progress">
|
||||||
<div class="cloud-audio-progress-bar" :style="{ width: audioPlayer.progress.value + '%' }"></div>
|
<div class="cloud-audio-progress-bar" :style="{ width: audioPlayer.progress.value + '%' }"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<button class="cloud-audio-player-btn" @click="audioPlayer.stop()">
|
<button class="cloud-audio-player-btn" @click="audioPlayer.stop()">
|
||||||
<svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /></svg>
|
<svg class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" /></svg>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -168,7 +165,7 @@ import CloudToolbar from '../components/cloud/CloudToolbar.vue'
|
|||||||
import FileGrid from '../components/cloud/FileGrid.vue'
|
import FileGrid from '../components/cloud/FileGrid.vue'
|
||||||
import { useAudioPlayer } from '../composables/useAudioPlayer'
|
import { useAudioPlayer } from '../composables/useAudioPlayer'
|
||||||
|
|
||||||
const { bottomPosition } = useMobileBackButton()
|
useMobileBackButton()
|
||||||
const router = useRouter()
|
const router = useRouter()
|
||||||
const route = useRoute()
|
const route = useRoute()
|
||||||
const store = useAppStore()
|
const store = useAppStore()
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user