diff --git a/CHANGELOG.md b/CHANGELOG.md index a7250aa..ef8192e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,12 @@ All notable changes to CodeCraft. Versions follow [Semantic Versioning](https://semver.org/); until 1.0, minor versions may contain breaking changes. +## [Unreleased] + +### Changed + +- **Factory: project dropdown** instead of one button per project – choose "All projects" or a single one; the choice is remembered. + ## [v202611-00060] – 2026-11-18 ### Changed diff --git a/web/src/components/Factory.tsx b/web/src/components/Factory.tsx index 3848561..48731a1 100644 --- a/web/src/components/Factory.tsx +++ b/web/src/components/Factory.tsx @@ -170,7 +170,19 @@ export function Factory({ onMenu }: { onMenu: () => void }) { function FactoryOverview({ onSettings }: { onSettings: () => void }) { const t = useT(); const [data, setData] = useState(); - const [repo, setRepo] = useState(""); + const [repo, setRepoState] = useState(() => { + try { + return localStorage.getItem("codecraft.factoryRepo") ?? ""; + } catch { + return ""; + } + }); + const setRepo = (r: string) => { + setRepoState(r); + try { + localStorage.setItem("codecraft.factoryRepo", r); + } catch {} + }; const [sel, setSel] = useState(""); const [now, setNow] = useState(Date.now()); const [busy, setBusy] = useState(false); @@ -189,6 +201,11 @@ function FactoryOverview({ onSettings }: { onSettings: () => void }) { return () => clearInterval(h); }, []); + // A remembered project that no longer exists falls back to "all". + useEffect(() => { + if (data && repo && !data.repos.some((r) => r.url === repo)) setRepo(""); + }, [data, repo]); + const newProject = async () => { setBusy(true); try { @@ -383,26 +400,33 @@ function FactoryOverview({ onSettings }: { onSettings: () => void }) {
- - {data.repos.map((r) => { - const mine = data.issues.filter((i) => i.repo === r.url); + + {(() => { + const r = data.repos.find((x) => x.url === repo); + if (!r) return null; return ( - + ); - })} + })()} diff --git a/web/src/i18n/de.ts b/web/src/i18n/de.ts index f80e20b..b691a04 100644 --- a/web/src/i18n/de.ts +++ b/web/src/i18n/de.ts @@ -1324,6 +1324,7 @@ export const de: Messages = { "factory.test": "Verbindung testen", "factory.testOk": "Verbunden als {login} mit {repo}; {n} Labels angelegt, Repository geklont.", "factory.deleteConfirm": "{name} aus der Factory entfernen? Issues und Chats bleiben.", + "factory.project": "Projekt", "factory.newProject": "Neues Projekt", "factory.connections": "Verbindungen", "factory.connectionsHint": "Deine Konten bei Gitea, GitHub oder GitLab. Jeder Nutzer richtet seine eigenen ein; Repositories nutzen den Token ihrer Verbindung, sofern sie keinen eigenen haben.", diff --git a/web/src/i18n/en.ts b/web/src/i18n/en.ts index 53241eb..e797508 100644 --- a/web/src/i18n/en.ts +++ b/web/src/i18n/en.ts @@ -1323,6 +1323,7 @@ export const en = { "factory.test": "Test connection", "factory.testOk": "Connected as {login} to {repo}; {n} labels created, repository cloned.", "factory.deleteConfirm": "Remove {name} from the factory? Issues and chats stay.", + "factory.project": "Project", "factory.newProject": "New project", "factory.connections": "Connections", "factory.connectionsHint": "Your accounts at Gitea, GitHub or GitLab. Each user sets up their own; repositories use the token of their connection unless they have a token of their own.", diff --git a/web/src/styles.css b/web/src/styles.css index 2af2466..bc33eda 100644 --- a/web/src/styles.css +++ b/web/src/styles.css @@ -5044,6 +5044,16 @@ td.fold-indent { margin-bottom: 14px; align-items: stretch; } +.factory-repo-select { + min-width: 220px; + max-width: 100%; +} +.factory-repo-info { + display: inline-flex; + flex-wrap: wrap; + align-items: center; + gap: 6px; +} .factory-repo { display: flex; flex-direction: column; diff --git a/web/src/whatsnew.ts b/web/src/whatsnew.ts index 1f44fb0..64f0efc 100644 --- a/web/src/whatsnew.ts +++ b/web/src/whatsnew.ts @@ -3,6 +3,10 @@ * under "unreleased"; scripts/release.sh renames the key to the release version. */ export const WHATS_NEW: Record = { + unreleased: { + en: ["Factory: projects are chosen from a dropdown (all projects or a single one)"], + de: ["Factory: Projekte werden per Dropdown gewählt (alle oder nur eins)"], + }, "202611-00060": { en: ["Uploads are chunked everywhere and show progress per file and in total", "Factory: recreate mode – analyse existing software in depth and rebuild it clean-room from a specification with milestones"], de: ["Uploads laufen überall in Teilen und zeigen den Fortschritt je Datei und gesamt", "Factory: Nachbau-Modus – bestehende Software bis ins Detail analysieren und Cleanroom aus einer Spezifikation mit Meilensteinen neu bauen"],