mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 21:04:23 +01:00
fix: address findings from the full Docker evaluation of main
Critical and high: - repos: unlinking a local repo removes only the Manager reference and alias, never the repository files; confirm button reads "Unlink" - auth: rate-limit by the socket address; trust proxy headers only when AUTH_TRUSTED_PROXY_HEADERS is set (documented and forwarded in compose) - composer: per-session in-memory drafts (text, bash mode, attachments); Escape no longer clears the prompt - url params: compose same-tick updates so schedule dialogs stay closed after create/delete; delete dialog names the job Medium: - tool rows show failures (non-zero shell exit, failed exploration members) - voice conversation shows the specific error and a starting state - settings: Escape in dropdowns and the shortcut recorder no longer closes the dialog; mobile deep links open the requested section; one content tree per platform - closing pushed sheets, settings, tool panels and schedule dialogs goes back in history - login returns to the requested page; signed-out pages make no authenticated requests - action terminals keep their output (Manager-side output capture and replay) - unpushed-commit detection, commit message kept on failure - binary files with unknown extensions are detected and not editable - tool panel resizes when docked and floats as a dismissible sheet when the page is too narrow - Docker image runs tini as PID 1 Low: not-found states, add-repo and branch validation errors (4xx), search-aware empty states, mobile repo sort/filter/select cues, sidebar resize affordance and collapse shortcut, mobile unread badge, preview port filtering, terminal close handling, walkthrough empty state and helper session filtering, placeholder contrast, permission labels and focus, TTS task-list sanitizing, git identity email validation, quieter git logging, hermetic worktree tests, and accessible names for icon-only controls.
This commit is contained in:
1 parent
1c22ef6ea1
commit
4ec62cd4e7
191 files changed
+6674
-696
No files matched your search
@@ -615,7 +615,7 @@ useEffect(() => {
|
||||
onChange={(e) => setSearchQuery(e.target.value)}
|
||||
className="flex-1"
|
||||
/>
|
||||
<Button variant="outline" size="sm" onClick={handleRefresh}>
|
||||
<Button variant="outline" size="sm" aria-label="Refresh files" onClick={handleRefresh}>
|
||||
<RefreshCw className="w-4 h-4" />
|
||||
</Button>
|
||||
<FileOperations
|
||||
@@ -705,7 +705,7 @@ useEffect(() => {
|
||||
<FolderOpen className="w-5 h-5" />
|
||||
File Browser
|
||||
</CardTitle>
|
||||
<Button variant="outline" size="sm" onClick={handleRefresh}>
|
||||
<Button variant="outline" size="sm" aria-label="Refresh files" onClick={handleRefresh}>
|
||||
<RefreshCw className="w-4 h-4" />
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
@@ -117,6 +117,7 @@ export function FileDiffContent({
|
||||
size="sm"
|
||||
onClick={onBack}
|
||||
className="h-7 w-7 p-0 mr-1"
|
||||
aria-label="Back to file list"
|
||||
>
|
||||
<ArrowLeft className="w-4 h-4" />
|
||||
</Button>
|
||||
|
||||
@@ -57,7 +57,7 @@ export const FileOperations = memo(function FileOperations({ onUpload, onCreate
|
||||
{isMobile ? (
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<Button variant="outline" size="sm">
|
||||
<Button variant="outline" size="sm" aria-label="Upload files">
|
||||
<Upload className="w-4 h-4" />
|
||||
</Button>
|
||||
</DropdownMenuTrigger>
|
||||
@@ -73,7 +73,7 @@ export const FileOperations = memo(function FileOperations({ onUpload, onCreate
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
) : (
|
||||
<Button variant="outline" size="sm" onClick={() => fileInputRef.current?.click()}>
|
||||
<Button variant="outline" size="sm" aria-label="Upload files" onClick={() => fileInputRef.current?.click()}>
|
||||
<Upload className="w-4 h-4" />
|
||||
<span className="hidden sm:inline ml-1">Upload</span>
|
||||
</Button>
|
||||
@@ -81,7 +81,7 @@ export const FileOperations = memo(function FileOperations({ onUpload, onCreate
|
||||
|
||||
<Dialog open={createDialogOpen} onOpenChange={setCreateDialogOpen}>
|
||||
<DialogTrigger asChild>
|
||||
<Button variant="outline" size="sm">
|
||||
<Button variant="outline" size="sm" aria-label="Create file or folder">
|
||||
<Plus className="w-4 h-4" />
|
||||
</Button>
|
||||
</DialogTrigger>
|
||||
|
||||
@@ -105,6 +105,14 @@ describe('FilePreview header buttons', () => {
|
||||
expect(external).toHaveAttribute('rel', 'noopener noreferrer')
|
||||
})
|
||||
|
||||
it('shows the binary message and no edit action for non-text files', () => {
|
||||
render(<FilePreview file={{ ...textFile('blob.bin', 'application/octet-stream'), content: btoa('\u0000\u0001\u0002') }} />)
|
||||
|
||||
expect(screen.getByText('Binary file - download to view content')).toBeInTheDocument()
|
||||
expect(screen.queryByRole('button', { name: 'Edit file' })).not.toBeInTheDocument()
|
||||
expect(screen.getByRole('button', { name: 'Download file' })).toBeInTheDocument()
|
||||
})
|
||||
|
||||
it('keeps the success and destructive tints on the edit actions in dark mode', () => {
|
||||
render(<FilePreview file={textFile('Dockerfile', 'text/plain')} />)
|
||||
|
||||
|
||||
@@ -426,25 +426,25 @@ export const FilePreview = memo(function FilePreview({ file, hideHeader = false,
|
||||
)}
|
||||
|
||||
{isTextFile && viewMode !== 'edit' && (
|
||||
<Button variant="outline" size="sm" onClick={(e) => { e.stopPropagation(); e.preventDefault(); handleEdit() }} className="h-7 w-7 p-0">
|
||||
<Button variant="outline" size="sm" aria-label="Edit file" onClick={(e) => { e.stopPropagation(); e.preventDefault(); handleEdit() }} className="h-7 w-7 p-0">
|
||||
<Edit3 className="w-3 h-3" />
|
||||
</Button>
|
||||
)}
|
||||
|
||||
{showSaveButton && (
|
||||
<Button variant="ghost" size="sm" onClick={(e) => { e.stopPropagation(); e.preventDefault(); if (shouldVirtualize) { handleVirtualizedSaveClick(); } else { handleSave(); } }} disabled={isSaving || (shouldVirtualize && !hasVirtualizedChanges)} className={SUCCESS_TINT_BUTTON_CLASS}>
|
||||
<Button variant="ghost" size="sm" aria-label="Save file" onClick={(e) => { e.stopPropagation(); e.preventDefault(); if (shouldVirtualize) { handleVirtualizedSaveClick(); } else { handleSave(); } }} disabled={isSaving || (shouldVirtualize && !hasVirtualizedChanges)} className={SUCCESS_TINT_BUTTON_CLASS}>
|
||||
<Save className="w-3 h-3" />
|
||||
</Button>
|
||||
)}
|
||||
|
||||
{showCancelButton && (
|
||||
<Button variant="ghost" size="sm" onClick={(e) => { e.stopPropagation(); e.preventDefault(); handleCancel() }} className={DESTRUCTIVE_TINT_BUTTON_CLASS}>
|
||||
<Button variant="ghost" size="sm" aria-label="Cancel editing" onClick={(e) => { e.stopPropagation(); e.preventDefault(); handleCancel() }} className={DESTRUCTIVE_TINT_BUTTON_CLASS}>
|
||||
<XIcon className="w-3 h-3" />
|
||||
</Button>
|
||||
)}
|
||||
|
||||
{viewMode !== 'edit' && (
|
||||
<Button variant="outline" size="sm" onClick={(e) => { e.stopPropagation(); e.preventDefault(); handleDownload() }} className="h-7 w-7 p-0">
|
||||
<Button variant="outline" size="sm" aria-label="Download file" onClick={(e) => { e.stopPropagation(); e.preventDefault(); handleDownload() }} className="h-7 w-7 p-0">
|
||||
<Download className="w-3 h-3" />
|
||||
</Button>
|
||||
)}
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
import { render, screen } from '@testing-library/react'
|
||||
import type { FileInfo } from '@/types/files'
|
||||
import { FileTree } from './FileTree'
|
||||
|
||||
const file: FileInfo = {
|
||||
name: 'notes.txt',
|
||||
path: 'docker/notes.txt',
|
||||
isDirectory: false,
|
||||
size: 5,
|
||||
mimeType: 'text/plain',
|
||||
content: '',
|
||||
lastModified: new Date('2026-07-28T09:12:40Z'),
|
||||
}
|
||||
|
||||
describe('FileTree row actions', () => {
|
||||
it('names the per-row actions trigger after the file', () => {
|
||||
render(
|
||||
<FileTree
|
||||
files={[file]}
|
||||
onFileSelect={vi.fn()}
|
||||
onDirectoryClick={vi.fn()}
|
||||
selectedFile={null}
|
||||
onDelete={vi.fn()}
|
||||
onRename={vi.fn()}
|
||||
/>,
|
||||
)
|
||||
|
||||
expect(screen.getByRole('button', { name: 'Actions for notes.txt' })).toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
@@ -181,7 +181,8 @@ function TreeNode({ file, level, onFileSelect, onDirectoryClick, selectedFile, o
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="sm"
|
||||
className={`w-6 h-6 p-0 ${isMobile ? 'opacity-100' : 'opacity-0 group-hover:opacity-100'}`}
|
||||
aria-label={`Actions for ${file.name}`}
|
||||
className={`w-6 h-6 p-0 ${isMobile ? 'opacity-100' : 'opacity-0 group-hover:opacity-100 focus-visible:opacity-100'}`}
|
||||
>
|
||||
<MoreVertical className="w-3 h-3" />
|
||||
</Button>
|
||||
|
||||
Reference in new issue
Block a user