Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions admin-ui/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,4 @@ The admin UI integrates with OpenContext backend APIs:
- **Pages**: Main application views in `/src/pages/`
- **API Client**: Centralized HTTP client in `/src/lib/api.ts`
- **State Management**: Zustand store for authentication state
- **Types**: TypeScript definitions in `/src/types/`

## Contributing

1. Follow existing code style and patterns
2. Add TypeScript types for new features
3. Test API integrations with backend
4. Ensure responsive design works on all screen sizes
- **Types**: TypeScript definitions in `/src/types/`
4 changes: 2 additions & 2 deletions admin-ui/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + React + TS</title>
<title>OpenContext</title>
</head>
<body>
<div id="root"></div>
Expand Down
4 changes: 4 additions & 0 deletions admin-ui/public/logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 7 additions & 18 deletions admin-ui/src/pages/Search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
FileText,
ChevronRight,
Copy,
ExternalLink,
Loader2
} from 'lucide-react'
import type { SearchResultsResponse, GetContentResponse } from '../types/api'
Expand Down Expand Up @@ -268,30 +267,26 @@ export const Search: React.FC = () => {
<div className="space-y-4">
{/* Content Metadata */}
<div className="bg-gray-50 p-4 rounded-lg">
<div className="grid grid-cols-1 md:grid-cols-3 gap-4 text-sm">
<div className="grid grid-cols-1 md:grid-cols-2 gap-4 text-sm">
<div>
<span className="font-medium text-gray-700">Chunk ID:</span>
<div className="text-gray-600 font-mono text-xs">
{contentData.chunkId}
<div className="text-gray-600 font-mono text-xs break-all">
{selectedChunk}

Copilot AI Aug 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable 'selectedChunk' is being used instead of 'contentData.chunkId'. This appears to be incorrect as the original code displayed 'contentData.chunkId' which is the actual chunk ID from the API response, while 'selectedChunk' likely contains a different value used for selection logic.

Suggested change
{selectedChunk}
{contentData.chunkId}

Copilot uses AI. Check for mistakes.
</div>
</div>
<div>
<span className="font-medium text-gray-700">File Type:</span>
<div className="text-gray-600">{contentData.fileType}</div>
</div>
<div>
<span className="font-medium text-gray-700">Tokens:</span>
<div className="text-gray-600">
{contentData.tokenInfo.tokenCount} / {maxTokens}
{contentData.tokenInfo.actualTokens} / {maxTokens}
</div>
</div>
</div>
</div>

{/* Content Text */}
<div className="bg-white border rounded-lg p-4">
<div className="prose max-w-none">
<pre className="whitespace-pre-wrap text-sm text-gray-800 font-mono leading-relaxed">
<div className="bg-white border rounded-lg overflow-hidden">
<div className="p-4 max-h-96 overflow-y-auto">
<pre className="whitespace-pre-wrap text-sm text-gray-800 font-mono leading-relaxed overflow-hidden text-ellipsis" style={{ wordBreak: 'break-all', whiteSpace: 'pre-wrap' }}>

Copilot AI Aug 19, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The inline style duplicates the 'whitespace-pre-wrap' CSS class. The style object sets 'whiteSpace: 'pre-wrap'' which is redundant with the 'whitespace-pre-wrap' class. Consider removing the redundant style property.

Suggested change
<pre className="whitespace-pre-wrap text-sm text-gray-800 font-mono leading-relaxed overflow-hidden text-ellipsis" style={{ wordBreak: 'break-all', whiteSpace: 'pre-wrap' }}>
<pre className="whitespace-pre-wrap text-sm text-gray-800 font-mono leading-relaxed overflow-hidden text-ellipsis" style={{ wordBreak: 'break-all' }}>

Copilot uses AI. Check for mistakes.
{contentData.content}
</pre>
</div>
Expand All @@ -302,12 +297,6 @@ export const Search: React.FC = () => {
<div>
Content length: {contentData.content.length} characters
</div>
<div className="flex space-x-2">
<Button variant="outline" size="sm">
<ExternalLink className="h-4 w-4 mr-1" />
View Source
</Button>
</div>
</div>
</div>
)}
Expand Down
4 changes: 2 additions & 2 deletions admin-ui/src/pages/Settings.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -189,8 +189,8 @@ export const Settings: React.FC = () => {
<span className="ml-2 text-gray-600">{import.meta.env.VITE_API_BASE_URL || 'http://localhost:8080/api/v1'}</span>
</div>
<div>
<span className="font-medium text-gray-700">Environment:</span>
<span className="ml-2 text-gray-600">{import.meta.env.MODE}</span>
<span className="font-medium text-gray-700">Deployment:</span>
<span className="ml-2 text-gray-600">Self-Hosted Instance</span>
</div>
<div>
<span className="font-medium text-gray-700">Storage:</span>
Expand Down