Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a083798d7f | ||
|
|
724405b245 | ||
|
|
585fdd58de | ||
|
|
171b87b766 |
No files matched your search
@@ -3,6 +3,25 @@
|
|||||||
All notable changes to CodeCraft. Versions follow [Semantic Versioning](https://semver.org/);
|
All notable changes to CodeCraft. Versions follow [Semantic Versioning](https://semver.org/);
|
||||||
until 1.0, minor versions may contain breaking changes.
|
until 1.0, minor versions may contain breaking changes.
|
||||||
|
|
||||||
|
## [v202611-00072] – 2026-11-20
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- **Factory: "preparing" lamp.** An issue card whose phase has been started but whose chat does not exist yet – checkout and, for acceptance, installing and starting the app in its throw-away container – shows a blinking blue lamp with the elapsed time instead of staying silent. (Active chats keep their accent-coloured lamp.)
|
||||||
|
|
||||||
|
## [v202611-00071] – 2026-11-20
|
||||||
|
|
||||||
|
### Added
|
||||||
|
|
||||||
|
- **Drafts in every chat.** What you have typed but not sent is kept: in the web UI and in the terminal client's server chats on the server (so you can continue on another device – it is picked up when you open or return to the chat, as long as you have no unsent edits of your own), in the terminal client's local chats in a file. Sending clears it.
|
||||||
|
- **Factory: chats open in an overlay on the desktop** (`#/factory/s/<id>`), closed with one click, Esc (outside text fields) or the back button, with a button to open the chat as a full page. Every issue card has an *open chat* button for the newest phase chat that still exists. On small screens chats still open as pages.
|
||||||
|
|
||||||
|
- **Factory main switch** at the top of the overview (web and PWA): green = running, yellow = stopping, red = stopped. Stopping is *soft*: no new review, build or acceptance starts, agents that are running finish their phase – the switch stays yellow until the last one is done, then turns red. Starting takes up work again at once. The state is kept across restarts; the board still updates while the factory is stopped. The colours come from the theme (new variables `--power-on`, `--power-warn`, `--power-off`, set in all 32 theme files).
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
|
||||||
|
- The factory overview uses the full width of the window.
|
||||||
|
|
||||||
## [v202611-00070] – 2026-11-20
|
## [v202611-00070] – 2026-11-20
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p align="center">
|
<p align="center">
|
||||||
<img alt="Version v202611-00070" src="https://img.shields.io/badge/version-v202611--00070-d69e2e?style=flat-square">
|
<img alt="Version v202611-00072" src="https://img.shields.io/badge/version-v202611--00072-d69e2e?style=flat-square">
|
||||||
<img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-689d6a?style=flat-square">
|
<img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-689d6a?style=flat-square">
|
||||||
<img alt="Rust backend" src="https://img.shields.io/badge/backend-Rust-b7410e?style=flat-square&logo=rust">
|
<img alt="Rust backend" src="https://img.shields.io/badge/backend-Rust-b7410e?style=flat-square&logo=rust">
|
||||||
<img alt="React PWA" src="https://img.shields.io/badge/frontend-React%20PWA-2d81ff?style=flat-square&logo=react">
|
<img alt="React PWA" src="https://img.shields.io/badge/frontend-React%20PWA-2d81ff?style=flat-square&logo=react">
|
||||||
@@ -332,6 +332,11 @@ phase the model, agent (CodeCraft or Claude Code), permission mode, timeout, tri
|
|||||||
technical failures, the skills that are switched on for it, plus the number of rework rounds (default 2). Failed or rejected issues
|
technical failures, the skills that are switched on for it, plus the number of rework rounds (default 2). Failed or rejected issues
|
||||||
can be restarted from the board, finished ones are closed with a comment.
|
can be restarted from the board, finished ones are closed with a comment.
|
||||||
|
|
||||||
|
**Main switch.** The switch at the top of the factory page starts and stops the whole factory.
|
||||||
|
*Stop* is soft: no new review, build or acceptance starts, running agents finish their phase.
|
||||||
|
The switch is green while the factory runs, yellow while it is stopping (agents still working)
|
||||||
|
and red once the last agent is done. The state survives restarts.
|
||||||
|
|
||||||
**Backlog.** The first column of the board lists every open issue of the configured
|
**Backlog.** The first column of the board lists every open issue of the configured
|
||||||
repositories that is not in the factory yet. *Queue* gives an issue the factory label on the
|
repositories that is not in the factory yet. *Queue* gives an issue the factory label on the
|
||||||
forge (so it enters the review at once); *Queue all* does it for the whole list. Issues of authors
|
forge (so it enters the review at once); *Queue all* does it for the whole list. Issues of authors
|
||||||
|
|||||||
+114
@@ -143,6 +143,33 @@ pub struct App {
|
|||||||
pending_note: Option<oneshot::Receiver<Result<String>>>,
|
pending_note: Option<oneshot::Receiver<Result<String>>>,
|
||||||
/// The factory issue ("repo#number") whose actions are open.
|
/// The factory issue ("repo#number") whose actions are open.
|
||||||
factory_key: String,
|
factory_key: String,
|
||||||
|
/// Unsent input is kept per chat: on the server for server chats (so another device can continue it),
|
||||||
|
/// in a local file for local chats.
|
||||||
|
draft: DraftSync,
|
||||||
|
}
|
||||||
|
|
||||||
|
struct DraftSync {
|
||||||
|
/// "remote:<id>" or "local:<id>" of the chat the draft belongs to.
|
||||||
|
key: String,
|
||||||
|
/// What the editor held at the last look, and since when.
|
||||||
|
seen: String,
|
||||||
|
changed: Instant,
|
||||||
|
/// What is stored (or was last stored) for this chat.
|
||||||
|
synced: String,
|
||||||
|
loaded: bool,
|
||||||
|
pull: Option<oneshot::Receiver<Result<String>>>,
|
||||||
|
last_pull: Instant,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl DraftSync {
|
||||||
|
fn new() -> Self {
|
||||||
|
Self { key: String::new(), seen: String::new(), changed: Instant::now(), synced: String::new(), loaded: false, pull: None, last_pull: Instant::now() }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn local_draft_path(id: &str) -> std::path::PathBuf {
|
||||||
|
let safe: String = id.chars().filter(|c| c.is_ascii_alphanumeric() || *c == '-' || *c == '_').collect();
|
||||||
|
crate::conf::data_dir().join("drafts").join(format!("{safe}.txt"))
|
||||||
}
|
}
|
||||||
|
|
||||||
const SPINNER: &[&str] = &["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
const SPINNER: &[&str] = &["⠋", "⠙", "⠹", "⠸", "⠼", "⠴", "⠦", "⠧", "⠇", "⠏"];
|
||||||
@@ -316,6 +343,7 @@ impl App {
|
|||||||
dialog: Dialog::None,
|
dialog: Dialog::None,
|
||||||
todos: session.todos.clone(),
|
todos: session.todos.clone(),
|
||||||
context: session.context_tokens,
|
context: session.context_tokens,
|
||||||
|
draft: DraftSync::new(),
|
||||||
session,
|
session,
|
||||||
effort: None,
|
effort: None,
|
||||||
images: vec![],
|
images: vec![],
|
||||||
@@ -1441,7 +1469,93 @@ impl App {
|
|||||||
self.status = "loading models…".into();
|
self.status = "loading models…".into();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Keep the unsent input of the current chat: load it when the chat changes, save it shortly after typing.
|
||||||
|
fn poll_draft(&mut self) {
|
||||||
|
let remote_id = self.remote.as_ref().map(|r| r.id.clone());
|
||||||
|
let key = match &remote_id {
|
||||||
|
Some(id) => format!("remote:{id}"),
|
||||||
|
None => format!("local:{}", self.session.id),
|
||||||
|
};
|
||||||
|
if self.draft.key != key {
|
||||||
|
self.draft = DraftSync::new();
|
||||||
|
self.draft.key = key.clone();
|
||||||
|
self.draft.seen = self.editor.text();
|
||||||
|
match &remote_id {
|
||||||
|
Some(id) => self.draft_pull(id.clone()),
|
||||||
|
None => {
|
||||||
|
let text = std::fs::read_to_string(local_draft_path(&self.session.id)).unwrap_or_default();
|
||||||
|
if self.editor.is_empty() && !text.is_empty() {
|
||||||
|
self.editor.set(&text);
|
||||||
|
self.draft.seen = text.clone();
|
||||||
|
}
|
||||||
|
self.draft.synced = if self.editor.is_empty() { String::new() } else { self.draft.seen.clone() };
|
||||||
|
self.draft.loaded = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if let Some(rx) = &mut self.draft.pull {
|
||||||
|
if let Ok(res) = rx.try_recv() {
|
||||||
|
self.draft.pull = None;
|
||||||
|
if let Ok(text) = res {
|
||||||
|
// First load: only into an empty field. Later: only when nothing was typed here since the last sync.
|
||||||
|
let untouched = if self.draft.loaded { self.editor.text() == self.draft.synced } else { self.editor.is_empty() };
|
||||||
|
if untouched && text != self.editor.text() {
|
||||||
|
self.editor.set(&text);
|
||||||
|
self.draft.seen = text.clone();
|
||||||
|
self.draft.synced = text;
|
||||||
|
} else if !self.draft.loaded {
|
||||||
|
self.draft.synced = if untouched { text } else { String::new() };
|
||||||
|
}
|
||||||
|
self.draft.loaded = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
let cur = self.editor.text();
|
||||||
|
if cur != self.draft.seen {
|
||||||
|
self.draft.seen = cur;
|
||||||
|
self.draft.changed = Instant::now();
|
||||||
|
}
|
||||||
|
if self.draft.loaded && self.draft.seen != self.draft.synced && self.draft.changed.elapsed() >= Duration::from_millis(700) {
|
||||||
|
let text = self.draft.seen.clone();
|
||||||
|
self.draft.synced = text.clone();
|
||||||
|
match (&remote_id, self.env.server.clone()) {
|
||||||
|
(Some(id), Some(server)) => {
|
||||||
|
let id = id.clone();
|
||||||
|
tokio::spawn(async move {
|
||||||
|
let _ = remote::draft_put(&server, &id, &text).await;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
(None, _) => {
|
||||||
|
let path = local_draft_path(&self.session.id);
|
||||||
|
if text.trim().is_empty() {
|
||||||
|
let _ = std::fs::remove_file(&path);
|
||||||
|
} else if let Some(dir) = path.parent() {
|
||||||
|
let _ = std::fs::create_dir_all(dir);
|
||||||
|
let _ = std::fs::write(&path, &text);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Pick up what was typed on another device while this field has no unsent edits.
|
||||||
|
if let (Some(id), true) = (&remote_id, self.draft.loaded && self.draft.pull.is_none() && self.draft.last_pull.elapsed() >= Duration::from_secs(10) && self.editor.text() == self.draft.synced) {
|
||||||
|
self.draft.last_pull = Instant::now();
|
||||||
|
self.draft_pull(id.clone());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fn draft_pull(&mut self, id: String) {
|
||||||
|
let Some(server) = self.env.server.clone() else { return };
|
||||||
|
let (tx, rx) = oneshot::channel();
|
||||||
|
tokio::spawn(async move {
|
||||||
|
let _ = tx.send(remote::draft_get(&server, &id).await);
|
||||||
|
});
|
||||||
|
self.draft.pull = Some(rx);
|
||||||
|
self.draft.last_pull = Instant::now();
|
||||||
|
}
|
||||||
|
|
||||||
fn poll_pending(&mut self) {
|
fn poll_pending(&mut self) {
|
||||||
|
self.poll_draft();
|
||||||
self.poll_remote();
|
self.poll_remote();
|
||||||
if let Some(rx) = &mut self.pending_detect {
|
if let Some(rx) = &mut self.pending_detect {
|
||||||
if let Ok(found) = rx.try_recv() {
|
if let Ok(found) = rx.try_recv() {
|
||||||
|
|||||||
@@ -104,6 +104,16 @@ pub async fn prompt(server: &Server, id: &str, text: &str) -> Result<()> {
|
|||||||
server.post(&format!("/sessions/{id}/prompt"), json!({"text": text})).await.map(|_| ())
|
server.post(&format!("/sessions/{id}/prompt"), json!({"text": text})).await.map(|_| ())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The unsent message of a server chat (typed in the web UI or in another terminal).
|
||||||
|
pub async fn draft_get(server: &Server, id: &str) -> Result<String> {
|
||||||
|
let d = server.get(&format!("/sessions/{id}/composer-draft")).await?;
|
||||||
|
Ok(d["text"].as_str().unwrap_or("").to_string())
|
||||||
|
}
|
||||||
|
|
||||||
|
pub async fn draft_put(server: &Server, id: &str, text: &str) -> Result<()> {
|
||||||
|
server.put(&format!("/sessions/{id}/composer-draft"), json!({"text": text})).await.map(|_| ())
|
||||||
|
}
|
||||||
|
|
||||||
pub async fn abort(server: &Server, id: &str) -> Result<()> {
|
pub async fn abort(server: &Server, id: &str) -> Result<()> {
|
||||||
server.post(&format!("/sessions/{id}/abort"), json!({})).await.map(|_| ())
|
server.post(&format!("/sessions/{id}/abort"), json!({})).await.map(|_| ())
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -74,6 +74,11 @@ impl Server {
|
|||||||
Ok(check(resp).await?.json().await?)
|
Ok(check(resp).await?.json().await?)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub async fn put(&self, path: &str, body: Value) -> Result<Value> {
|
||||||
|
let resp = self.http.put(format!("{}/api{path}", self.url)).bearer_auth(&self.token).json(&body).send().await.with_context(|| format!("cannot reach {}", self.url))?;
|
||||||
|
Ok(check(resp).await?.json().await?)
|
||||||
|
}
|
||||||
|
|
||||||
pub async fn post(&self, path: &str, body: Value) -> Result<Value> {
|
pub async fn post(&self, path: &str, body: Value) -> Result<Value> {
|
||||||
let resp = self.http.post(format!("{}/api{path}", self.url)).bearer_auth(&self.token).json(&body).send().await.with_context(|| format!("cannot reach {}", self.url))?;
|
let resp = self.http.post(format!("{}/api{path}", self.url)).bearer_auth(&self.token).json(&body).send().await.with_context(|| format!("cannot reach {}", self.url))?;
|
||||||
Ok(check(resp).await?.json().await?)
|
Ok(check(resp).await?.json().await?)
|
||||||
|
|||||||
@@ -96,6 +96,7 @@ pub fn router(app: AppState) -> Router {
|
|||||||
.route("/sessions/{id}/compact", post(compact))
|
.route("/sessions/{id}/compact", post(compact))
|
||||||
.route("/sessions/{id}/rewind", post(rewind))
|
.route("/sessions/{id}/rewind", post(rewind))
|
||||||
.route("/sessions/{id}/job-draft", post(job_draft))
|
.route("/sessions/{id}/job-draft", post(job_draft))
|
||||||
|
.route("/sessions/{id}/composer-draft", get(get_composer_draft).put(put_composer_draft))
|
||||||
.route("/projects/overview", get(project_overview))
|
.route("/projects/overview", get(project_overview))
|
||||||
.route("/sessions/{id}/project-defaults", get(get_project_defaults).put(put_project_defaults).delete(delete_project_defaults))
|
.route("/sessions/{id}/project-defaults", get(get_project_defaults).put(put_project_defaults).delete(delete_project_defaults))
|
||||||
.route("/sessions/{id}/check", get(get_check).put(put_check))
|
.route("/sessions/{id}/check", get(get_check).put(put_check))
|
||||||
@@ -169,6 +170,7 @@ pub fn router(app: AppState) -> Router {
|
|||||||
.route("/account/factory/test", post(test_factory))
|
.route("/account/factory/test", post(test_factory))
|
||||||
.route("/factory/overview", get(factory_overview))
|
.route("/factory/overview", get(factory_overview))
|
||||||
.route("/factory/backlog", get(factory_backlog))
|
.route("/factory/backlog", get(factory_backlog))
|
||||||
|
.route("/factory/power", post(factory_power))
|
||||||
.route("/factory/backlog/enqueue", post(factory_enqueue))
|
.route("/factory/backlog/enqueue", post(factory_enqueue))
|
||||||
.route("/factory/poll", post(factory_poll))
|
.route("/factory/poll", post(factory_poll))
|
||||||
.route("/factory/issues/restart", post(factory_restart))
|
.route("/factory/issues/restart", post(factory_restart))
|
||||||
@@ -1660,6 +1662,27 @@ async fn reply_permission(Extension(user): Extension<User>, State(app): State<Ap
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Instructions for an automation drafted from this chat (small model); the client creates the job.
|
/// Instructions for an automation drafted from this chat (small model); the client creates the job.
|
||||||
|
/// The unsent message of this chat (typed on any device).
|
||||||
|
async fn get_composer_draft(Extension(user): Extension<User>, State(app): State<AppState>, Path(id): Path<String>) -> ApiResult {
|
||||||
|
writable(&app, &user, &id)?;
|
||||||
|
let d = app.store.chat_draft(&id, &user.id)?;
|
||||||
|
Ok(Json(json!({"text": d.as_ref().map(|x| x.0.as_str()).unwrap_or(""), "updated_at": d.map(|x| x.1).unwrap_or(0)})))
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Deserialize)]
|
||||||
|
struct ComposerDraft {
|
||||||
|
text: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
async fn put_composer_draft(Extension(user): Extension<User>, State(app): State<AppState>, Path(id): Path<String>, Json(b): Json<ComposerDraft>) -> ApiResult {
|
||||||
|
writable(&app, &user, &id)?;
|
||||||
|
if b.text.len() > 200_000 {
|
||||||
|
return Err(ApiError(StatusCode::PAYLOAD_TOO_LARGE, "the draft is too long".into()));
|
||||||
|
}
|
||||||
|
let at = app.store.chat_draft_set(&id, &user.id, &b.text)?;
|
||||||
|
Ok(Json(json!({"updated_at": at})))
|
||||||
|
}
|
||||||
|
|
||||||
async fn job_draft(Extension(user): Extension<User>, State(app): State<AppState>, Path(id): Path<String>) -> ApiResult {
|
async fn job_draft(Extension(user): Extension<User>, State(app): State<AppState>, Path(id): Path<String>) -> ApiResult {
|
||||||
let s = writable(&app, &user, &id)?;
|
let s = writable(&app, &user, &id)?;
|
||||||
let (name, prompt) = runner::draft_job(&app, &s).await.map_err(|e| ApiError(StatusCode::BAD_GATEWAY, format!("{e:#}")))?;
|
let (name, prompt) = runner::draft_job(&app, &s).await.map_err(|e| ApiError(StatusCode::BAD_GATEWAY, format!("{e:#}")))?;
|
||||||
@@ -2751,11 +2774,39 @@ async fn factory_overview(Extension(user): Extension<User>, State(app): State<Ap
|
|||||||
"area": app.factory_dir().is_some(),
|
"area": app.factory_dir().is_some(),
|
||||||
"repos": repos,
|
"repos": repos,
|
||||||
"issues": app.store.factory_issues(&user.id)?,
|
"issues": app.store.factory_issues(&user.id)?,
|
||||||
|
"power": factory_power_json(&app, &user),
|
||||||
"runs": app.store.factory_runs(&user.id, None, None, 300)?,
|
"runs": app.store.factory_runs(&user.id, None, None, 300)?,
|
||||||
"releases": app.store.factory_releases(&user.id, 10)?,
|
"releases": app.store.factory_releases(&user.id, 10)?,
|
||||||
})))
|
})))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn factory_power_json(app: &App, user: &User) -> Value {
|
||||||
|
let on = app.store.user_setting::<crate::factory::Power>(&user.id, "factory_power").unwrap_or_default().on;
|
||||||
|
let active = app.store.factory_active(&user.id).unwrap_or(0);
|
||||||
|
json!({"on": on, "active": active, "state": crate::factory::power_state(on, active)})
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Deserialize)]
|
||||||
|
struct PowerBody {
|
||||||
|
on: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// The master switch: stop = no new agent starts (running ones finish), start = take up work again right away.
|
||||||
|
async fn factory_power(Extension(user): Extension<User>, State(app): State<AppState>, headers: axum::http::HeaderMap, Json(b): Json<PowerBody>) -> ApiResult {
|
||||||
|
app.store.set_user_setting(&user.id, "factory_power", &crate::factory::Power { on: b.on })?;
|
||||||
|
app.audit(Some(&user), if b.on { "factory.start" } else { "factory.stop" }, "", &crate::auth::client_ip(&headers));
|
||||||
|
if b.on {
|
||||||
|
let (app2, user2) = (app.clone(), user.clone());
|
||||||
|
tokio::spawn(async move {
|
||||||
|
let s: crate::factory::FactorySettings = app2.store.user_setting(&user2.id, "factory").unwrap_or_default();
|
||||||
|
for cfg in s.repos.iter().filter(|r| r.enabled).map(|r| s.resolve(r)).filter(|r| !r.token.is_empty()) {
|
||||||
|
let _ = crate::factory::poll_repo(&app2, &user2, &cfg).await;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Ok(Json(factory_power_json(&app, &user)))
|
||||||
|
}
|
||||||
|
|
||||||
/// Open issues per repository as the forge lists them; cached for a minute so that the board can ask often.
|
/// Open issues per repository as the forge lists them; cached for a minute so that the board can ask often.
|
||||||
static BACKLOG_CACHE: std::sync::OnceLock<std::sync::Mutex<std::collections::HashMap<String, (std::time::Instant, Vec<Value>)>>> = std::sync::OnceLock::new();
|
static BACKLOG_CACHE: std::sync::OnceLock<std::sync::Mutex<std::collections::HashMap<String, (std::time::Instant, Vec<Value>)>>> = std::sync::OnceLock::new();
|
||||||
|
|
||||||
|
|||||||
+35
-3
@@ -17,6 +17,28 @@ pub const FACTORY_FOLDER: &str = "Factory";
|
|||||||
|
|
||||||
pub const PHASES: [&str; 3] = ["review", "build", "qa"];
|
pub const PHASES: [&str; 3] = ["review", "build", "qa"];
|
||||||
|
|
||||||
|
/// The master switch of a user's factory. Switched off, no new agent starts (a soft stop: agents that
|
||||||
|
/// are running finish their phase); the poller still keeps the board up to date.
|
||||||
|
#[derive(Debug, Clone, Serialize, Deserialize)]
|
||||||
|
pub struct Power {
|
||||||
|
pub on: bool,
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Default for Power {
|
||||||
|
fn default() -> Self {
|
||||||
|
Self { on: true }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// "running" (on), "stopping" (off, agents still working) or "stopped" (off, nobody working).
|
||||||
|
pub fn power_state(on: bool, active: i64) -> &'static str {
|
||||||
|
match (on, active) {
|
||||||
|
(true, _) => "running",
|
||||||
|
(false, 0) => "stopped",
|
||||||
|
(false, _) => "stopping",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Status labels of an issue, in the order of the workflow.
|
/// Status labels of an issue, in the order of the workflow.
|
||||||
pub const STATUS_LABELS: [(&str, &str); 9] = [
|
pub const STATUS_LABELS: [(&str, &str); 9] = [
|
||||||
("factory", "0e8a16"),
|
("factory", "0e8a16"),
|
||||||
@@ -1478,6 +1500,7 @@ pub async fn poll_repo(app: &Arc<App>, user: &User, cfg: &RepoCfg) -> Result<()>
|
|||||||
allowed.push(g.login().await?);
|
allowed.push(g.login().await?);
|
||||||
}
|
}
|
||||||
let issues = g.issues(&cfg.label).await?;
|
let issues = g.issues(&cfg.label).await?;
|
||||||
|
let power_on = app.store.user_setting::<Power>(&user.id, "factory_power").unwrap_or_default().on;
|
||||||
for issue in issues {
|
for issue in issues {
|
||||||
let n = issue_no(&issue);
|
let n = issue_no(&issue);
|
||||||
let author = issue["user"]["login"].as_str().unwrap_or("");
|
let author = issue["user"]["login"].as_str().unwrap_or("");
|
||||||
@@ -1498,7 +1521,7 @@ pub async fn poll_repo(app: &Arc<App>, user: &User, cfg: &RepoCfg) -> Result<()>
|
|||||||
}
|
}
|
||||||
"approved" | "rework" => {
|
"approved" | "rework" => {
|
||||||
let feedback = if state == "rework" { row["note"].as_str().unwrap_or("").to_string() } else { String::new() };
|
let feedback = if state == "rework" { row["note"].as_str().unwrap_or("").to_string() } else { String::new() };
|
||||||
if app.store.factory_running(&cfg.url)? < cfg.max_parallel as i64 {
|
if power_on && app.store.factory_running(&cfg.url)? < cfg.max_parallel as i64 {
|
||||||
let comments = g.comments(n as u64).await.unwrap_or_default();
|
let comments = g.comments(n as u64).await.unwrap_or_default();
|
||||||
app.store.factory_issue_set(&cfg.url, n, &[("title", json!(title)), ("state", json!("building"))])?;
|
app.store.factory_issue_set(&cfg.url, n, &[("title", json!(title)), ("state", json!("building"))])?;
|
||||||
tokio::spawn(build(app.clone(), user.clone(), cfg.clone(), issue, comments, feedback));
|
tokio::spawn(build(app.clone(), user.clone(), cfg.clone(), issue, comments, feedback));
|
||||||
@@ -1506,7 +1529,7 @@ pub async fn poll_repo(app: &Arc<App>, user: &User, cfg: &RepoCfg) -> Result<()>
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
"qa" => {
|
"qa" => {
|
||||||
if app.store.factory_running(&cfg.url)? < cfg.max_parallel as i64 {
|
if power_on && app.store.factory_running(&cfg.url)? < cfg.max_parallel as i64 {
|
||||||
app.store.factory_issue_set(&cfg.url, n, &[("title", json!(title))])?;
|
app.store.factory_issue_set(&cfg.url, n, &[("title", json!(title))])?;
|
||||||
// Mark the run before it starts so the next poll does not take it up again.
|
// Mark the run before it starts so the next poll does not take it up again.
|
||||||
app.store.factory_issue_set(&cfg.url, n, &[("state", json!("testing"))])?;
|
app.store.factory_issue_set(&cfg.url, n, &[("state", json!("testing"))])?;
|
||||||
@@ -1516,7 +1539,7 @@ pub async fn poll_repo(app: &Arc<App>, user: &User, cfg: &RepoCfg) -> Result<()>
|
|||||||
}
|
}
|
||||||
_ => false,
|
_ => false,
|
||||||
};
|
};
|
||||||
if !start || app.store.factory_running(&cfg.url)? >= cfg.max_parallel as i64 {
|
if !start || !power_on || app.store.factory_running(&cfg.url)? >= cfg.max_parallel as i64 {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if comments.is_empty() {
|
if comments.is_empty() {
|
||||||
@@ -1907,6 +1930,15 @@ pub async fn create_project(app: &Arc<App>, user: &User, settings: &mut FactoryS
|
|||||||
mod tests {
|
mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn power_states() {
|
||||||
|
assert_eq!(power_state(true, 0), "running");
|
||||||
|
assert_eq!(power_state(true, 3), "running");
|
||||||
|
assert_eq!(power_state(false, 2), "stopping");
|
||||||
|
assert_eq!(power_state(false, 0), "stopped");
|
||||||
|
assert!(Power::default().on);
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn backlog_skips_tracked_and_queued_issues() {
|
fn backlog_skips_tracked_and_queued_issues() {
|
||||||
let cfg = repo("https://git.example.org/o/r.git");
|
let cfg = repo("https://git.example.org/o/r.git");
|
||||||
|
|||||||
+67
-1
@@ -125,6 +125,13 @@ impl Store {
|
|||||||
last_status TEXT,
|
last_status TEXT,
|
||||||
created_at INTEGER NOT NULL
|
created_at INTEGER NOT NULL
|
||||||
);
|
);
|
||||||
|
CREATE TABLE IF NOT EXISTS chat_drafts (
|
||||||
|
session_id TEXT NOT NULL,
|
||||||
|
user_id TEXT NOT NULL,
|
||||||
|
text TEXT NOT NULL,
|
||||||
|
updated_at INTEGER NOT NULL,
|
||||||
|
PRIMARY KEY (session_id, user_id)
|
||||||
|
);
|
||||||
CREATE TABLE IF NOT EXISTS user_settings (
|
CREATE TABLE IF NOT EXISTS user_settings (
|
||||||
user_id TEXT NOT NULL,
|
user_id TEXT NOT NULL,
|
||||||
key TEXT NOT NULL,
|
key TEXT NOT NULL,
|
||||||
@@ -1569,13 +1576,42 @@ impl Store {
|
|||||||
Ok(rows.filter_map(|r| r.ok()).collect())
|
Ok(rows.filter_map(|r| r.ok()).collect())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The unsent message of a chat, kept on the server so that it can be continued on another device.
|
||||||
|
pub fn chat_draft(&self, session: &str, user: &str) -> Result<Option<(String, i64)>> {
|
||||||
|
Ok(self.conn.lock().unwrap().query_row("SELECT text, updated_at FROM chat_drafts WHERE session_id = ?1 AND user_id = ?2", params![session, user], |r| Ok((r.get(0)?, r.get(1)?))).optional()?)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Store the unsent message (an empty text deletes it).
|
||||||
|
pub fn chat_draft_set(&self, session: &str, user: &str, text: &str) -> Result<i64> {
|
||||||
|
let conn = self.conn.lock().unwrap();
|
||||||
|
let now = crate::types::now_ms();
|
||||||
|
if text.trim().is_empty() {
|
||||||
|
conn.execute("DELETE FROM chat_drafts WHERE session_id = ?1 AND user_id = ?2", params![session, user])?;
|
||||||
|
} else {
|
||||||
|
conn.execute("INSERT INTO chat_drafts (session_id, user_id, text, updated_at) VALUES (?1,?2,?3,?4) ON CONFLICT(session_id, user_id) DO UPDATE SET text = ?3, updated_at = ?4", params![session, user, text, now])?;
|
||||||
|
}
|
||||||
|
Ok(now)
|
||||||
|
}
|
||||||
|
|
||||||
pub fn factory_issues(&self, owner: &str) -> Result<Vec<Value>> {
|
pub fn factory_issues(&self, owner: &str) -> Result<Vec<Value>> {
|
||||||
let nums: Vec<(String, i64)> = {
|
let nums: Vec<(String, i64)> = {
|
||||||
let conn = self.conn.lock().unwrap();
|
let conn = self.conn.lock().unwrap();
|
||||||
let mut st = conn.prepare("SELECT repo_url, number FROM factory_issues WHERE owner_id = ?1 ORDER BY updated_at DESC")?;
|
let mut st = conn.prepare("SELECT repo_url, number FROM factory_issues WHERE owner_id = ?1 ORDER BY updated_at DESC")?;
|
||||||
st.query_map([owner], |r| Ok((r.get(0)?, r.get(1)?)))?.filter_map(|r| r.ok()).collect()
|
st.query_map([owner], |r| Ok((r.get(0)?, r.get(1)?)))?.filter_map(|r| r.ok()).collect()
|
||||||
};
|
};
|
||||||
Ok(nums.into_iter().filter_map(|(r, n)| self.factory_issue(&r, n).ok().flatten()).collect())
|
let mut rows: Vec<Value> = nums.into_iter().filter_map(|(r, n)| self.factory_issue(&r, n).ok().flatten()).collect();
|
||||||
|
// The newest phase chat that still exists, for the "open chat" button of the card.
|
||||||
|
let conn = self.conn.lock().unwrap();
|
||||||
|
if let Ok(mut chat) = conn.prepare("SELECT r.session_id, r.phase FROM factory_runs r WHERE r.repo_url = ?1 AND r.issue = ?2 AND EXISTS (SELECT 1 FROM sessions s WHERE s.id = r.session_id) ORDER BY r.started_at DESC LIMIT 1") {
|
||||||
|
for row in rows.iter_mut() {
|
||||||
|
let (repo, n) = (row["repo"].as_str().unwrap_or("").to_string(), row["number"].as_i64().unwrap_or(0));
|
||||||
|
if let Ok((sid, phase)) = chat.query_row(params![repo, n], |x| Ok((x.get::<_, String>(0)?, x.get::<_, String>(1)?))) {
|
||||||
|
row["chat_session"] = json!(sid);
|
||||||
|
row["chat_phase"] = json!(phase);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok(rows)
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn factory_run_add(&self, id: &str, owner: &str, repo: &str, issue: i64, phase: &str, round: i64, session: &str, model: &str) -> Result<()> {
|
pub fn factory_run_add(&self, id: &str, owner: &str, repo: &str, issue: i64, phase: &str, round: i64, session: &str, model: &str) -> Result<()> {
|
||||||
@@ -1597,6 +1633,11 @@ impl Store {
|
|||||||
Ok(self.conn.lock().unwrap().query_row("SELECT COUNT(*) FROM factory_issues WHERE repo_url = ?1 AND state IN ('review', 'building', 'testing')", [repo], |r| r.get(0))?)
|
Ok(self.conn.lock().unwrap().query_row("SELECT COUNT(*) FROM factory_issues WHERE repo_url = ?1 AND state IN ('review', 'building', 'testing')", [repo], |r| r.get(0))?)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Phases of this user that are running right now (any repository).
|
||||||
|
pub fn factory_active(&self, owner: &str) -> Result<i64> {
|
||||||
|
Ok(self.conn.lock().unwrap().query_row("SELECT COUNT(*) FROM factory_issues WHERE owner_id = ?1 AND state IN ('review', 'building', 'testing')", [owner], |r| r.get(0))?)
|
||||||
|
}
|
||||||
|
|
||||||
/// Runs with token and cost totals (joined from the usage table).
|
/// Runs with token and cost totals (joined from the usage table).
|
||||||
pub fn factory_runs(&self, owner: &str, repo: Option<&str>, issue: Option<i64>, limit: i64) -> Result<Vec<Value>> {
|
pub fn factory_runs(&self, owner: &str, repo: Option<&str>, issue: Option<i64>, limit: i64) -> Result<Vec<Value>> {
|
||||||
let conn = self.conn.lock().unwrap();
|
let conn = self.conn.lock().unwrap();
|
||||||
@@ -2022,3 +2063,28 @@ mod link_tests {
|
|||||||
std::fs::remove_dir_all(&dir).unwrap();
|
std::fs::remove_dir_all(&dir).unwrap();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[cfg(test)]
|
||||||
|
mod draft_tests {
|
||||||
|
use super::*;
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn drafts_are_kept_per_chat_and_user_and_cleared_when_empty() {
|
||||||
|
let dir = std::env::temp_dir().join(format!("cc-drafts-{}", std::process::id()));
|
||||||
|
std::fs::create_dir_all(&dir).unwrap();
|
||||||
|
let store = Store::open(&dir.join("t.db")).unwrap();
|
||||||
|
assert!(store.chat_draft("s1", "u1").unwrap().is_none());
|
||||||
|
store.chat_draft_set("s1", "u1", "half a message").unwrap();
|
||||||
|
store.chat_draft_set("s1", "u2", "someone else").unwrap();
|
||||||
|
store.chat_draft_set("s2", "u1", "other chat").unwrap();
|
||||||
|
assert_eq!(store.chat_draft("s1", "u1").unwrap().unwrap().0, "half a message");
|
||||||
|
store.chat_draft_set("s1", "u1", "continued on another device").unwrap();
|
||||||
|
assert_eq!(store.chat_draft("s1", "u1").unwrap().unwrap().0, "continued on another device");
|
||||||
|
assert_eq!(store.chat_draft("s1", "u2").unwrap().unwrap().0, "someone else");
|
||||||
|
// Sending clears it.
|
||||||
|
store.chat_draft_set("s1", "u1", " \n").unwrap();
|
||||||
|
assert!(store.chat_draft("s1", "u1").unwrap().is_none());
|
||||||
|
assert_eq!(store.chat_draft("s2", "u1").unwrap().unwrap().0, "other chat");
|
||||||
|
let _ = std::fs::remove_dir_all(&dir);
|
||||||
|
}
|
||||||
|
}
|
||||||
+1
-1
@@ -128,7 +128,7 @@ export function App() {
|
|||||||
);
|
);
|
||||||
else if (section === "settings") content = <Settings tab={arg} onMenu={openMenu} />;
|
else if (section === "settings") content = <Settings tab={arg} onMenu={openMenu} />;
|
||||||
else if (section === "p" && arg) content = <ProjectPage key={arg} cwd={decodeURIComponent(arg)} onMenu={openMenu} />;
|
else if (section === "p" && arg) content = <ProjectPage key={arg} cwd={decodeURIComponent(arg)} onMenu={openMenu} />;
|
||||||
else if (section === "factory") content = <Factory onMenu={openMenu} />;
|
else if (section === "factory") content = <Factory onMenu={openMenu} overlayId={arg === "s" ? route[2] : undefined} />;
|
||||||
else if (section === "stats") content = <Stats onMenu={openMenu} />;
|
else if (section === "stats") content = <Stats onMenu={openMenu} />;
|
||||||
else if (section === "images") content = <Images onMenu={openMenu} />;
|
else if (section === "images") content = <Images onMenu={openMenu} />;
|
||||||
else if (section === "jobs" && arg) content = <JobEditor key={arg} id={arg} onMenu={openMenu} />;
|
else if (section === "jobs" && arg) content = <JobEditor key={arg} id={arg} onMenu={openMenu} />;
|
||||||
|
|||||||
@@ -543,6 +543,57 @@ function OlderLoader({ sessionId, afterSummary, scrollRef }: { sessionId: string
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Keep the unsent message of a chat on the server, so that it survives a reload and can be continued
|
||||||
|
* on another device: it is saved shortly after typing, loaded when the chat opens and again when the
|
||||||
|
* window comes back – as long as this device has no unsaved edits of its own.
|
||||||
|
*/
|
||||||
|
function useDraftSync(sessionId: string, text: string, setText: (s: string) => void, readOnly: boolean) {
|
||||||
|
const synced = useRef<string | null>(null);
|
||||||
|
const current = useRef(text);
|
||||||
|
current.current = text;
|
||||||
|
const pull = (initial: boolean) => {
|
||||||
|
if (readOnly) return;
|
||||||
|
get<{ text: string }>(`/sessions/${sessionId}/composer-draft`)
|
||||||
|
.then((d) => {
|
||||||
|
// Only take over when nothing was typed here since the last sync (on opening: when the field is empty).
|
||||||
|
const untouched = initial ? current.current === "" : current.current === (synced.current ?? "");
|
||||||
|
if (synced.current === null) synced.current = initial && current.current !== "" ? "" : d.text;
|
||||||
|
if (untouched && d.text !== current.current) {
|
||||||
|
synced.current = d.text;
|
||||||
|
setText(d.text);
|
||||||
|
} else if (initial && current.current === "") synced.current = d.text;
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
};
|
||||||
|
useEffect(() => {
|
||||||
|
synced.current = null;
|
||||||
|
pull(true);
|
||||||
|
const again = () => document.visibilityState === "visible" && pull(false);
|
||||||
|
document.addEventListener("visibilitychange", again);
|
||||||
|
window.addEventListener("focus", again);
|
||||||
|
const h = setInterval(again, 10000);
|
||||||
|
return () => {
|
||||||
|
document.removeEventListener("visibilitychange", again);
|
||||||
|
window.removeEventListener("focus", again);
|
||||||
|
clearInterval(h);
|
||||||
|
};
|
||||||
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||||
|
}, [sessionId, readOnly]);
|
||||||
|
useEffect(() => {
|
||||||
|
if (readOnly || synced.current === null || text === synced.current) return;
|
||||||
|
const h = setTimeout(() => {
|
||||||
|
const value = text;
|
||||||
|
put(`/sessions/${sessionId}/composer-draft`, { text: value })
|
||||||
|
.then(() => {
|
||||||
|
synced.current = value;
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
}, 700);
|
||||||
|
return () => clearTimeout(h);
|
||||||
|
}, [text, sessionId, readOnly]);
|
||||||
|
}
|
||||||
|
|
||||||
export function ChatView({ sessionId, onMenu, onClosePane }: { sessionId: string; onMenu: () => void; onClosePane?: () => void }) {
|
export function ChatView({ sessionId, onMenu, onClosePane }: { sessionId: string; onMenu: () => void; onClosePane?: () => void }) {
|
||||||
const t = useT();
|
const t = useT();
|
||||||
const session = useStore((s) => s.sessionById[sessionId]);
|
const session = useStore((s) => s.sessionById[sessionId]);
|
||||||
@@ -572,6 +623,7 @@ export function ChatView({ sessionId, onMenu, onClosePane }: { sessionId: string
|
|||||||
const models = useModels();
|
const models = useModels();
|
||||||
const [loadError, setLoadError] = useState<string>();
|
const [loadError, setLoadError] = useState<string>();
|
||||||
const [text, setText] = useState(() => takePrefill(sessionId) ?? "");
|
const [text, setText] = useState(() => takePrefill(sessionId) ?? "");
|
||||||
|
useDraftSync(sessionId, text, setText, readOnly);
|
||||||
const [stats, setStats] = useState<SessionStats>();
|
const [stats, setStats] = useState<SessionStats>();
|
||||||
const [showStats, setShowStats] = useState(false);
|
const [showStats, setShowStats] = useState(false);
|
||||||
const [editingTitle, setEditingTitle] = useState(false);
|
const [editingTitle, setEditingTitle] = useState(false);
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import { Icon } from "./Icon";
|
|||||||
import { Spinner } from "./Activity";
|
import { Spinner } from "./Activity";
|
||||||
import { ModelSelect } from "./ModelSelect";
|
import { ModelSelect } from "./ModelSelect";
|
||||||
import { RecreateDialog } from "./FactoryDraft";
|
import { RecreateDialog } from "./FactoryDraft";
|
||||||
|
import { ChatOverlay, openFactoryChat } from "./FactoryChat";
|
||||||
import { ReleaseDialog, ReleasesPanel, type ReleaseRow } from "./FactoryRelease";
|
import { ReleaseDialog, ReleasesPanel, type ReleaseRow } from "./FactoryRelease";
|
||||||
|
|
||||||
interface PrInfo {
|
interface PrInfo {
|
||||||
@@ -76,6 +77,9 @@ interface Issue {
|
|||||||
pr_url: string;
|
pr_url: string;
|
||||||
branch: string;
|
branch: string;
|
||||||
rounds: number;
|
rounds: number;
|
||||||
|
/** Newest phase chat that still exists. */
|
||||||
|
chat_session?: string;
|
||||||
|
chat_phase?: Phase;
|
||||||
created_at: number;
|
created_at: number;
|
||||||
updated_at: number;
|
updated_at: number;
|
||||||
}
|
}
|
||||||
@@ -114,8 +118,15 @@ interface RepoInfo {
|
|||||||
running: number;
|
running: number;
|
||||||
version?: string | null;
|
version?: string | null;
|
||||||
}
|
}
|
||||||
|
interface Power {
|
||||||
|
on: boolean;
|
||||||
|
/** Agents that are working right now. */
|
||||||
|
active: number;
|
||||||
|
state: "running" | "stopping" | "stopped";
|
||||||
|
}
|
||||||
interface Overview {
|
interface Overview {
|
||||||
area: boolean;
|
area: boolean;
|
||||||
|
power?: Power;
|
||||||
repos: RepoInfo[];
|
repos: RepoInfo[];
|
||||||
issues: Issue[];
|
issues: Issue[];
|
||||||
runs: Run[];
|
runs: Run[];
|
||||||
@@ -147,7 +158,7 @@ function fmtDuration(ms: number) {
|
|||||||
const runMs = (r: Run, now: number) => (r.ended_at ?? now) - r.started_at;
|
const runMs = (r: Run, now: number) => (r.ended_at ?? now) - r.started_at;
|
||||||
|
|
||||||
/** Software factory: spec issues in Gitea are reviewed, built and accepted by agents with a model per phase. */
|
/** Software factory: spec issues in Gitea are reviewed, built and accepted by agents with a model per phase. */
|
||||||
export function Factory({ onMenu }: { onMenu: () => void }) {
|
export function Factory({ onMenu, overlayId }: { onMenu: () => void; overlayId?: string }) {
|
||||||
const t = useT();
|
const t = useT();
|
||||||
const [tab, setTab] = useState<"overview" | "settings">("overview");
|
const [tab, setTab] = useState<"overview" | "settings">("overview");
|
||||||
return (
|
return (
|
||||||
@@ -168,14 +179,33 @@ export function Factory({ onMenu }: { onMenu: () => void }) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className="page">
|
<div className="page">
|
||||||
<div className="page-inner" style={{ maxWidth: 1280 }}>
|
<div className="page-inner" style={{ maxWidth: tab === "overview" ? "none" : 1280 }}>
|
||||||
{tab === "overview" ? <FactoryOverview onSettings={() => setTab("settings")} /> : <FactorySettings />}
|
{tab === "overview" ? <FactoryOverview onSettings={() => setTab("settings")} /> : <FactorySettings />}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{overlayId && <ChatOverlay id={overlayId} />}
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** The factory's main switch, coloured by state: green = running, yellow = stopping, red = stopped. */
|
||||||
|
function PowerSwitch({ power, onToggle }: { power: Power; onToggle: (on: boolean) => void }) {
|
||||||
|
const t = useT();
|
||||||
|
const label = power.state === "running" ? t("factory.power.running") : power.state === "stopping" ? t("factory.power.stopping", { n: power.active }) : t("factory.power.stopped");
|
||||||
|
const hint = power.on ? t("factory.power.stopHint") : t("factory.power.startHint");
|
||||||
|
return (
|
||||||
|
<button type="button" role="switch" aria-checked={power.on} className={`factory-power ${power.state}`} onClick={() => onToggle(!power.on)} title={hint}>
|
||||||
|
<span className="factory-power-track">
|
||||||
|
<span className="factory-power-knob" />
|
||||||
|
</span>
|
||||||
|
<span className="factory-power-text">
|
||||||
|
<b>{label}</b>
|
||||||
|
<span className="hint">{hint}</span>
|
||||||
|
</span>
|
||||||
|
</button>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
function FactoryOverview({ onSettings }: { onSettings: () => void }) {
|
function FactoryOverview({ onSettings }: { onSettings: () => void }) {
|
||||||
const t = useT();
|
const t = useT();
|
||||||
const [data, setData] = useState<Overview>();
|
const [data, setData] = useState<Overview>();
|
||||||
@@ -417,10 +447,21 @@ function FactoryOverview({ onSettings }: { onSettings: () => void }) {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
const phaseRunning = !!selected && ["review", "building", "testing"].includes(selected.state);
|
const phaseRunning = !!selected && ["review", "building", "testing"].includes(selected.state);
|
||||||
|
/** Master switch: a soft stop – no new agent starts, running ones finish their phase. */
|
||||||
|
const setPower = async (on: boolean) => {
|
||||||
|
try {
|
||||||
|
const power = await post<Power>("/factory/power", { on });
|
||||||
|
setData((d) => (d ? { ...d, power } : d));
|
||||||
|
void reload();
|
||||||
|
} catch (e: any) {
|
||||||
|
toast(e.message);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{!data.area && <div className="notice err">{t("factory.noArea")}</div>}
|
{!data.area && <div className="notice err">{t("factory.noArea")}</div>}
|
||||||
|
{data.power && <PowerSwitch power={data.power} onToggle={(on) => void setPower(on)} />}
|
||||||
<div className="kpis">
|
<div className="kpis">
|
||||||
<div className="kpi">
|
<div className="kpi">
|
||||||
<div className="k-label">{t("factory.kpi.running")}</div>
|
<div className="k-label">{t("factory.kpi.running")}</div>
|
||||||
@@ -536,14 +577,46 @@ function FactoryOverview({ onSettings }: { onSettings: () => void }) {
|
|||||||
const rs = runsOf(i);
|
const rs = runsOf(i);
|
||||||
const active = rs.find((r) => !r.ended_at);
|
const active = rs.find((r) => !r.ended_at);
|
||||||
const latest = active ?? rs[0];
|
const latest = active ?? rs[0];
|
||||||
|
// Claimed by a phase but no chat yet: checkout, and – for acceptance – installing and starting the app in its throw-away container.
|
||||||
|
const preparing = !active && ["review", "building", "testing"].includes(i.state);
|
||||||
const tokens = rs.reduce((a, r) => a + r.input_tokens + r.output_tokens, 0);
|
const tokens = rs.reduce((a, r) => a + r.input_tokens + r.output_tokens, 0);
|
||||||
return (
|
return (
|
||||||
<button key={`${i.repo}#${i.number}`} data-state={i.state} className={`factory-card ${sel === `${i.repo}#${i.number}` ? "active" : ""} ${active ? "running" : ""}`} onClick={() => setSel(sel === `${i.repo}#${i.number}` ? "" : `${i.repo}#${i.number}`)}>
|
<button key={`${i.repo}#${i.number}`} data-state={i.state} className={`factory-card ${sel === `${i.repo}#${i.number}` ? "active" : ""} ${active ? "running" : ""} ${preparing ? "preparing" : ""}`} onClick={() => setSel(sel === `${i.repo}#${i.number}` ? "" : `${i.repo}#${i.number}`)}>
|
||||||
<span className="hint">
|
<span className="factory-card-head">
|
||||||
{repoName(i.repo)} #{i.number}
|
<span className="hint">
|
||||||
|
{repoName(i.repo)} #{i.number}
|
||||||
|
</span>
|
||||||
|
{i.chat_session && (
|
||||||
|
<span
|
||||||
|
role="link"
|
||||||
|
tabIndex={0}
|
||||||
|
className="factory-open"
|
||||||
|
title={`${t("factory.openChat")}: ${t(`factory.phase.${i.chat_phase ?? "review"}` as any)}`}
|
||||||
|
aria-label={t("factory.openChat")}
|
||||||
|
onClick={(e) => {
|
||||||
|
e.stopPropagation();
|
||||||
|
openFactoryChat(i.chat_session!);
|
||||||
|
}}
|
||||||
|
onKeyDown={(e) => {
|
||||||
|
if (e.key === "Enter" || e.key === " ") {
|
||||||
|
e.preventDefault();
|
||||||
|
e.stopPropagation();
|
||||||
|
openFactoryChat(i.chat_session!);
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
<Icon name="eye" />
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
</span>
|
</span>
|
||||||
<b>{i.title || `#${i.number}`}</b>
|
<b>{i.title || `#${i.number}`}</b>
|
||||||
{latest && (
|
{preparing && (
|
||||||
|
<span className="hint" title={t("factory.preparing.hint")}>
|
||||||
|
<span className="factory-pulse prep" />
|
||||||
|
{i.state === "testing" ? t("factory.preparing.env") : t("factory.preparing.start")} · {fmtDuration(now - i.updated_at)}
|
||||||
|
</span>
|
||||||
|
)}
|
||||||
|
{latest && !preparing && (
|
||||||
<span className="hint">
|
<span className="hint">
|
||||||
{active && <span className="factory-pulse" />}
|
{active && <span className="factory-pulse" />}
|
||||||
{t(`factory.phase.${latest.phase}` as any)} · {(latest.model || "").split("/").pop()} · {fmtDuration(runMs(latest, now))}
|
{t(`factory.phase.${latest.phase}` as any)} · {(latest.model || "").split("/").pop()} · {fmtDuration(runMs(latest, now))}
|
||||||
@@ -677,7 +750,7 @@ function FactoryOverview({ onSettings }: { onSettings: () => void }) {
|
|||||||
</td>
|
</td>
|
||||||
<td>{fmtCost(r.cost, "USD")}</td>
|
<td>{fmtCost(r.cost, "USD")}</td>
|
||||||
<td>
|
<td>
|
||||||
<button className="small" onClick={() => navigate(`/s/${r.session_id}`)}>
|
<button className="small" onClick={() => openFactoryChat(r.session_id)}>
|
||||||
<Icon name="eye" /> {t("factory.openChat")}
|
<Icon name="eye" /> {t("factory.openChat")}
|
||||||
</button>
|
</button>
|
||||||
</td>
|
</td>
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
import { useEffect } from "react";
|
||||||
|
import { navigate } from "../router";
|
||||||
|
import { useT } from "../i18n";
|
||||||
|
import { ChatView } from "./ChatView";
|
||||||
|
import { Icon } from "./Icon";
|
||||||
|
|
||||||
|
/** Desktop only: chats of the factory open over the board and are closed with one click. */
|
||||||
|
export const isDesktop = () => window.matchMedia("(min-width: 801px)").matches;
|
||||||
|
|
||||||
|
/** Open the chat of a phase: in the overlay on the desktop, as a page on small screens. */
|
||||||
|
export function openFactoryChat(sessionId: string) {
|
||||||
|
navigate(isDesktop() ? `/factory/s/${sessionId}` : `/s/${sessionId}`);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ChatOverlay({ id }: { id: string }) {
|
||||||
|
const t = useT();
|
||||||
|
const close = () => navigate("/factory");
|
||||||
|
useEffect(() => {
|
||||||
|
const onKey = (e: KeyboardEvent) => {
|
||||||
|
// Esc closes – unless it is meant for a field, a dialog or the image viewer on top.
|
||||||
|
const el = document.activeElement;
|
||||||
|
const typing = el instanceof HTMLTextAreaElement || el instanceof HTMLInputElement || el instanceof HTMLSelectElement;
|
||||||
|
if (e.key === "Escape" && !typing && !document.querySelector(".modal-backdrop, .viewer-overlay")) close();
|
||||||
|
};
|
||||||
|
window.addEventListener("keydown", onKey);
|
||||||
|
return () => window.removeEventListener("keydown", onKey);
|
||||||
|
}, []);
|
||||||
|
return (
|
||||||
|
<div className="chat-overlay" onMouseDown={(e) => e.target === e.currentTarget && close()}>
|
||||||
|
<div className="chat-overlay-box" role="dialog" aria-modal="true">
|
||||||
|
<div className="chat-overlay-bar">
|
||||||
|
<span className="hint">{t("factory.chatOverlay")}</span>
|
||||||
|
<span className="spacer" />
|
||||||
|
<button className="small" onClick={() => navigate(`/s/${id}`)} title={t("factory.openFullHint")}>
|
||||||
|
<Icon name="external" /> {t("factory.openFull")}
|
||||||
|
</button>
|
||||||
|
<button className="small" onClick={close} aria-label={t("common.close")}>
|
||||||
|
<Icon name="close" /> {t("common.close")}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
<div className="chat-overlay-body">
|
||||||
|
<ChatView key={id} sessionId={id} onMenu={close} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
@@ -1235,6 +1235,17 @@ export const de: Messages = {
|
|||||||
"factory.backlog.empty": "Keine offenen Issues außerhalb der Factory",
|
"factory.backlog.empty": "Keine offenen Issues außerhalb der Factory",
|
||||||
"factory.backlog.error": "Der Forge konnte für einige Projekte nicht gelesen werden",
|
"factory.backlog.error": "Der Forge konnte für einige Projekte nicht gelesen werden",
|
||||||
"factory.col.backlog": "Backlog",
|
"factory.col.backlog": "Backlog",
|
||||||
|
"factory.chatOverlay": "Chat der Factory",
|
||||||
|
"factory.openFull": "Als Seite öffnen",
|
||||||
|
"factory.openFullHint": "Den Chat im ganzen Fenster öffnen",
|
||||||
|
"factory.power.running": "Factory läuft",
|
||||||
|
"factory.power.stopping": "Factory stoppt – {n} Agent(en) arbeiten noch",
|
||||||
|
"factory.power.stopped": "Factory gestoppt",
|
||||||
|
"factory.power.stopHint": "Klicken zum Stoppen: keine neuen Agenten, laufende werden fertig",
|
||||||
|
"factory.power.startHint": "Klicken, um die Factory zu starten",
|
||||||
|
"factory.preparing.env": "Testumgebung wird vorbereitet",
|
||||||
|
"factory.preparing.start": "Lauf wird vorbereitet",
|
||||||
|
"factory.preparing.hint": "Der Agent-Chat startet, sobald der Checkout fertig ist und – bei der Abnahme – die App in ihrem Wegwerf-Container installiert ist und läuft",
|
||||||
"factory.col.review": "Prüfung",
|
"factory.col.review": "Prüfung",
|
||||||
"factory.col.question": "Rückfragen",
|
"factory.col.question": "Rückfragen",
|
||||||
"factory.col.approved": "Freigegeben",
|
"factory.col.approved": "Freigegeben",
|
||||||
|
|||||||
@@ -1234,6 +1234,17 @@ export const en = {
|
|||||||
"factory.backlog.empty": "No open issues outside the factory",
|
"factory.backlog.empty": "No open issues outside the factory",
|
||||||
"factory.backlog.error": "The forge could not be read for some projects",
|
"factory.backlog.error": "The forge could not be read for some projects",
|
||||||
"factory.col.backlog": "Backlog",
|
"factory.col.backlog": "Backlog",
|
||||||
|
"factory.chatOverlay": "Chat of the factory",
|
||||||
|
"factory.openFull": "Open as page",
|
||||||
|
"factory.openFullHint": "Open the chat in the full window",
|
||||||
|
"factory.power.running": "Factory running",
|
||||||
|
"factory.power.stopping": "Factory stopping – {n} agent(s) still working",
|
||||||
|
"factory.power.stopped": "Factory stopped",
|
||||||
|
"factory.power.stopHint": "Click to stop: no new agents start, running ones finish",
|
||||||
|
"factory.power.startHint": "Click to start the factory",
|
||||||
|
"factory.preparing.env": "Preparing the test environment",
|
||||||
|
"factory.preparing.start": "Preparing the run",
|
||||||
|
"factory.preparing.hint": "The agent chat starts when the checkout is done and – for acceptance – the app is installed and running in its throw-away container",
|
||||||
"factory.col.review": "Review",
|
"factory.col.review": "Review",
|
||||||
"factory.col.question": "Questions",
|
"factory.col.question": "Questions",
|
||||||
"factory.col.approved": "Approved",
|
"factory.col.approved": "Approved",
|
||||||
|
|||||||
@@ -5168,6 +5168,142 @@ td.fold-indent {
|
|||||||
grid-column: span 2;
|
grid-column: span 2;
|
||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
/* Main switch of the factory. The colours come from the theme (--power-on / -warn / -off). */
|
||||||
|
.factory-power {
|
||||||
|
--tone: var(--power-off, var(--red));
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 14px;
|
||||||
|
width: 100%;
|
||||||
|
margin: 0 0 12px;
|
||||||
|
padding: 10px 16px;
|
||||||
|
text-align: left;
|
||||||
|
color: var(--fg0);
|
||||||
|
background: color-mix(in srgb, var(--tone) 18%, var(--bg1));
|
||||||
|
border: 2px solid var(--tone);
|
||||||
|
border-radius: 12px;
|
||||||
|
cursor: pointer;
|
||||||
|
transition: background 0.25s, border-color 0.25s;
|
||||||
|
}
|
||||||
|
.factory-power.running {
|
||||||
|
--tone: var(--power-on, var(--green));
|
||||||
|
}
|
||||||
|
.factory-power.stopping {
|
||||||
|
--tone: var(--power-warn, var(--accent));
|
||||||
|
}
|
||||||
|
.factory-power.stopped {
|
||||||
|
--tone: var(--power-off, var(--red));
|
||||||
|
}
|
||||||
|
.factory-power:hover {
|
||||||
|
background: color-mix(in srgb, var(--tone) 26%, var(--bg1));
|
||||||
|
}
|
||||||
|
.factory-power-track {
|
||||||
|
position: relative;
|
||||||
|
flex: none;
|
||||||
|
width: 52px;
|
||||||
|
height: 28px;
|
||||||
|
border-radius: 14px;
|
||||||
|
background: var(--tone);
|
||||||
|
transition: background 0.25s;
|
||||||
|
}
|
||||||
|
.factory-power-knob {
|
||||||
|
position: absolute;
|
||||||
|
top: 3px;
|
||||||
|
left: 3px;
|
||||||
|
width: 22px;
|
||||||
|
height: 22px;
|
||||||
|
border-radius: 50%;
|
||||||
|
background: var(--bg0);
|
||||||
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
|
||||||
|
transition: transform 0.2s;
|
||||||
|
}
|
||||||
|
/* on = knob right; stopping is still "off" but pulses until the last agent is done */
|
||||||
|
.factory-power.running .factory-power-knob {
|
||||||
|
transform: translateX(24px);
|
||||||
|
}
|
||||||
|
.factory-power.stopping .factory-power-track {
|
||||||
|
animation: factory-pulse 1.4s ease-in-out infinite;
|
||||||
|
}
|
||||||
|
.factory-power-text {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 1px;
|
||||||
|
}
|
||||||
|
.factory-power-text b {
|
||||||
|
font-size: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Chats of the factory open over the board. */
|
||||||
|
.chat-overlay {
|
||||||
|
position: fixed;
|
||||||
|
inset: 0;
|
||||||
|
z-index: 25;
|
||||||
|
background: rgba(0, 0, 0, 0.5);
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
padding: 3vh 3vw;
|
||||||
|
}
|
||||||
|
.chat-overlay-box {
|
||||||
|
width: min(1200px, 100%);
|
||||||
|
height: 100%;
|
||||||
|
background: var(--bg0);
|
||||||
|
border: 1px solid var(--bg2);
|
||||||
|
border-radius: 12px;
|
||||||
|
box-shadow: var(--shadow, 0 12px 40px rgba(0, 0, 0, 0.45));
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
overflow: hidden;
|
||||||
|
}
|
||||||
|
.chat-overlay-bar {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
gap: 8px;
|
||||||
|
padding: 8px 12px;
|
||||||
|
background: var(--bg1);
|
||||||
|
border-bottom: 1px solid var(--bg2);
|
||||||
|
}
|
||||||
|
.chat-overlay-body {
|
||||||
|
flex: 1;
|
||||||
|
min-height: 0;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
@media (max-width: 800px) {
|
||||||
|
.chat-overlay {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
.chat-overlay-box {
|
||||||
|
border-radius: 0;
|
||||||
|
border: 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
.factory-card-head {
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-between;
|
||||||
|
gap: 6px;
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
.factory-open {
|
||||||
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
width: 22px;
|
||||||
|
height: 22px;
|
||||||
|
border-radius: 6px;
|
||||||
|
color: var(--muted);
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
.factory-open:hover,
|
||||||
|
.factory-open:focus-visible {
|
||||||
|
color: var(--fg0);
|
||||||
|
background: var(--bg2);
|
||||||
|
}
|
||||||
|
.factory-open .icon {
|
||||||
|
width: 15px;
|
||||||
|
height: 15px;
|
||||||
|
}
|
||||||
.factory-card.active {
|
.factory-card.active {
|
||||||
border-color: var(--accent);
|
border-color: var(--accent);
|
||||||
}
|
}
|
||||||
@@ -5183,6 +5319,13 @@ td.fold-indent {
|
|||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
animation: factory-pulse 1.4s ease-in-out infinite;
|
animation: factory-pulse 1.4s ease-in-out infinite;
|
||||||
}
|
}
|
||||||
|
/* Preparing (checkout, test environment): same lamp, other colour than an active chat. */
|
||||||
|
.factory-pulse.prep {
|
||||||
|
background: var(--blue, var(--accent2));
|
||||||
|
}
|
||||||
|
.factory-card.preparing {
|
||||||
|
border-left: 3px solid var(--blue, var(--accent2));
|
||||||
|
}
|
||||||
@keyframes factory-pulse {
|
@keyframes factory-pulse {
|
||||||
50% {
|
50% {
|
||||||
opacity: 0.25;
|
opacity: 0.25;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #1c1b1f;
|
--on-accent: #1c1b1f;
|
||||||
--red: #c15c46;
|
--red: #c15c46;
|
||||||
--green: #8f9a5c;
|
--green: #8f9a5c;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #8f9a5c;
|
||||||
|
--power-warn: #d9b45a;
|
||||||
|
--power-off: #c15c46;
|
||||||
--aqua: #8aa89a;
|
--aqua: #8aa89a;
|
||||||
--blue: #7c9aa1;
|
--blue: #7c9aa1;
|
||||||
--purple: #b47e99;
|
--purple: #b47e99;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #ffffff;
|
--on-accent: #ffffff;
|
||||||
--red: #96392a;
|
--red: #96392a;
|
||||||
--green: #5c6631;
|
--green: #5c6631;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #5c6631;
|
||||||
|
--power-warn: #9a7413;
|
||||||
|
--power-off: #96392a;
|
||||||
--aqua: #3d6b72;
|
--aqua: #3d6b72;
|
||||||
--blue: #3d6b72;
|
--blue: #3d6b72;
|
||||||
--purple: #7c4a66;
|
--purple: #7c4a66;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #1e1e2e;
|
--on-accent: #1e1e2e;
|
||||||
--red: #f38ba8;
|
--red: #f38ba8;
|
||||||
--green: #a6e3a1;
|
--green: #a6e3a1;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #a6e3a1;
|
||||||
|
--power-warn: #f9e2af;
|
||||||
|
--power-off: #f38ba8;
|
||||||
--aqua: #94e2d5;
|
--aqua: #94e2d5;
|
||||||
--blue: #89b4fa;
|
--blue: #89b4fa;
|
||||||
--purple: #f5c2e7;
|
--purple: #f5c2e7;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #ffffff;
|
--on-accent: #ffffff;
|
||||||
--red: #d20f39;
|
--red: #d20f39;
|
||||||
--green: #40a02b;
|
--green: #40a02b;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #40a02b;
|
||||||
|
--power-warn: #df8e1d;
|
||||||
|
--power-off: #d20f39;
|
||||||
--aqua: #179299;
|
--aqua: #179299;
|
||||||
--blue: #1e66f5;
|
--blue: #1e66f5;
|
||||||
--purple: #ea76cb;
|
--purple: #ea76cb;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #1d150f;
|
--on-accent: #1d150f;
|
||||||
--red: #d78a6f;
|
--red: #d78a6f;
|
||||||
--green: #b5b27a;
|
--green: #b5b27a;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #a9b86a;
|
||||||
|
--power-warn: #e8c36a;
|
||||||
|
--power-off: #d4694f;
|
||||||
--aqua: #9fb8a8;
|
--aqua: #9fb8a8;
|
||||||
--blue: #a3b4c7;
|
--blue: #a3b4c7;
|
||||||
--purple: #cf90a2;
|
--purple: #cf90a2;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #ffffff;
|
--on-accent: #ffffff;
|
||||||
--red: #a4405e;
|
--red: #a4405e;
|
||||||
--green: #4f6b00;
|
--green: #4f6b00;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #4f6b00;
|
||||||
|
--power-warn: #a8780a;
|
||||||
|
--power-off: #a93a2e;
|
||||||
--aqua: #3f6b5e;
|
--aqua: #3f6b5e;
|
||||||
--blue: #8e2d53;
|
--blue: #8e2d53;
|
||||||
--purple: #7a003b;
|
--purple: #7a003b;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #282a36;
|
--on-accent: #282a36;
|
||||||
--red: #ff5555;
|
--red: #ff5555;
|
||||||
--green: #50fa7b;
|
--green: #50fa7b;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #50fa7b;
|
||||||
|
--power-warn: #f1fa8c;
|
||||||
|
--power-off: #ff5555;
|
||||||
--aqua: #8be9fd;
|
--aqua: #8be9fd;
|
||||||
--blue: #8be9fd;
|
--blue: #8be9fd;
|
||||||
--purple: #ff79c6;
|
--purple: #ff79c6;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #ffffff;
|
--on-accent: #ffffff;
|
||||||
--red: #cb3a2a;
|
--red: #cb3a2a;
|
||||||
--green: #14710a;
|
--green: #14710a;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #14710a;
|
||||||
|
--power-warn: #846e15;
|
||||||
|
--power-off: #cb3a2a;
|
||||||
--aqua: #036a96;
|
--aqua: #036a96;
|
||||||
--blue: #036a96;
|
--blue: #036a96;
|
||||||
--purple: #a3144d;
|
--purple: #a3144d;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #2d353b;
|
--on-accent: #2d353b;
|
||||||
--red: #e67e80;
|
--red: #e67e80;
|
||||||
--green: #a7c080;
|
--green: #a7c080;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #a7c080;
|
||||||
|
--power-warn: #dbbc7f;
|
||||||
|
--power-off: #e67e80;
|
||||||
--aqua: #83c092;
|
--aqua: #83c092;
|
||||||
--blue: #7fbbb3;
|
--blue: #7fbbb3;
|
||||||
--purple: #d699b6;
|
--purple: #d699b6;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #2d353b;
|
--on-accent: #2d353b;
|
||||||
--red: #f85552;
|
--red: #f85552;
|
||||||
--green: #8da101;
|
--green: #8da101;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #8da101;
|
||||||
|
--power-warn: #dfa000;
|
||||||
|
--power-off: #f85552;
|
||||||
--aqua: #35a77c;
|
--aqua: #35a77c;
|
||||||
--blue: #3a94c5;
|
--blue: #3a94c5;
|
||||||
--purple: #df69ba;
|
--purple: #df69ba;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #0d1117;
|
--on-accent: #0d1117;
|
||||||
--red: #f85149;
|
--red: #f85149;
|
||||||
--green: #3fb950;
|
--green: #3fb950;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #3fb950;
|
||||||
|
--power-warn: #d29922;
|
||||||
|
--power-off: #f85149;
|
||||||
--aqua: #39c5cf;
|
--aqua: #39c5cf;
|
||||||
--blue: #58a6ff;
|
--blue: #58a6ff;
|
||||||
--purple: #bc8cff;
|
--purple: #bc8cff;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #ffffff;
|
--on-accent: #ffffff;
|
||||||
--red: #d1242f;
|
--red: #d1242f;
|
||||||
--green: #1a7f37;
|
--green: #1a7f37;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #1a7f37;
|
||||||
|
--power-warn: #9a6700;
|
||||||
|
--power-off: #d1242f;
|
||||||
--aqua: #1b7c83;
|
--aqua: #1b7c83;
|
||||||
--blue: #0969da;
|
--blue: #0969da;
|
||||||
--purple: #8250df;
|
--purple: #8250df;
|
||||||
|
|||||||
@@ -22,6 +22,10 @@
|
|||||||
--on-accent: #282828;
|
--on-accent: #282828;
|
||||||
--red: #fb4934;
|
--red: #fb4934;
|
||||||
--green: #b8bb26;
|
--green: #b8bb26;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #b8bb26;
|
||||||
|
--power-warn: #fabd2f;
|
||||||
|
--power-off: #fb4934;
|
||||||
--aqua: #8ec07c;
|
--aqua: #8ec07c;
|
||||||
--blue: #83a598;
|
--blue: #83a598;
|
||||||
--purple: #d3869b;
|
--purple: #d3869b;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #282828;
|
--on-accent: #282828;
|
||||||
--red: #9d0006;
|
--red: #9d0006;
|
||||||
--green: #79740e;
|
--green: #79740e;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #79740e;
|
||||||
|
--power-warn: #b57614;
|
||||||
|
--power-off: #9d0006;
|
||||||
--aqua: #427b58;
|
--aqua: #427b58;
|
||||||
--blue: #076678;
|
--blue: #076678;
|
||||||
--purple: #8f3f71;
|
--purple: #8f3f71;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #1b1b1b;
|
--on-accent: #1b1b1b;
|
||||||
--red: #f44336;
|
--red: #f44336;
|
||||||
--green: #a99b7a;
|
--green: #a99b7a;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #8fae72;
|
||||||
|
--power-warn: #e0b350;
|
||||||
|
--power-off: #f44336;
|
||||||
--aqua: #8a9ba6;
|
--aqua: #8a9ba6;
|
||||||
--blue: #77838a;
|
--blue: #77838a;
|
||||||
--purple: #e58980;
|
--purple: #e58980;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #ffffff;
|
--on-accent: #ffffff;
|
||||||
--red: #b14752;
|
--red: #b14752;
|
||||||
--green: #556753;
|
--green: #556753;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #5a7a43;
|
||||||
|
--power-warn: #a87b1a;
|
||||||
|
--power-off: #b14752;
|
||||||
--aqua: #3d727d;
|
--aqua: #3d727d;
|
||||||
--blue: #4c6c94;
|
--blue: #4c6c94;
|
||||||
--purple: #8a5b81;
|
--purple: #8a5b81;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #1f1f28;
|
--on-accent: #1f1f28;
|
||||||
--red: #e46876;
|
--red: #e46876;
|
||||||
--green: #98bb6c;
|
--green: #98bb6c;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #98bb6c;
|
||||||
|
--power-warn: #e6c384;
|
||||||
|
--power-off: #e46876;
|
||||||
--aqua: #7aa89f;
|
--aqua: #7aa89f;
|
||||||
--blue: #7fb4ca;
|
--blue: #7fb4ca;
|
||||||
--purple: #957fb8;
|
--purple: #957fb8;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #ffffff;
|
--on-accent: #ffffff;
|
||||||
--red: #c84053;
|
--red: #c84053;
|
||||||
--green: #6f894e;
|
--green: #6f894e;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #6f894e;
|
||||||
|
--power-warn: #b07a00;
|
||||||
|
--power-off: #c84053;
|
||||||
--aqua: #597b75;
|
--aqua: #597b75;
|
||||||
--blue: #4d699b;
|
--blue: #4d699b;
|
||||||
--purple: #624c83;
|
--purple: #624c83;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #2e3440;
|
--on-accent: #2e3440;
|
||||||
--red: #bf616a;
|
--red: #bf616a;
|
||||||
--green: #a3be8c;
|
--green: #a3be8c;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #a3be8c;
|
||||||
|
--power-warn: #ebcb8b;
|
||||||
|
--power-off: #bf616a;
|
||||||
--aqua: #8fbcbb;
|
--aqua: #8fbcbb;
|
||||||
--blue: #81a1c1;
|
--blue: #81a1c1;
|
||||||
--purple: #b48ead;
|
--purple: #b48ead;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #ffffff;
|
--on-accent: #ffffff;
|
||||||
--red: #a9434d;
|
--red: #a9434d;
|
||||||
--green: #5f7d48;
|
--green: #5f7d48;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #5f7d48;
|
||||||
|
--power-warn: #9a7b2f;
|
||||||
|
--power-off: #a9434d;
|
||||||
--aqua: #4d8a89;
|
--aqua: #4d8a89;
|
||||||
--blue: #5e81ac;
|
--blue: #5e81ac;
|
||||||
--purple: #8f6a8a;
|
--purple: #8f6a8a;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #282c34;
|
--on-accent: #282c34;
|
||||||
--red: #e06c75;
|
--red: #e06c75;
|
||||||
--green: #98c379;
|
--green: #98c379;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #98c379;
|
||||||
|
--power-warn: #e5c07b;
|
||||||
|
--power-off: #e06c75;
|
||||||
--aqua: #56b6c2;
|
--aqua: #56b6c2;
|
||||||
--blue: #61afef;
|
--blue: #61afef;
|
||||||
--purple: #c678dd;
|
--purple: #c678dd;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #ffffff;
|
--on-accent: #ffffff;
|
||||||
--red: #e45649;
|
--red: #e45649;
|
||||||
--green: #50a14f;
|
--green: #50a14f;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #50a14f;
|
||||||
|
--power-warn: #c18401;
|
||||||
|
--power-off: #e45649;
|
||||||
--aqua: #0184bc;
|
--aqua: #0184bc;
|
||||||
--blue: #4078f2;
|
--blue: #4078f2;
|
||||||
--purple: #a626a4;
|
--purple: #a626a4;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #191724;
|
--on-accent: #191724;
|
||||||
--red: #eb6f92;
|
--red: #eb6f92;
|
||||||
--green: #9ccfd8;
|
--green: #9ccfd8;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #95b88f;
|
||||||
|
--power-warn: #f6c177;
|
||||||
|
--power-off: #eb6f92;
|
||||||
--aqua: #9ccfd8;
|
--aqua: #9ccfd8;
|
||||||
--blue: #31748f;
|
--blue: #31748f;
|
||||||
--purple: #c4a7e7;
|
--purple: #c4a7e7;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #ffffff;
|
--on-accent: #ffffff;
|
||||||
--red: #b4637a;
|
--red: #b4637a;
|
||||||
--green: #56949f;
|
--green: #56949f;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #5e8f60;
|
||||||
|
--power-warn: #c98a1b;
|
||||||
|
--power-off: #b4637a;
|
||||||
--aqua: #56949f;
|
--aqua: #56949f;
|
||||||
--blue: #286983;
|
--blue: #286983;
|
||||||
--purple: #907aa9;
|
--purple: #907aa9;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #002b36;
|
--on-accent: #002b36;
|
||||||
--red: #dc322f;
|
--red: #dc322f;
|
||||||
--green: #859900;
|
--green: #859900;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #859900;
|
||||||
|
--power-warn: #b58900;
|
||||||
|
--power-off: #dc322f;
|
||||||
--aqua: #2aa198;
|
--aqua: #2aa198;
|
||||||
--blue: #268bd2;
|
--blue: #268bd2;
|
||||||
--purple: #6c71c4;
|
--purple: #6c71c4;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #002b36;
|
--on-accent: #002b36;
|
||||||
--red: #dc322f;
|
--red: #dc322f;
|
||||||
--green: #859900;
|
--green: #859900;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #859900;
|
||||||
|
--power-warn: #b58900;
|
||||||
|
--power-off: #dc322f;
|
||||||
--aqua: #2aa198;
|
--aqua: #2aa198;
|
||||||
--blue: #268bd2;
|
--blue: #268bd2;
|
||||||
--purple: #6c71c4;
|
--purple: #6c71c4;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #232a44;
|
--on-accent: #232a44;
|
||||||
--red: #d47a6a;
|
--red: #d47a6a;
|
||||||
--green: #96b4bc;
|
--green: #96b4bc;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #8fb98a;
|
||||||
|
--power-warn: #e0b860;
|
||||||
|
--power-off: #d47a6a;
|
||||||
--aqua: #96b4bc;
|
--aqua: #96b4bc;
|
||||||
--blue: #7aa0cc;
|
--blue: #7aa0cc;
|
||||||
--purple: #c896b2;
|
--purple: #c896b2;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #f0ead9;
|
--on-accent: #f0ead9;
|
||||||
--red: #8a3028;
|
--red: #8a3028;
|
||||||
--green: #4a5a3a;
|
--green: #4a5a3a;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #4a6b3a;
|
||||||
|
--power-warn: #9a7218;
|
||||||
|
--power-off: #8a3028;
|
||||||
--aqua: #3a5a6a;
|
--aqua: #3a5a6a;
|
||||||
--blue: #3a5a8a;
|
--blue: #3a5a8a;
|
||||||
--purple: #5a4a72;
|
--purple: #5a4a72;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #24283b;
|
--on-accent: #24283b;
|
||||||
--red: #f7768e;
|
--red: #f7768e;
|
||||||
--green: #9ece6a;
|
--green: #9ece6a;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #9ece6a;
|
||||||
|
--power-warn: #e0af68;
|
||||||
|
--power-off: #f7768e;
|
||||||
--aqua: #73daca;
|
--aqua: #73daca;
|
||||||
--blue: #7aa2f7;
|
--blue: #7aa2f7;
|
||||||
--purple: #bb9af7;
|
--purple: #bb9af7;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #ffffff;
|
--on-accent: #ffffff;
|
||||||
--red: #f52a65;
|
--red: #f52a65;
|
||||||
--green: #587539;
|
--green: #587539;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #587539;
|
||||||
|
--power-warn: #8c6c3e;
|
||||||
|
--power-off: #f52a65;
|
||||||
--aqua: #118c74;
|
--aqua: #118c74;
|
||||||
--blue: #2e7de9;
|
--blue: #2e7de9;
|
||||||
--purple: #9854f1;
|
--purple: #9854f1;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #ffffff;
|
--on-accent: #ffffff;
|
||||||
--red: #f14c4c;
|
--red: #f14c4c;
|
||||||
--green: #89d185;
|
--green: #89d185;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #89d185;
|
||||||
|
--power-warn: #cca700;
|
||||||
|
--power-off: #f14c4c;
|
||||||
--aqua: #4ec9b0;
|
--aqua: #4ec9b0;
|
||||||
--blue: #3794ff;
|
--blue: #3794ff;
|
||||||
--purple: #c586c0;
|
--purple: #c586c0;
|
||||||
|
|||||||
@@ -21,6 +21,10 @@
|
|||||||
--on-accent: #ffffff;
|
--on-accent: #ffffff;
|
||||||
--red: #cd3131;
|
--red: #cd3131;
|
||||||
--green: #388a34;
|
--green: #388a34;
|
||||||
|
/* Factory master switch: running / stopping / stopped */
|
||||||
|
--power-on: #388a34;
|
||||||
|
--power-warn: #bf8803;
|
||||||
|
--power-off: #cd3131;
|
||||||
--aqua: #267f99;
|
--aqua: #267f99;
|
||||||
--blue: #005fb8;
|
--blue: #005fb8;
|
||||||
--purple: #af00db;
|
--purple: #af00db;
|
||||||
|
|||||||
@@ -3,6 +3,14 @@
|
|||||||
* under "unreleased"; scripts/release.sh renames the key to the release version.
|
* under "unreleased"; scripts/release.sh renames the key to the release version.
|
||||||
*/
|
*/
|
||||||
export const WHATS_NEW: Record<string, { en: string[]; de: string[] }> = {
|
export const WHATS_NEW: Record<string, { en: string[]; de: string[] }> = {
|
||||||
|
"202611-00072": {
|
||||||
|
en: ["Factory: a blinking blue lamp shows that a phase is being prepared (checkout, test environment) before its chat starts"],
|
||||||
|
de: ["Factory: eine blinkende blaue Lampe zeigt, dass eine Phase vorbereitet wird (Checkout, Testumgebung), bevor der Chat startet"],
|
||||||
|
},
|
||||||
|
"202611-00071": {
|
||||||
|
en: ["Unsent messages are saved per chat and can be continued on another device (web and terminal client)", "Factory: main switch (green running, yellow stopping, red stopped) with a soft stop – running agents finish", "Factory: chats open in an overlay on the desktop; every issue card has an open-chat button; the overview uses the full width"],
|
||||||
|
de: ["Ungesendete Nachrichten werden pro Chat gespeichert und lassen sich auf einem anderen Gerät fortsetzen (Web und Terminal-Client)", "Factory: Hauptschalter (grün läuft, gelb stoppt, rot gestoppt) mit sanftem Stopp – laufende Agenten werden fertig", "Factory: Chats öffnen auf dem Desktop in einem Overlay; jede Issue-Karte hat einen Chat-Knopf; die Übersicht nutzt die volle Breite"],
|
||||||
|
},
|
||||||
"202611-00070": {
|
"202611-00070": {
|
||||||
en: ["Factory backlog: wider column, titles on one line"],
|
en: ["Factory backlog: wider column, titles on one line"],
|
||||||
de: ["Factory-Backlog: breitere Spalte, Titel einzeilig"],
|
de: ["Factory-Backlog: breitere Spalte, Titel einzeilig"],
|
||||||
|
|||||||
Reference in new issue
Block a user