feat(dashboard): add Channels tab to manage channel profiles

New Channels section backed by the /api/channels CRUD API:
- list rail plus a full editor for every profile field
- chip inputs for string lists, reorderable thumbnail role order, presenter toggle
- create/update/delete with inline confirm and server-error surfacing
- JSON import/export (all profiles or one), with per-item import failures
- responsive two-column layout in the app's design language

Renumbers Settings to 04 and adds channels to the deep-link tabs.
This commit is contained in:
pedro-bento 2026-10-06 11:57:27 +01:00
parent ab5cdb87a9
commit d6275aab4c
2 changed files with 1039 additions and 4 deletions

View file

@ -1,10 +1,11 @@
import React, { useState, useEffect, useRef, useMemo } from 'react';
import { Youtube, Instagram, Share2, ChevronDown, Check, Activity, LayoutDashboard, Settings, Plus, X, Terminal, Shield, Image, RotateCcw, AlertTriangle, KeyRound, ExternalLink, Mail, Loader2, Download, Menu, Lock } from 'lucide-react';
import { Youtube, Instagram, Share2, ChevronDown, Check, Activity, LayoutDashboard, Settings, Plus, X, Terminal, Shield, Image, Radio, RotateCcw, AlertTriangle, KeyRound, ExternalLink, Mail, Loader2, Download, Menu, Lock } from 'lucide-react';
import KeyInput from './components/KeyInput';
import MediaInput from './components/MediaInput';
import ResultCard from './components/ResultCard';
import ProcessingAnimation from './components/ProcessingAnimation';
import ThumbnailStudio from './components/ThumbnailStudio';
import ChannelProfiles from './components/ChannelProfiles';
import ClipEditor from './components/ClipEditor';
import ReframeEditor from './components/ReframeEditor';
import StarBanner from './components/StarBanner';
@ -575,7 +576,7 @@ function App() {
// Read once per hash change, then the query is dropped so a reload does not
// keep forcing the tab.
useEffect(() => {
const DEEP_LINK_TABS = ['settings', 'thumbnails', 'dashboard'];
const DEEP_LINK_TABS = ['settings', 'thumbnails', 'channels', 'dashboard'];
const apply = () => {
const hash = window.location.hash || '';
if (!hash.startsWith('#app?')) return;
@ -810,7 +811,8 @@ function App() {
const navItems = [
{ id: 'dashboard', ord: '01', icon: LayoutDashboard, label: 'Clip Generator', short: 'clips', primary: true },
{ id: 'thumbnails', ord: '02', icon: Image, label: 'YouTube Studio', short: 'studio', primary: true },
{ id: 'settings', ord: '03', icon: Settings, label: 'Settings', short: 'settings' },
{ id: 'channels', ord: '03', icon: Radio, label: 'Channels', short: 'channels' },
{ id: 'settings', ord: '04', icon: Settings, label: 'Settings', short: 'settings' },
];
const activeNav = navItems.find((n) => n.id === activeTab);
@ -1102,12 +1104,15 @@ function App() {
{/* Main Workspace */}
<div className="flex-1 overflow-hidden relative">
{/* View: Channels */}
{activeTab === 'channels' && <ChannelProfiles />}
{/* View: Settings */}
{activeTab === 'settings' && (
<div className="h-full overflow-y-auto p-4 sm:p-8 max-w-2xl mx-auto animate-fade">
<div className="flex flex-col sm:flex-row sm:items-start sm:justify-between gap-4 mb-8">
<div>
<p className="eyebrow mb-1.5">03 · SETTINGS</p>
<p className="eyebrow mb-1.5">04 · SETTINGS</p>
<h1 className="font-display lowercase text-2xl text-ink">Settings</h1>
</div>
<div className="flex items-center gap-2 text-xs text-muted mt-1">

File diff suppressed because it is too large Load diff