Compare commits
No commits in common. "e201fe0135cd18e2bcff238ce18d05b47b2c0a1d" and "743b65f917fde792763614222cf66fe01fd3680d" have entirely different histories.
e201fe0135
...
743b65f917
3 changed files with 108 additions and 193 deletions
|
|
@ -2280,6 +2280,24 @@ export default function App() {
|
||||||
Добавить ролик
|
Добавить ролик
|
||||||
</Button>
|
</Button>
|
||||||
</form>
|
</form>
|
||||||
|
</div>
|
||||||
|
) : null}
|
||||||
|
|
||||||
|
{activeView === "settings" ? (
|
||||||
|
<SettingsPanel onBack={() => setActiveView("dashboard")} onSaved={handleSettingsSaved} />
|
||||||
|
) : <>
|
||||||
|
<section className="workspace-grid grid gap-5 xl:grid-cols-2">
|
||||||
|
<Card className="work-column min-w-0">
|
||||||
|
<CardHeader>
|
||||||
|
<div className="flex items-start justify-between gap-4">
|
||||||
|
<div>
|
||||||
|
<CardTitle>Ролики</CardTitle>
|
||||||
|
<CardDescription>Все ролики, прогресс обработки, логи и готовые черновики в одном списке.</CardDescription>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent className="work-list flex max-h-[72vh] flex-col gap-2 overflow-y-auto">
|
||||||
|
<div className="grid gap-2 xl:grid-cols-[minmax(0,1fr)_13rem]">
|
||||||
<section
|
<section
|
||||||
className={`local-video-upload rounded-md border border-dashed p-3 transition-colors ${
|
className={`local-video-upload rounded-md border border-dashed p-3 transition-colors ${
|
||||||
localVideoDragActive ? "border-primary bg-primary/5" : "border-border bg-background"
|
localVideoDragActive ? "border-primary bg-primary/5" : "border-border bg-background"
|
||||||
|
|
@ -2367,13 +2385,8 @@ export default function App() {
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
</section>
|
</section>
|
||||||
</div>
|
|
||||||
) : null}
|
|
||||||
|
|
||||||
{activeView === "settings" ? (
|
<section className={`rounded-md border bg-background p-3 ${videoStorageLow ? "border-amber-300 bg-amber-50/60" : "border-border"}`} aria-live="polite">
|
||||||
<SettingsPanel onBack={() => setActiveView("dashboard")} onSaved={handleSettingsSaved} />
|
|
||||||
) : <>
|
|
||||||
<section className={`video-storage-strip rounded-md border bg-background p-3 ${videoStorageLow ? "border-amber-300 bg-amber-50/60" : "border-border"}`} aria-live="polite">
|
|
||||||
<div className="flex items-center justify-between gap-2">
|
<div className="flex items-center justify-between gap-2">
|
||||||
<p className="text-xs font-semibold uppercase tracking-wide text-muted-foreground">Видео на диске</p>
|
<p className="text-xs font-semibold uppercase tracking-wide text-muted-foreground">Видео на диске</p>
|
||||||
{videoStorage ? <span className="text-xs tabular-nums text-muted-foreground">{videoStoragePercent}%</span> : null}
|
{videoStorage ? <span className="text-xs tabular-nums text-muted-foreground">{videoStoragePercent}%</span> : null}
|
||||||
|
|
@ -2391,17 +2404,7 @@ export default function App() {
|
||||||
<p className="mt-3 text-xs leading-5 text-muted-foreground">Данные о диске недоступны.</p>
|
<p className="mt-3 text-xs leading-5 text-muted-foreground">Данные о диске недоступны.</p>
|
||||||
)}
|
)}
|
||||||
</section>
|
</section>
|
||||||
<section className="workspace-grid grid gap-5 xl:grid-cols-2">
|
|
||||||
<Card className="work-column min-w-0">
|
|
||||||
<CardHeader>
|
|
||||||
<div className="flex items-start justify-between gap-4">
|
|
||||||
<div>
|
|
||||||
<CardTitle>Ролики</CardTitle>
|
|
||||||
<CardDescription>Все ролики, прогресс обработки, логи и готовые черновики в одном списке.</CardDescription>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
</CardHeader>
|
|
||||||
<CardContent className="work-list flex max-h-[72vh] flex-col gap-2 overflow-y-auto">
|
|
||||||
{productionVideos.length > 0 ? (
|
{productionVideos.length > 0 ? (
|
||||||
productionVideos.map((video) => {
|
productionVideos.map((video) => {
|
||||||
const draftArticles = video.articles?.filter((article) => article.status !== "published") ?? []
|
const draftArticles = video.articles?.filter((article) => article.status !== "published") ?? []
|
||||||
|
|
|
||||||
|
|
@ -1,63 +0,0 @@
|
||||||
# Dashboard Video Upload Layout Implementation Plan
|
|
||||||
|
|
||||||
> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.
|
|
||||||
|
|
||||||
**Goal:** Place local-file upload next to URL import and place disk capacity across the dashboard above the work columns.
|
|
||||||
|
|
||||||
**Architecture:** Move existing JSX sections without changing their state, handlers or API calls. The existing `.command-row` owns the two methods of adding a video; a new full-width storage section sits directly before `workspace-grid`.
|
|
||||||
|
|
||||||
**Tech Stack:** React 19, TypeScript, Tailwind CSS, Vite.
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
### Task 1: Recompose the dashboard regions
|
|
||||||
|
|
||||||
**Files:**
|
|
||||||
- Modify: `admin/src/App.tsx:2267-2406`
|
|
||||||
|
|
||||||
- [ ] **Step 1: Capture the existing placement**
|
|
||||||
|
|
||||||
At desktop width, confirm that URL import is above the workspace while local upload and disk capacity are nested in the scrollable «Ролики» card.
|
|
||||||
|
|
||||||
- [ ] **Step 2: Move the existing local upload section to `command-row`**
|
|
||||||
|
|
||||||
Move the complete `<section className="local-video-upload …">` with its hidden input, refs, drag events, upload state and progress UI to be the second child of `.command-row`, immediately after the URL import `<form>`. Do not change `uploadLocalVideo`, `selectLocalVideo`, `cancelLocalVideoUpload`, or their state.
|
|
||||||
|
|
||||||
- [ ] **Step 3: Make disk capacity a full-width dashboard region**
|
|
||||||
|
|
||||||
Move the existing `Видео на диске` `<section>` out of `CardContent.work-list` and render it immediately after `.command-row` and before `<section className="workspace-grid …">`. Preserve `videoStorage`, `videoStorageLow`, the progress percentage, aria-live and all warning styles.
|
|
||||||
|
|
||||||
- [ ] **Step 4: Remove the obsolete nested two-column wrapper**
|
|
||||||
|
|
||||||
Delete the inner `grid gap-2 xl:grid-cols-[minmax(0,1fr)_13rem]` that previously coupled local upload and storage inside the video list. Keep video cards as direct list children so scrolling only affects the list.
|
|
||||||
|
|
||||||
- [ ] **Step 5: Build and check responsive order**
|
|
||||||
|
|
||||||
Run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
npm run build --prefix admin
|
|
||||||
```
|
|
||||||
|
|
||||||
Expected: TypeScript and Vite build successfully. Inspect 390 px and desktop: mobile order is URL, local file, disk capacity, videos, drafts; at `lg` width URL and local file are side by side; capacity spans the workspace width.
|
|
||||||
|
|
||||||
- [ ] **Step 6: Run detector and commit**
|
|
||||||
|
|
||||||
Run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
node /Users/dima/.agents/skills/impeccable/scripts/detect.mjs --json --scope layout admin/src/App.tsx
|
|
||||||
git diff --check
|
|
||||||
```
|
|
||||||
|
|
||||||
Expected: detector findings are `[]` and diff check has no output.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git add admin/src/App.tsx
|
|
||||||
git commit -m "fix: reorganize video upload dashboard"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Plan review
|
|
||||||
|
|
||||||
- The plan covers exact requested placement and keeps all data/API behavior unchanged.
|
|
||||||
- It does not add components, CSS, routes, state or dependencies because the current `lg:grid-cols-2` command row already provides the intended responsive behavior.
|
|
||||||
|
|
@ -1,25 +0,0 @@
|
||||||
# Раскладка загрузки видео на панели
|
|
||||||
|
|
||||||
## Цель
|
|
||||||
|
|
||||||
Сделать два способа добавления ролика одной понятной группой: ссылка слева, локальный файл справа. Показатель места на диске должен быть общим ресурсом и занимать всю ширину перед рабочими колонками.
|
|
||||||
|
|
||||||
## Структура
|
|
||||||
|
|
||||||
1. В верхней строке панели находятся две равные области: существующая форма «Добавить ролик» по ссылке и существующая область «Загрузить видео с компьютера».
|
|
||||||
2. Ниже размещается существующая полоса «Видео на диске» на всю доступную ширину.
|
|
||||||
3. Затем остаются существующие колонки «Ролики» и «Черновики».
|
|
||||||
4. На экранах уже, чем `lg`, порядок в DOM и на экране линейный: ссылка, локальный файл, место на диске, ролики, черновики.
|
|
||||||
|
|
||||||
## Сохранение поведения
|
|
||||||
|
|
||||||
- Не меняются маршруты, состояние загрузки, drag-and-drop, отмена, прогресс, предупреждение о малом свободном месте и обновление индикатора после загрузки.
|
|
||||||
- Не меняется импорт ролика по URL и рабочие карточки роликов/черновиков.
|
|
||||||
- Локальная зона загрузки сохраняет доступный file input и кнопку выбора файла.
|
|
||||||
|
|
||||||
## Проверка
|
|
||||||
|
|
||||||
1. На desktop оба способа загрузки видны рядом, а индикатор диска расположен под ними и над колонками.
|
|
||||||
2. На 320, 375, 390 и 430 px блоки становятся одной вертикальной последовательностью без горизонтальной прокрутки.
|
|
||||||
3. Выбор файла, перетаскивание, отмена и отображение прогресса продолжают работать; после успешной загрузки обновляется место на диске.
|
|
||||||
4. Импорт ссылки сохраняет прежний сценарий и состояние кнопки.
|
|
||||||
Loading…
Reference in a new issue