fix(workspace): make file import a compact icon action
Place the import icon after New File and retain destination tooltips, accessible labels, and disabled state while importing. Validation: WorkspaceFilesPanel tests passed (41 tests). Release note: Replace the prominent file import button with a compact icon beside New File.
This commit is contained in:
@@ -6,7 +6,7 @@ FR-WF1:工作区展示当前项目执行目录内的实际文件。成果页
|
|||||||
已移除。旧布局只过滤 `results` 实例,保留其他实例、目标、展开状态和宽度;若活动实例被移除,
|
已移除。旧布局只过滤 `results` 实例,保留其他实例、目标、展开状态和宽度;若活动实例被移除,
|
||||||
按现有布局规则选择第一个保留实例。
|
按现有布局规则选择第一个保留实例。
|
||||||
|
|
||||||
FR-WF2:文件页提供“导入文件”。初始目标为项目根目录;点击树中的目录后以该目录为目标,
|
FR-WF2:文件页在“新建文件”后提供“导入文件”小图标按钮,悬停提示包含动作和目标目录,导入期间禁用并更新可访问名称。初始目标为项目根目录;点击树中的目录后以该目录为目标,
|
||||||
点击文件后以其父目录为目标,“浏览此目录”同时更新目标。目标路径常显,打开选择器后固定
|
点击文件后以其父目录为目标,“浏览此目录”同时更新目标。目标路径常显,打开选择器后固定
|
||||||
本次项目与目标,不因切换会话或项目改变写入位置。本机从选定文件复制字节,远程上传到所选
|
本次项目与目标,不因切换会话或项目改变写入位置。本机从选定文件复制字节,远程上传到所选
|
||||||
Host 的项目目录。支持二进制和空文件,不调用文档解析器,也不创建 artifact 数据库记录。
|
Host 的项目目录。支持二进制和空文件,不调用文档解析器,也不创建 artifact 数据库记录。
|
||||||
|
|||||||
@@ -600,9 +600,9 @@ export function WorkspaceFilesPanel({
|
|||||||
<button ref={refreshRef} className="icon-button" type="button" disabled={refreshing} aria-label={t('sidebar.workspace.refreshAriaLabel')} title={t('sidebar.workspace.refresh')} onClick={() => void refresh()}><RefreshCw size={14} aria-hidden="true" /></button>
|
<button ref={refreshRef} className="icon-button" type="button" disabled={refreshing} aria-label={t('sidebar.workspace.refreshAriaLabel')} title={t('sidebar.workspace.refresh')} onClick={() => void refresh()}><RefreshCw size={14} aria-hidden="true" /></button>
|
||||||
</div>
|
</div>
|
||||||
{activeView === 'files' && root && <div className="workspace-files__toolbar workspace-files__actions">
|
{activeView === 'files' && root && <div className="workspace-files__toolbar workspace-files__actions">
|
||||||
<button className="secondary-button" type="button" disabled={importing} onClick={() => void importFiles()}><Upload size={14} aria-hidden="true" />{t(importing ? 'management.importing' : 'management.importFiles')}</button>
|
|
||||||
<span className="workspace-files__destination" title={createTarget || '/'}>{t('management.importTarget', { path: createTarget || '/' })}</span>
|
<span className="workspace-files__destination" title={createTarget || '/'}>{t('management.importTarget', { path: createTarget || '/' })}</span>
|
||||||
<button className="icon-button" type="button" aria-label={t('management.createFile')} title={`${t('management.createFile')}: ${createTarget || '/'}`} onClick={() => setDialog({ kind: 'createFile', path: createTarget })}><FilePlus size={14} aria-hidden="true" /></button>
|
<button className="icon-button" type="button" aria-label={t('management.createFile')} title={`${t('management.createFile')}: ${createTarget || '/'}`} onClick={() => setDialog({ kind: 'createFile', path: createTarget })}><FilePlus size={14} aria-hidden="true" /></button>
|
||||||
|
<button className="icon-button" type="button" disabled={importing} aria-label={t(importing ? 'management.importing' : 'management.importFiles')} title={`${t(importing ? 'management.importing' : 'management.importFiles')}: ${createTarget || '/'}`} onClick={() => void importFiles()}><Upload size={14} aria-hidden="true" /></button>
|
||||||
<button className="icon-button" type="button" aria-label={t('management.createDirectory')} title={`${t('management.createDirectory')}: ${createTarget || '/'}`} onClick={() => setDialog({ kind: 'createDirectory', path: createTarget })}><FolderPlus size={14} aria-hidden="true" /></button>
|
<button className="icon-button" type="button" aria-label={t('management.createDirectory')} title={`${t('management.createDirectory')}: ${createTarget || '/'}`} onClick={() => setDialog({ kind: 'createDirectory', path: createTarget })}><FolderPlus size={14} aria-hidden="true" /></button>
|
||||||
</div>}
|
</div>}
|
||||||
{activeView === 'files' && browsedPath && <nav className="workspace-files__breadcrumbs" aria-label={t('management.path')}>
|
{activeView === 'files' && browsedPath && <nav className="workspace-files__breadcrumbs" aria-label={t('management.path')}>
|
||||||
|
|||||||
Reference in New Issue
Block a user