Порівняти коміти

...
Автор SHA1 Повідомлення Дата
l0ng-ai f041f7e763 fix(agent): offer the effort levels a session reports for ACP models discovery didn't read
ACP discovery opens one session and knows only that session's model's
effort levels. Once discovery succeeded, session reports no longer reached
the New Task catalog, so other models of the agent showed no effort choice.
A session on another listed model now records that model's levels in the
project's catalog (never the discovered model's), and a later discovery
keeps them while the model is still listed.
2026-11-16 01:23:31 +08:00
Mr0Bread c67b336a8a feat(agent): answer ACP form elicitation (#3580)
The ACP client advertises elicitation.form and answers elicitation/create: the request's restricted JSON Schema becomes form fields (text, number, integer, boolean, single and multiple choice, with titles, descriptions, defaults, required and bounds), shown in the question card above the composer. Submit replies accept with typed values, Decline replies decline, Cancel or Escape replies cancel; the conversation records the answers. Nested objects and URL mode are refused with INVALID_PARAMS. Bypassing approvals never answers a form.

Part of #3536

Co-authored-by: Mr0Bread <[email protected]>
2026-11-16 01:11:16 +08:00
Akbar Husain 90cc707d00 feat(zig): Settings page and detection for the Zig toolchain (#3578)
Adds Settings › Languages & Frameworks › Zig for languages.zig.zig (used by the Zig External Libraries), on the shared SDK row: Auto = zig on PATH, Detect again, Browse. ide-sdk gains SdkKind::Zig, detecting PATH installs (shims skipped), Homebrew, zvm and mise / asdf installs; the stored path is the directory holding zig, with the version from zig version.

Co-authored-by: akbar1214 <[email protected]>
2026-11-16 01:05:20 +08:00
Mr0Bread 779080781b fix(agent): keep each ACP model's own effort levels (#3577)
ACP discovery opens one session and reads its thought_level option, which describes that session's model only, but recorded it under every model value. Agents whose models offer different effort lists (e.g. OMP's Copilot gpt-4o: off/auto) showed levels the agent rejects. Discovery now records the levels for the session's model only.

Part of #3536

Co-authored-by: Mr0Bread <[email protected]>
2026-11-16 01:00:29 +08:00
Bbu Gulli Annтаctro15547 ccf87e2476 fix(macos): support macOS 12 again (#3576)
Lowers the minimum macOS version to 12.0 and the WebKit floor to Safari 15.4: Vite targets safari15.4, check-webkit enforces the 15.4 floor and rejects Array toSorted/toReversed/toSpliced, showPicker and Intl.supportedValuesOf in startup chunks, the boot outdated check tests structuredClone, the Database view drops toReversed, and the install docs list macOS 12. Container-query layouts degrade on macOS 12.

Fixes #3413

Co-authored-by: ctro15547 <[email protected]>
2026-11-16 00:58:42 +08:00
l0ng-ai 76f0b3fc63 feat(project-view): Open in Right Split (⇧Enter) (#3579)
The Project view opened a file in the current pane whatever the modifier and had no way to open one in a split. Open in Right Split opens the selected files in the pane to the right: ⇧Enter in the IntelliJ keymaps, ⌘Enter / Ctrl+Enter in the VS Code ones, and in the context menu before Open In (External Libraries too). On a folder ⇧Enter keeps expanding it.

Closes #3549
2026-11-16 00:55:52 +08:00
l0ng-ai a5c14a4c21 fix(notebook): Vim u and Ctrl-R undo and redo in notebook cells (#3575)
Notebook cells keep no CodeMirror history (edits share the notebook's backend history), so Vim's u / Ctrl-R did nothing there. An editor can provide externalHistory; notebook cells provide the session's, and the Vim engine sends undo / redo to it.
2026-11-16 00:11:43 +08:00
Akbar Husain cf444a31f7 perf(index): allocation-free hump scoring and byte-scan name boosts (#3573)
hump_bonus walks the candidate's chars once with a cursor into the sorted, deduplicated match indices instead of collecting a Vec<char> per ranked survivor, and name_boost finds the extension dot with a byte scan. Results are unchanged; find_symbols/OCo goes from 3.71 ms to 3.36 ms in the index bench.

Co-authored-by: akbar1214 <[email protected]>
2026-11-16 00:05:57 +08:00
Mr0Bread c3763fb806 feat(agent): steer agents that advertise _session/steering (#3568)
Messages typed while a task is running join the running turn for agents that advertise the _session/steering extension (_meta.steering.supported in the initialize response, as OMP does), not only those advertising _meta.openidea.steer. An outcome other than injected (promptRequired, failed) queues the message for the next turn.

Co-authored-by: Mr0Bread <[email protected]>
2026-11-16 00:01:30 +08:00
Mr0Bread 9a518e734b refactor(styles): put gap on the spacing scale (#3562)
Extends the 4px-grid spacing scale with --space-0-5 (2px), --space-1 (4px) and --space-1-5 (6px) and replaces the literal 2/4/6/8/12/16px gap, row-gap and column-gap values with the tokens; computed values are unchanged. src/styles/spacingScale.test.ts flags an on-scale literal gap.

Co-authored-by: Mr0Bread <[email protected]>
2026-11-15 23:59:47 +08:00
Mr0Bread 2913c12a19 chore(styles): remove CSS module classes no component reads (#3560)
35 CSS-module classes in 10 modules were defined but never read (no styles.x use, no composes, no dynamic access in their importers): leftovers of removed UI such as the settings code-preview block, the GitHub tool window's layout helpers and SDK tree rows.

Co-authored-by: Mr0Bread <[email protected]>
2026-11-15 23:58:00 +08:00
Mr0Bread 3044518b88 fix(styles): restore CSS classes components still reference (#3559)
Components read CSS-module classes no module defined, which are undefined at runtime. The archived-task banner in agent sessions (.banner, .bannerText, .bannerSpacer, dropped in #2083) and the Create Patch directory row (.cloneDirRow, .cloneDirInput, dropped in #866) are restored; references to classes that never existed are removed. src/styles/cssModules.test.ts lists any styles.x the imported module lacks.

Co-authored-by: Mr0Bread <[email protected]>
2026-11-15 23:56:20 +08:00
Vadim LazukтаInf1mum 778472854e fix(markdown): keep the Preview only scroll position when switching tabs back (#3569)
Tab switches unmount the preview, and its saved offset was applied once at remount, before images and diagrams had drawn. A restore that clamped to the short document is applied again on each settle until it fits or the reader scrolls; the clamped write no longer replaces the saved offset. The preview opts out of scroll anchoring, which in WebView2 kept a later block in view while images above it loaded.

Fixes #3537

Co-authored-by: Inf1mum <[email protected]>
2026-11-15 23:54:36 +08:00
l0ng-ai 1679d61a6a fix(services): list the SSH configurations in the Docker connection dialog (#3570)
SshConfigSelect reads the settings window's staged ssh.configs unless given a list, and that list is empty outside the settings window, so the Docker connection dialog offered only None. The dialog now passes the live list; the None choice gets its Chinese text.

Closes #3535
2026-11-15 23:51:21 +08:00
218 змінених файлів з 2500 додано та 1149 видалено

No files matched your search

+1
Переглянути файл
@@ -42,6 +42,7 @@ Visual style: dark, low-contrast greys, one cool accent
shortcuts live in `src/platform/keymaps/`.
- Styling: CSS Modules + tokens only (no hex literals in components). Inline SVG
icons from `src/ui/icons.tsx`, never emoji. Real `<button>`/`<input>`; `aria-label` on icon buttons.
`gap` uses the `--space-*` scale (`src/styles/tokens.css`, 4px grid) where a value is on it.
- User-visible text goes through the text catalog: add every new string to both
`src/platform/locales/text/en.json` and `zh.json` (`textCatalog.test.ts` enforces it).
Other locales may lack entries; their UI shows the English text until a translator adds it.
+8 -10
Переглянути файл
@@ -10,12 +10,14 @@ use crate::provider::ProviderSpec;
use crate::{Shared, client_info};
use parking_lot::Mutex;
use serde_json::{Value, json};
use std::collections::BTreeMap;
use std::sync::Arc;
use std::time::Duration;
const DISCOVER_TIMEOUT: Duration = if cfg!(test) { Duration::from_secs(3) } else { Duration::from_secs(120) };
/// Opens `session/new`, reads `configOptions`, and records per-model `thought_level` choices.
/// Opens `session/new`, reads `configOptions`, and records the `thought_level` choices of the
/// session's model: they describe that model only, and other models may offer different ones.
pub(crate) async fn run(shared: &Arc<Shared>, spec: &ProviderSpec) -> Result<Discovered, String> {
let prefer_stored = crate::provider::prefer_stored_copilot_auth();
match run_once(shared, spec, prefer_stored).await {
@@ -62,21 +64,17 @@ async fn run_once(shared: &Arc<Shared>, spec: &ProviderSpec, strip_ambient: bool
.map_err(|e| e.to_string())?;
let mut options = config::options_of(&new);
config::add_client_options(&launch.id, &mut options);
let model_option = options.iter().find(|o| o.category.as_deref() == Some("model"));
let effort = levels_for_model_from_slice(&options);
let levels: Vec<(String, Vec<AgentConfigOption>)> = match (model_option, effort) {
(Some(model), Some(effort)) if !model.values.is_empty() => {
model.values.iter().map(|v| (v.value.clone(), effort.clone())).collect()
}
(Some(model), Some(effort)) => model.current.clone().map(|m| vec![(m, effort)]).unwrap_or_default(),
_ => Vec::new(),
let model = options.iter().find(|o| o.category.as_deref() == Some("model")).and_then(|o| o.current.clone());
let levels = match (model, levels_for_model_from_slice(&options)) {
(Some(model), Some(effort)) => BTreeMap::from([(model, effort)]),
_ => BTreeMap::new(),
};
let commands = updates
.commands
.lock()
.clone()
.or_else(|| new.get("availableCommands").map(|_| config::commands_of(&new, &launch.id)));
Ok::<_, String>(Discovered { config: options, commands, levels: levels.into_iter().collect() })
Ok::<_, String>(Discovered { config: options, commands, levels })
};
let result = tokio::time::timeout(DISCOVER_TIMEOUT, work).await;
peer.kill();
+2
Переглянути файл
@@ -58,6 +58,8 @@ fn client_capabilities() -> Value {
"terminal": false,
// Subagents as sessions of their own (ACP subagents RFD; v2 baseline).
"subagents": {},
// Forms the agent asks the user to fill in (`elicitation/create`); not URL mode.
"elicitation": { "form": {} },
// Cursor exposes model parameters (e.g. Composer `fast`) as separate config options
// only when the client advertises this flag (undocumented Cursor ACP extension).
"_meta": { "parameterizedModelPicker": true },
+5 -1
Переглянути файл
@@ -97,10 +97,13 @@ fn the_negotiating_request_carries_both_versions() {
p["clientCapabilities"]["_meta"]["parameterizedModelPicker"], true,
"Cursor and similar agents need parameterized model options (e.g. fast on/off)"
);
// Forms only: URL mode would open pages the agent names.
assert_eq!(p["clientCapabilities"]["elicitation"], json!({ "form": {} }));
// What we sent in the capture is what claude-agent-acp negotiated v2 and v1 from.
let sent = frames(TURN, "out")[0]["params"]["clientCapabilities"].clone();
let mut expected = sent;
expected["_meta"] = p["clientCapabilities"]["_meta"].clone();
expected["elicitation"] = p["clientCapabilities"]["elicitation"].clone();
assert_eq!(expected, p["clientCapabilities"]);
}
@@ -168,7 +171,8 @@ async fn discovery_reads_effort_and_fast_from_session_new_then_stops_the_agent()
let fast = cursor.config.iter().find(|o| o.id == "fast").expect("fast option");
assert_eq!(fast.category.as_deref(), Some("model_config"));
assert_eq!(fast.current.as_deref(), Some("false"));
assert!(cursor.thought_levels.contains_key("m1") && cursor.thought_levels.contains_key("m2"));
// The effort option belongs to the session's model; m2 may offer other levels.
assert_eq!(cursor.thought_levels.keys().collect::<Vec<_>>(), ["m1"]);
assert!(cursor.thought_levels["m1"].iter().any(|o| o.category.as_deref() == Some("thought_level")));
}
+53 -1
Переглянути файл
@@ -56,6 +56,16 @@ pub(crate) struct CatalogData {
pub refreshed_at_ms: Option<f64>,
}
impl CatalogData {
fn model_option(&self) -> Option<&AgentConfigOption> {
self.config.iter().find(|o| o.category.as_deref() == Some("model"))
}
fn lists(&self, model: &str) -> bool {
self.model_option().is_some_and(|o| o.values.iter().any(|v| v.value == model))
}
}
#[derive(Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub(crate) struct SavedCatalog {
@@ -329,11 +339,17 @@ impl AgentCatalogs {
Ok(found) => {
let mut cache = shared.known.lock();
let known = cache.entry(key.2.clone()).or_default();
let catalog = CatalogData {
let mut catalog = CatalogData {
config: found.config,
thought_levels: found.levels,
refreshed_at_ms: Some(self.epoch_ms()),
};
// Efforts sessions reported for models discovery doesn't read stay while listed.
for (model, levels) in entry.catalog.take().map(|old| old.thought_levels).unwrap_or_default() {
if catalog.lists(&model) && !catalog.thought_levels.contains_key(&model) {
catalog.thought_levels.insert(model, levels);
}
}
known.config = catalog.config.clone();
known.thought_levels = catalog.thought_levels.clone();
if let Some(commands) = found.commands {
@@ -366,6 +382,42 @@ impl AgentCatalogs {
}
}
/// Records the efforts a session reported for a listed `model` other than the one discovery
/// read: ACP discovery opens one session, so it knows only that model's efforts.
pub(crate) fn learn_levels(&self, shared: &Shared, provider: &str, model: &str, levels: Vec<AgentConfigOption>) {
let lacks = |catalog: &CatalogData| {
catalog.lists(model)
&& catalog.model_option().and_then(|o| o.current.as_deref()) != Some(model)
&& catalog.thought_levels.get(model) != Some(&levels)
};
let key = Self::key(shared, provider);
let mut state = self.state.lock();
let mut learned = false;
if let Some(catalog) = state.entries.get_mut(&key).and_then(|e| e.catalog.as_mut()).filter(|c| lacks(c)) {
catalog.thought_levels.insert(model.to_owned(), levels.clone());
learned = true;
}
let mut cache = shared.known.lock();
if let Some(saved) = cache
.get_mut(provider)
.and_then(|known| known.catalogs.get_mut(&shared.root_key()))
.filter(|saved| lacks(&saved.catalog))
{
saved.catalog.thought_levels.insert(model.to_owned(), levels);
learned = true;
}
if !learned {
return;
}
shared.persist_known(&cache);
drop(cache);
let snapshot = state.entries.get(&key).map(|entry| self.snapshot(shared, provider, entry));
drop(state);
if let Some(snapshot) = snapshot {
self.broadcast(shared, &snapshot);
}
}
fn subscribers(&self, shared: &Shared) -> Vec<Arc<Shared>> {
self.state
.lock()
+38 -1
Переглянути файл
@@ -199,7 +199,8 @@ async fn successful_refresh_replaces_models_and_efforts_and_old_sessions_cannot_
pending.reply.send(Ok(response(&["retained", "new"], &["medium"]))).unwrap();
let fresh = completed(&mut events).await;
assert_eq!(model_values(&fresh), ["retained", "new"]);
assert_eq!(fresh.thought_levels.keys().map(String::as_str).collect::<Vec<_>>(), ["new", "retained"]);
// The session's efforts describe its own model, not "new".
assert_eq!(fresh.thought_levels.keys().map(String::as_str).collect::<Vec<_>>(), ["retained"]);
assert_eq!(fresh.thought_levels["retained"][0].values[0].value, "medium");
assert!(fresh.refreshed_at_ms.is_some() && fresh.retry_at_ms.is_some());
manager.shared.remember(PROVIDER, Some(&old), None, Some("old"));
@@ -220,6 +221,42 @@ async fn successful_refresh_replaces_models_and_efforts_and_old_sessions_cannot_
assert!(!tmp.path().join("store").exists(), "refresh never creates tasks");
}
#[tokio::test]
async fn a_session_adds_the_efforts_of_a_model_discovery_did_not_read() {
let tmp = tempfile::tempdir().unwrap();
configure(tmp.path(), "one");
let mut harness = Harness::new();
let catalogs = Arc::new(AgentCatalogs::default());
let manager = make_manager(tmp.path(), catalogs.clone(), &harness);
let mut events = events(&manager);
manager.refresh_models(PROVIDER, false).unwrap();
harness.next().await.reply.send(Ok(response(&["first", "second"], &["low", "high"]))).unwrap();
completed(&mut events).await;
// A session on "second" reports its own efforts; one on a model the catalog lacks, or on
// "first" with other efforts, changes nothing.
let second = config::options_of(&response(&["second"], &["off", "auto"]));
manager.shared.remember(PROVIDER, Some(&second), None, Some("second"));
manager.shared.remember(PROVIDER, Some(&config::options_of(&response(&["gone"], &["x"]))), None, Some("gone"));
manager.shared.remember(PROVIDER, Some(&config::options_of(&response(&["first"], &["max"]))), None, Some("first"));
let efforts = |catalog: &AgentModelCatalog, model: &str| -> Vec<String> {
catalog.thought_levels[model][0].values.iter().map(|v| v.value.clone()).collect()
};
let catalog = manager.refresh_models(PROVIDER, false).unwrap();
assert_eq!(catalog.thought_levels.keys().map(String::as_str).collect::<Vec<_>>(), ["first", "second"]);
assert_eq!(efforts(&catalog, "first"), ["low", "high"]);
assert_eq!(efforts(&catalog, "second"), ["off", "auto"]);
let restored = make_manager(tmp.path(), Arc::default(), &harness).refresh_models(PROVIDER, false).unwrap();
assert_eq!(efforts(&restored, "second"), ["off", "auto"], "persisted with the project's catalog");
// Discovery again reads "first" only; "second" keeps what its session reported.
advance(&catalogs, 60);
while events.try_recv().is_ok() {}
manager.refresh_models(PROVIDER, true).unwrap();
harness.next().await.reply.send(Ok(response(&["first", "second"], &["medium"]))).unwrap();
let fresh = completed(&mut events).await;
assert_eq!(efforts(&fresh, "first"), ["medium"]);
assert_eq!(efforts(&fresh, "second"), ["off", "auto"]);
}
#[tokio::test]
async fn legacy_cache_loads_without_claiming_authoritative_freshness() {
let tmp = tempfile::tempdir().unwrap();
+250
Переглянути файл
@@ -0,0 +1,250 @@
//! ACP elicitation in form mode: the agent's restricted JSON Schema as form fields, and the
//! user's answer as the `elicitation/create` response.
use crate::model::{AgentForm, AgentFormField, AgentFormFieldKind, AgentFormOption, AgentPermissionOption};
use serde_json::{Map, Value, json};
/// The reply that declines the form; a JSON object of field name to values accepts it, and
/// anything else cancels it.
const DECLINE: &str = "decline";
/// The form `elicitation/create` asks for; `Err` when it asks for something else.
pub(crate) fn form_of(params: &Value) -> Result<AgentForm, String> {
if params.get("mode").and_then(Value::as_str) != Some("form") {
return Err("only form elicitation is supported".to_owned());
}
let schema = params.get("requestedSchema").ok_or("requestedSchema is missing")?;
let required: Vec<&str> = schema
.get("required")
.and_then(Value::as_array)
.map(|names| names.iter().filter_map(Value::as_str).collect())
.unwrap_or_default();
let properties = schema.get("properties").and_then(Value::as_object).ok_or("requestedSchema has no properties")?;
let fields = properties
.iter()
.map(|(name, property)| field(name, property, required.contains(&name.as_str())))
.collect::<Result<_, _>>()?;
Ok(AgentForm { fields })
}
fn field(name: &str, property: &Value, required: bool) -> Result<AgentFormField, String> {
let text = |key: &str| property.get(key).and_then(Value::as_str).unwrap_or_default().trim().to_owned();
let number = |key: &str| property.get(key).and_then(Value::as_f64);
let unsupported = || format!("field {name} has an unsupported schema");
let (kind, options, min, max) = match property.get("type").and_then(Value::as_str) {
Some("string") => match choices(property) {
Some(options) => (AgentFormFieldKind::Choice, options, None, None),
None => (AgentFormFieldKind::Text, Vec::new(), number("minLength"), number("maxLength")),
},
Some("number") => (AgentFormFieldKind::Number, Vec::new(), number("minimum"), number("maximum")),
Some("integer") => (AgentFormFieldKind::Integer, Vec::new(), number("minimum"), number("maximum")),
Some("boolean") => (AgentFormFieldKind::Boolean, Vec::new(), None, None),
Some("array") => {
let options = property.get("items").and_then(choices).ok_or_else(unsupported)?;
(AgentFormFieldKind::Choices, options, number("minItems"), number("maxItems"))
}
_ => return Err(unsupported()),
};
let default = match property.get("default") {
Some(Value::Array(values)) => values.iter().filter_map(scalar).collect(),
Some(value) => scalar(value).into_iter().collect(),
None => Vec::new(),
};
let title = text("title");
Ok(AgentFormField {
name: name.to_owned(),
title: if title.is_empty() { name.to_owned() } else { title },
description: text("description"),
required,
kind,
options,
default,
min,
max,
})
}
/// The values of a choice: `enum` (titled by the legacy `enumNames`), or `oneOf` / `anyOf`
/// of `{ const, title }`.
fn choices(schema: &Value) -> Option<Vec<AgentFormOption>> {
let option = |value: &str, label: Option<&str>, description: Option<&str>| AgentFormOption {
value: value.to_owned(),
label: label.filter(|l| !l.trim().is_empty()).unwrap_or(value).to_owned(),
description: description.unwrap_or_default().trim().to_owned(),
};
if let Some(values) = schema.get("enum").and_then(Value::as_array) {
let names = schema.get("enumNames").and_then(Value::as_array);
return Some(
values
.iter()
.enumerate()
.filter_map(|(i, value)| {
Some(option(value.as_str()?, names.and_then(|n| n.get(i)).and_then(Value::as_str), None))
})
.collect(),
);
}
let listed = schema.get("oneOf").or_else(|| schema.get("anyOf"))?.as_array()?;
Some(
listed
.iter()
.filter_map(|o| {
let text = |key: &str| o.get(key).and_then(Value::as_str);
Some(option(text("const")?, text("title"), text("description")))
})
.collect(),
)
}
fn scalar(value: &Value) -> Option<String> {
match value {
Value::String(text) => Some(text.clone()),
Value::Number(number) => Some(number.to_string()),
Value::Bool(flag) => Some(flag.to_string()),
_ => None,
}
}
/// A form is submitted from its own card; this option only names a declined form.
pub(crate) fn options() -> Vec<AgentPermissionOption> {
vec![AgentPermissionOption { id: DECLINE.to_owned(), name: "Decline".to_owned(), kind: "reject_once".to_owned() }]
}
/// The `elicitation/create` response to the user's `reply`, and what the conversation
/// records as chosen.
pub(crate) fn answer(form: &AgentForm, reply: Option<&str>) -> (Value, String) {
let values = match reply {
Some(DECLINE) => return (json!({ "action": "decline" }), "Decline".to_owned()),
Some(reply) => serde_json::from_str::<Map<String, Value>>(reply).ok(),
None => None,
};
let Some(values) = values else { return (json!({ "action": "cancel" }), "Cancelled".to_owned()) };
let mut content = Map::new();
let mut shown = Vec::new();
for field in &form.fields {
let given: Vec<&str> = match values.get(&field.name) {
Some(Value::Array(items)) => items.iter().filter_map(Value::as_str).collect(),
Some(Value::String(item)) => vec![item.as_str()],
_ => Vec::new(),
};
let given: Vec<&str> = given.into_iter().map(str::trim).filter(|v| !v.is_empty()).collect();
let Some(&first) = given.first() else { continue };
let value = match field.kind {
AgentFormFieldKind::Text | AgentFormFieldKind::Choice => json!(first),
AgentFormFieldKind::Number => match first.parse::<f64>() {
Ok(number) => json!(number),
Err(_) => continue,
},
AgentFormFieldKind::Integer => match first.parse::<i64>() {
Ok(number) => json!(number),
Err(_) => continue,
},
AgentFormFieldKind::Boolean => json!(first == "true"),
AgentFormFieldKind::Choices => json!(given),
};
let label = |value: &str| {
field.options.iter().find(|o| o.value == value).map_or_else(|| value.to_owned(), |o| o.label.clone())
};
let text = match field.kind {
AgentFormFieldKind::Boolean => (if first == "true" { "yes" } else { "no" }).to_owned(),
AgentFormFieldKind::Choices => given.iter().map(|v| label(v)).collect::<Vec<_>>().join(", "),
_ => label(first),
};
shown.push(format!("{}: {text}", field.title));
content.insert(field.name.clone(), value);
}
let chosen = if shown.is_empty() { "Submitted".to_owned() } else { shown.join("; ") };
(json!({ "action": "accept", "content": content }), chosen)
}
#[cfg(test)]
mod tests {
use super::*;
/// The form OMP's `ask` tool sends: a choice with a recommended default, then an
/// optional typed answer beside it.
fn ask() -> Value {
json!({
"sessionId": "s", "mode": "form", "message": "Which database?",
"requestedSchema": { "type": "object", "properties": {
"q0": { "type": "string", "title": "Which database?", "description": "Storage",
"oneOf": [{ "const": "pg", "title": "Postgres", "description": "Relational" },
{ "const": "sqlite", "title": "SQLite" }],
"default": "pg" },
"q0__other": { "type": "string", "title": "Other (type your own)" }
} }
})
}
#[test]
fn reads_choices_and_text_fields() {
let form = form_of(&ask()).unwrap();
let [choice, other] = form.fields.as_slice() else { panic!("{form:?}") };
assert_eq!((choice.name.as_str(), choice.kind, choice.required), ("q0", AgentFormFieldKind::Choice, false));
assert_eq!(choice.options[0].label, "Postgres");
assert_eq!(choice.options[0].description, "Relational");
assert_eq!(choice.default, ["pg"]);
assert_eq!((other.kind, other.title.as_str()), (AgentFormFieldKind::Text, "Other (type your own)"));
}
#[test]
fn reads_every_restricted_schema_kind() {
let form = form_of(&json!({ "mode": "form", "requestedSchema": {
"type": "object", "required": ["count"],
"properties": {
"count": { "type": "integer", "minimum": 1, "maximum": 5 },
"ratio": { "type": "number" },
"ok": { "type": "boolean", "default": true },
"size": { "type": "string", "enum": ["s", "l"], "enumNames": ["Small", "Large"] },
"tags": { "type": "array", "items": { "anyOf": [{ "const": "a" }, { "const": "b" }] },
"default": ["b"], "maxItems": 2 }
}
} }))
.unwrap();
let field = |name: &str| form.fields.iter().find(|f| f.name == name).unwrap();
use AgentFormFieldKind::*;
let kinds: Vec<_> = ["count", "ratio", "ok", "size", "tags"].map(|name| field(name).kind).into();
assert_eq!(kinds, [Integer, Number, Boolean, Choice, Choices]);
assert!(field("count").required && !field("ratio").required);
assert_eq!((field("count").min, field("count").max), (Some(1.0), Some(5.0)));
assert_eq!(field("ok").default, ["true"]);
assert_eq!(field("size").options[1].label, "Large");
assert_eq!((field("tags").default.as_slice(), field("tags").max), (["b".to_owned()].as_slice(), Some(2.0)));
}
#[test]
fn url_mode_and_unsupported_fields_are_refused() {
assert!(form_of(&json!({ "mode": "url", "url": "https://example.com" })).is_err());
let nested = json!({ "mode": "form", "requestedSchema": { "type": "object", "properties": {
"address": { "type": "object" }
} } });
assert!(form_of(&nested).is_err());
}
#[test]
fn an_answer_is_typed_by_its_field() {
let form = form_of(&json!({ "mode": "form", "requestedSchema": { "type": "object", "properties": {
"count": { "type": "integer" },
"ok": { "type": "boolean" },
"size": { "type": "string", "oneOf": [{ "const": "s", "title": "Small" }] },
"tags": { "type": "array", "items": { "enum": ["a", "b"] } },
"note": { "type": "string" }
} } }))
.unwrap();
let reply = json!({ "count": ["3"], "ok": ["false"], "size": ["s"], "tags": ["a", "b"], "note": [" "] });
let (response, chosen) = answer(&form, Some(&reply.to_string()));
assert_eq!(
response,
json!({ "action": "accept", "content": { "count": 3, "ok": false, "size": "s", "tags": ["a", "b"] } })
);
assert_eq!(chosen, "count: 3; ok: no; size: Small; tags: a, b");
}
#[test]
fn declining_and_dismissing_send_no_content() {
let form = form_of(&ask()).unwrap();
assert_eq!(answer(&form, Some(DECLINE)), (json!({ "action": "decline" }), "Decline".to_owned()));
assert_eq!(answer(&form, None).0, json!({ "action": "cancel" }));
assert_eq!(answer(&form, Some("cancel")).0, json!({ "action": "cancel" }));
}
}
+95 -20
Переглянути файл
@@ -11,6 +11,7 @@ mod acp;
mod catalogs;
mod config;
mod conversation;
mod elicitation;
mod external;
pub mod mcp;
mod model;
@@ -223,6 +224,7 @@ impl Shared {
commands: Option<&[AgentCommand]>,
model: Option<&str>,
) {
let acp = self.spec(provider).is_some_and(|spec| spec.driver == provider::Driver::Acp);
let mut cache = self.known.lock();
let known = cache.entry(provider.to_owned()).or_default();
let mut changed = false;
@@ -244,6 +246,12 @@ impl Shared {
changed = true;
}
}
// Discovery reads one model's efforts; a session on another model reports that model's.
let learned = model.filter(|_| acp && known.authoritative).zip(config).map(|(model, config)| {
let levels: Vec<_> =
config.iter().filter(|o| o.category.as_deref() == Some("thought_level")).cloned().collect();
(model, levels)
});
if let Some(commands) = commands.filter(|c| !c.is_empty())
&& known.commands.get(&self.root_key()).map(Vec::as_slice) != Some(commands)
{
@@ -254,6 +262,9 @@ impl Shared {
self.persist_known(&cache);
}
drop(cache);
if let Some((model, levels)) = learned.filter(|(_, levels)| !levels.is_empty()) {
self.paths.catalogs.learn_levels(self, provider, model, levels);
}
if changed {
self.emit(AgentEvent::Providers);
}
@@ -1861,12 +1872,24 @@ impl Task {
let s = self.state.lock();
s.busy && s.task.status == AgentStatus::Running
};
let Some(live) = live.filter(|l| running && (prompt.images.is_empty() || l.capabilities.images)) else {
let Some((live, method)) = live
.filter(|l| running && (prompt.images.is_empty() || l.capabilities.images))
.and_then(|l| steer_method(&l.init).map(|m| (l, m)))
else {
return Err(prompt);
};
let content = self.content(&live, &prompt).await;
let sent: Result<Value, RpcError> =
live.peer.request("_openidea/steer", json!({ "sessionId": live.session, "prompt": content }), None).await;
live.peer.request(method, json!({ "sessionId": live.session, "prompt": content }), None).await;
// `_session/steering` answers with an outcome: only `injected` joined the turn
// (`promptRequired`: no turn is running any more).
let sent = match sent {
Ok(reply) => match reply.get("outcome").and_then(Value::as_str) {
None | Some("injected") => Ok(()),
Some(outcome) => Err(reply.get("reason").and_then(Value::as_str).unwrap_or(outcome).to_owned()),
},
Err(e) => Err(e.to_string()),
};
if let Err(e) = sent {
// The turn ended meanwhile: the message waits for the next one instead.
tracing::debug!("agent task {}: steering failed: {e}", self.id);
@@ -2366,12 +2389,7 @@ impl Task {
// first question says what it wants, as the Claude Code adapter titles its own.
let title =
if by_index { questions.first().map(|question| question.question.clone()).unwrap_or(title) } else { title };
// A subagent's request is answered in the task's conversation, named after the subagent.
let session = params.get("sessionId").and_then(Value::as_str);
let title = match session.and_then(|s| self.state.lock().conversation.label(s)) {
Some(label) => format!("{label}: {title}"),
None => title,
};
let title = self.labelled(params, title);
let options: Vec<AgentPermissionOption> = params
.get("options")
.and_then(Value::as_array)
@@ -2403,6 +2421,7 @@ impl Task {
command: None,
options,
questions: Vec::new(),
form: None,
chosen: Some("Denied: side conversations are read-only".to_owned()),
});
return match reject {
@@ -2429,6 +2448,7 @@ impl Task {
command: shown.clone(),
options,
questions: Vec::new(),
form: None,
chosen: Some(format!("Blocked by policy ({pattern})")),
});
return match reject {
@@ -2449,6 +2469,7 @@ impl Task {
command: shown.clone(),
options,
questions: Vec::new(),
form: None,
chosen: Some(format!("{} (whitelisted)", allow.name)),
});
return json!({ "outcome": { "outcome": "selected", "optionId": allow.id } });
@@ -2464,6 +2485,7 @@ impl Task {
command: shown,
options: options.clone(),
questions,
form: None,
chosen: None,
});
self.permissions.lock().insert(id, tx);
@@ -2490,17 +2512,7 @@ impl Task {
.and_then(|reply| options.iter().find(|option| &option.id == reply))
.map_or_else(|| "Cancelled".to_owned(), |option| option.name.clone()),
};
{
let mut s = self.state.lock();
if let Some(AgentEntry::Permission { chosen, .. }) = s.conversation.main.entries.get_mut(entry) {
*chosen = Some(name);
}
}
self.mark_dirty([(None, entry)]);
let still_asking = !self.permissions.lock().is_empty();
if !still_asking && self.state.lock().task.status == AgentStatus::NeedsInput {
self.set_status(AgentStatus::Running, None);
}
self.settle(entry, name);
// An agent that answers by index reads the answers beside the outcome, keyed by
// question index, with its Submit option chosen; anything less cancels the request.
if by_index {
@@ -2532,6 +2544,54 @@ impl Task {
}
}
/// A request from a subagent is answered in the task's conversation, named after the subagent.
fn labelled(&self, params: &Value, title: String) -> String {
let session = params.get("sessionId").and_then(Value::as_str);
match session.and_then(|s| self.state.lock().conversation.label(s)) {
Some(label) => format!("{label}: {title}"),
None => title,
}
}
/// An agent's form (`elicitation/create`): asked in the conversation like a permission
/// request, and answered with its values, declined or cancelled. Blocks like `ask_permission`.
fn elicit(self: &Arc<Self>, params: &Value) -> Result<Value, String> {
let form = elicitation::form_of(params)?;
let id = self.next_permission.fetch_add(1, Ordering::Relaxed);
let message = params.get("message").and_then(Value::as_str).unwrap_or_default().trim().to_owned();
let (tx, rx) = std::sync::mpsc::channel();
let entry = self.push_entry(AgentEntry::Permission {
id,
title: self.labelled(params, message),
command: None,
options: elicitation::options(),
questions: Vec::new(),
form: Some(form.clone()),
chosen: None,
});
self.permissions.lock().insert(id, tx);
self.set_status(AgentStatus::NeedsInput, None);
let reply = rx.recv().ok().flatten();
let (response, chosen) = elicitation::answer(&form, reply.as_deref());
self.settle(entry, chosen);
Ok(response)
}
/// Records the answer to the request at `entry`; the turn runs on once nothing else waits.
fn settle(self: &Arc<Self>, entry: usize, chosen: String) {
{
let mut s = self.state.lock();
if let Some(AgentEntry::Permission { chosen: answer, .. }) = s.conversation.main.entries.get_mut(entry) {
*answer = Some(chosen);
}
}
self.mark_dirty([(None, entry)]);
let still_asking = !self.permissions.lock().is_empty();
if !still_asking && self.state.lock().task.status == AgentStatus::NeedsInput {
self.set_status(AgentStatus::Running, None);
}
}
fn approve_pending(&self) {
let s = self.state.lock();
if self.cancel_pending.load(Ordering::Acquire) || !config::bypass_approvals(&s.task.config) {
@@ -2596,6 +2656,7 @@ impl Handler for Client {
let task = self.task.upgrade().ok_or((codes::INTERNAL_ERROR, "task closed".to_owned()))?;
match method {
"session/request_permission" => Ok(task.ask_permission(&params)),
"elicitation/create" => task.elicit(&params).map_err(|e| (codes::INVALID_PARAMS, e)),
_ => Err((codes::METHOD_NOT_FOUND, format!("unsupported method {method}"))),
}
}
@@ -2865,13 +2926,27 @@ fn shown_background(tasks: &[Value], known: &[AgentBackgroundTask]) -> Vec<Agent
.collect()
}
/// The method that adds a message to the running turn: OpenIDEA's own, or the
/// `_session/steering` extension an agent advertises in the response's top-level `_meta`
/// (OMP).
fn steer_method(init: &acp::Negotiated) -> Option<&'static str> {
let supported = |v: Option<&Value>| v.and_then(Value::as_bool) == Some(true);
if supported(init.meta("/openidea/steer")) {
Some("_openidea/steer")
} else if supported(init.meta.as_ref().and_then(|m| m.pointer("/steering/supported"))) {
Some("_session/steering")
} else {
None
}
}
fn capabilities_of(init: &acp::Negotiated) -> (AgentCapabilities, bool) {
let meta = |p: &str| init.meta(p).and_then(Value::as_bool) == Some(true);
let capabilities = AgentCapabilities {
images: init.prompt("image"),
fork: init.session("fork"),
rollback: meta("/openidea/rollback"),
steer: meta("/openidea/steer"),
steer: steer_method(init).is_some(),
background_tasks: meta("/openidea/backgroundTasks"),
read_only: false,
};
+57
Переглянути файл
@@ -316,6 +316,59 @@ pub struct AgentQuestionOption {
pub preview: Option<String>,
}
/// A form the agent asks the user to fill in (ACP `elicitation/create`, form mode).
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Type)]
#[serde(rename_all = "camelCase")]
pub struct AgentForm {
pub fields: Vec<AgentFormField>,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Type)]
#[serde(rename_all = "camelCase")]
pub struct AgentFormField {
/// The property name the answer is keyed by.
pub name: String,
pub title: String,
#[serde(default)]
pub description: String,
#[serde(default)]
pub required: bool,
pub kind: AgentFormFieldKind,
/// The choices of a `choice` or `choices` field.
#[serde(default)]
pub options: Vec<AgentFormOption>,
/// The initial answer: option values, a text, a number, or `true` / `false`.
#[serde(default)]
pub default: Vec<String>,
/// Bounds: the number of a `number` / `integer`, the length of a `text`, the count of `choices`.
#[serde(default)]
pub min: Option<f64>,
#[serde(default)]
pub max: Option<f64>,
}
#[derive(Clone, Copy, Debug, PartialEq, Eq, Serialize, Deserialize, Type)]
#[serde(rename_all = "camelCase")]
pub enum AgentFormFieldKind {
Text,
Number,
Integer,
Boolean,
/// One of `options`.
Choice,
/// Any of `options`.
Choices,
}
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Type)]
#[serde(rename_all = "camelCase")]
pub struct AgentFormOption {
pub value: String,
pub label: String,
#[serde(default)]
pub description: String,
}
/// One item of a task's conversation.
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize, Type)]
#[serde(tag = "type", rename_all = "camelCase", rename_all_fields = "camelCase")]
@@ -396,6 +449,10 @@ pub enum AgentEntry {
/// of question to answer instead of an option.
#[serde(default)]
questions: Vec<AgentQuestion>,
/// Set when the agent asks for a form (ACP elicitation); answered with a JSON object of
/// field name to its values, `decline`, or nothing to cancel.
#[serde(default)]
form: Option<AgentForm>,
/// Name of the chosen option, or `None` while pending. Cancelled requests read "Cancelled".
chosen: Option<String>,
},
+119
Переглянути файл
@@ -51,6 +51,9 @@ struct FakeAgent {
/// Config options `session/new` reports after the model one (per-model efforts, say).
extra_options: Mutex<Vec<Value>>,
model_options: Mutex<HashMap<String, Vec<Value>>>,
/// Advertises steering as OMP does (`_meta.steering` at the top of `initialize`)
/// instead of `_meta.openidea.steer`.
session_steering: bool,
}
impl FakeAgent {
@@ -156,6 +159,10 @@ impl Handler for FakeAgent {
if params.pointer("/clientCapabilities/subagents").is_some_and(Value::is_object) {
self.calls.lock().push("subagents".into());
}
if self.session_steering {
return Ok(json!({"protocolVersion": 1, "agentCapabilities": {"loadSession": true},
"_meta": {"steering": {"supported": true}}}));
}
Ok(
json!({"protocolVersion": 1, "authMethods": self.auth_methods, "agentCapabilities": {"loadSession": !self.no_load,
"sessionCapabilities": {"fork": {}}, "_meta": {"openidea": {"rollback": true, "steer": true, "backgroundTasks": true}}}}),
@@ -183,6 +190,13 @@ impl Handler for FakeAgent {
self.calls.lock().push(format!("{method} {detail}"));
Ok(json!({}))
}
"_session/steering" => {
let text = params["prompt"][0]["text"].clone();
self.calls.lock().push(format!("{method} {text}"));
// OMP answers whether the message joined the turn rather than failing.
let outcome = if text == "too late" { "promptRequired" } else { "injected" };
Ok(json!({"outcome": outcome, "queue": "steering"}))
}
"session/load" => {
self.say(&session, "replayed history");
Ok(json!({}))
@@ -281,6 +295,23 @@ impl Handler for FakeAgent {
self.say(&session, &format!("escalation chose {chosen}"));
return Ok(json!({"stopReason": "end_turn"}));
}
if text == "form" {
let peer = self.latest();
let answer: Value = tokio::runtime::Handle::current()
.block_on(peer.request(
"elicitation/create",
json!({"sessionId": session, "mode": "form", "message": "How should I refactor?",
"requestedSchema": {"type": "object", "required": ["strategy"], "properties": {
"strategy": {"type": "string", "title": "Strategy",
"oneOf": [{"const": "safe", "title": "Conservative"},
{"const": "bold", "title": "Aggressive"}]},
"tests": {"type": "boolean", "title": "Run tests"}}}}),
None,
))
.unwrap();
self.say(&session, &format!("form {answer}"));
return Ok(json!({ "stopReason": "end_turn" }));
}
if text == "ask" {
let peer = self.latest();
let answer: Value = tokio::runtime::Handle::current()
@@ -1060,6 +1091,42 @@ fn text(t: &str) -> AgentPrompt {
AgentPrompt { text: t.into(), ..AgentPrompt::default() }
}
#[tokio::test(flavor = "multi_thread")]
async fn steers_through_session_steering() {
let tmp = tempfile::tempdir().unwrap();
let agent = Arc::new(FakeAgent { session_steering: true, ..FakeAgent::default() });
let mgr = manager(tmp.path(), agent.clone());
let task = mgr
.create(NewAgentTask {
project_root: None,
prompt: text("wait"),
provider: "claude".into(),
config: vec![],
isolation: Isolation::Local,
base: None,
})
.await
.unwrap();
wait_for(&mgr, &task.id, AgentStatus::Running).await;
assert!(mgr.task(&task.id).unwrap().state.lock().task.capabilities.steer);
mgr.prompt(&task.id, text("also this"), true).await.unwrap();
assert!(agent.calls.lock().iter().any(|c| c == "_session/steering \"also this\""));
let entries = mgr.entries(&task.id, None).unwrap();
assert!(matches!(entries.last(), Some(AgentEntry::User { steered: true, .. })));
assert!(mgr.task(&task.id).unwrap().state.lock().task.queue.is_empty());
// The agent didn't take it into the turn: the turn stops and it goes next, as without
// steering (the fake agent's next turn asks for permission).
mgr.prompt(&task.id, text("too late"), true).await.unwrap();
wait_for(&mgr, &task.id, AgentStatus::NeedsInput).await;
let entries = mgr.entries(&task.id, None).unwrap();
assert!(entries.iter().any(|e| matches!(e, AgentEntry::User { text, steered: false, .. } if text == "too late")));
assert!(!entries.iter().any(|e| matches!(e, AgentEntry::User { text, steered: true, .. } if text == "too late")));
mgr.cancel(&task.id, None).unwrap();
wait_for(&mgr, &task.id, AgentStatus::Ready).await;
}
#[tokio::test(flavor = "multi_thread")]
async fn messages_sent_while_busy_are_queued_and_send_now_interrupts() {
let tmp = tempfile::tempdir().unwrap();
@@ -1985,6 +2052,58 @@ async fn bypass_approvals_keeps_both_question_dialects_pending_but_allows_permis
}
}
#[tokio::test(flavor = "multi_thread")]
async fn an_agent_form_is_answered_declined_or_cancelled_even_when_approvals_are_bypassed() {
let accept = json!({"strategy": ["bold"], "tests": ["true"]}).to_string();
for (reply, said, chosen) in [
(
Some(accept.as_str()),
r#"form {"action":"accept","content":{"strategy":"bold","tests":true}}"#,
"Strategy: Aggressive; Run tests: yes",
),
(Some("decline"), r#"form {"action":"decline"}"#, "Decline"),
(None, r#"form {"action":"cancel"}"#, "Cancelled"),
] {
let tmp = tempfile::tempdir().unwrap();
let mgr = manager(tmp.path(), Arc::new(FakeAgent::default()));
let task = mgr
.create(NewAgentTask {
project_root: None,
prompt: text("form"),
provider: "cursor".into(),
config: vec![AgentConfigChoice { id: config::CURSOR_APPROVAL.into(), value: "bypass".into() }],
isolation: Isolation::Local,
base: None,
})
.await
.unwrap();
wait_for(&mgr, &task.id, AgentStatus::NeedsInput).await;
let (id, form) = mgr
.entries(&task.id, None)
.unwrap()
.into_iter()
.find_map(|entry| match entry {
AgentEntry::Permission { id, title, form: Some(form), chosen: None, .. }
if title == "How should I refactor?" =>
{
Some((id, form))
}
_ => None,
})
.unwrap();
assert_eq!(form.fields.iter().map(|f| f.name.as_str()).collect::<Vec<_>>(), ["strategy", "tests"]);
mgr.respond(&task.id, id, reply.map(str::to_owned)).unwrap();
wait_for(&mgr, &task.id, AgentStatus::Ready).await;
let entries = mgr.entries(&task.id, None).unwrap();
assert!(entries.iter().any(|e| matches!(e, AgentEntry::Agent { text } if text == said)), "{entries:?}");
assert!(
entries.iter().any(|e| matches!(e, AgentEntry::Permission { chosen: Some(c), .. } if c == chosen)),
"{entries:?}"
);
mgr.shutdown();
}
}
#[tokio::test(flavor = "multi_thread")]
async fn cursor_approval_choice_applies_before_first_prompt() {
let tmp = tempfile::tempdir().unwrap();
+1
Переглянути файл
@@ -441,6 +441,7 @@ mod tests {
command: None,
options: vec![],
questions: vec![],
form: None,
chosen: None,
});
assert_eq!(t.end_turn(None), vec![2, 3]);
+2
Переглянути файл
@@ -19,6 +19,7 @@ pub enum Tool {
Maven,
Gradle,
Ruby,
Zig,
}
impl Tool {
@@ -32,6 +33,7 @@ impl Tool {
Tool::Maven => &["maven"],
Tool::Gradle => &["gradle"],
Tool::Ruby => &["ruby"],
Tool::Zig => &["zig"],
}
}
}
+25 -11
Переглянути файл
@@ -78,8 +78,8 @@ impl Needle {
let mut b = 0;
if n.eq_ignore_ascii_case(q) {
b += EXACT;
} else if let Some(dot) = name.find('.')
&& name.as_bytes()[..dot].eq_ignore_ascii_case(q)
} else if let Some(dot) = n.iter().position(|&b| b == b'.')
&& n[..dot].eq_ignore_ascii_case(q)
{
b += EXACT_STEM;
} else if n.len() >= q.len() && n[..q.len()].eq_ignore_ascii_case(q) {
@@ -97,17 +97,31 @@ fn hump_bonus(s: &str, indices: &[u32]) -> u32 {
if indices.is_empty() {
return 0;
}
let chars: Vec<char> = s.chars().collect();
let is_start = |i: usize| {
if i == 0 {
return true;
// One pass over `s`: `indices` is sorted, and whether position `i` is a
// word start only needs the char before it, so no `Vec<char>` is collected.
let is_start = |prev: Option<char>, c: char| match prev {
None => true,
Some(p) => {
!p.is_alphanumeric()
|| (p.is_lowercase() && c.is_uppercase())
|| (!p.is_ascii_digit() && c.is_ascii_digit())
}
let (p, c) = (chars[i - 1], chars[i]);
!p.is_alphanumeric() || (p.is_lowercase() && c.is_uppercase()) || (!p.is_ascii_digit() && c.is_ascii_digit())
};
let humps = indices.iter().filter(|&&i| (i as usize) < chars.len() && is_start(i as usize)).count() as u32;
let first = if is_start(indices[0] as usize) { FIRST_AT_START } else { 0 };
humps * HUMP + first
let (mut humps, mut next, mut first_start) = (0u32, 0usize, false);
let (mut prev, mut at) = (None, 0u32);
for c in s.chars() {
if next < indices.len() && indices[next] == at {
let started = is_start(prev, c);
humps += u32::from(started);
if next == 0 {
first_start = started;
}
next += 1;
}
prev = Some(c);
at += 1;
}
humps * HUMP + u32::from(first_start) * FIRST_AT_START
}
#[derive(Clone, Copy)]
+82
Переглянути файл
@@ -25,6 +25,7 @@ pub fn detect(kind: SdkKind, root: Option<&Path>) -> Vec<Sdk> {
SdkKind::Jdk => jdk(),
SdkKind::Maven => maven(),
SdkKind::Ruby => crate::ruby::detect(root),
SdkKind::Zig => zig(),
};
if let Some(root) = root {
pinned_first(&mut out, kind, root);
@@ -40,6 +41,7 @@ fn tool_of(kind: SdkKind) -> Option<Tool> {
SdkKind::Jdk => Some(Tool::Java),
SdkKind::Maven => Some(Tool::Maven),
SdkKind::Ruby => Some(Tool::Ruby),
SdkKind::Zig => Some(Tool::Zig),
SdkKind::Php | SdkKind::PackageManager | SdkKind::Rust | SdkKind::TypeScript => None,
}
}
@@ -739,6 +741,86 @@ fn go() -> Vec<Sdk> {
})
}
// ------------------------------------------------------------------ zig
/// The directory holding the `zig` executable of the install rooted at `base`,
/// the way the common distributions lay it out: `zig` at the root (official
/// tarballs, mise / asdf installs), `<base>/bin/zig` (Homebrew) or one
/// directory down (zvm's nested version folders).
fn zig_dir(base: &Path) -> Option<PathBuf> {
if base.join(exe("zig")).is_file() {
return Some(base.to_path_buf());
}
let bin = base.join(bin_dir());
if bin.join(exe("zig")).is_file() {
return Some(bin);
}
subdirs(base).into_iter().find(|d| d.join(exe("zig")).is_file())
}
/// Zig toolchains: PATH, Homebrew, zvm and mise / asdf installs. `path` is the
/// directory holding `zig`, which is what `languages.zig.zig` stores.
fn zig() -> Vec<Sdk> {
let mut roots: Vec<(PathBuf, &'static str)> = Vec::new();
if let Some(bin) = which("zig").filter(|p| !version_managers::is_shim(p))
&& let Some(dir) = bin.parent()
{
roots.push((dir.to_path_buf(), "path"));
}
for p in ["/opt/homebrew/opt/zig", "/usr/local/opt/zig"] {
roots.push((PathBuf::from(p), "system"));
}
if let Some(home) = home_dir() {
for d in subdirs(&home.join(".zvm")) {
roots.push((d, "zvm"));
}
}
for (d, manager) in version_managers::installs(Tool::Zig) {
roots.push((d, manager));
}
let mut dirs: Vec<(PathBuf, &'static str)> =
roots.into_iter().filter_map(|(base, source)| zig_dir(&base).map(|dir| (dir, source))).collect();
let mut seen = HashSet::new();
dirs.retain(|(dir, _)| seen.insert(dir.canonicalize().unwrap_or_else(|_| dir.clone())));
par_map(&dirs, |(dir, source)| {
let version = query(&dir.join(exe("zig")), &["version"], VERSION_TIMEOUT).map(|v| v.trim().to_owned());
Some(Sdk {
path: dir.clone().into(),
name: format!("Zig {}", version.as_deref().unwrap_or_default()).trim().to_owned(),
version,
source: (*source).to_owned(),
home: Some(dir.clone().into()),
extra: None,
})
})
}
#[cfg(test)]
mod zig_tests {
use super::*;
#[test]
fn finds_the_zig_directory_of_each_layout() {
let tmp = tempfile::tempdir().unwrap();
let install = |rel: &str| {
let dir = tmp.path().join(rel);
std::fs::create_dir_all(&dir).unwrap();
std::fs::write(dir.join(exe("zig")), "").unwrap();
dir
};
// Official tarballs and mise / asdf installs: `zig` at the root.
let root = install("0.14.1");
assert_eq!(zig_dir(&root), Some(root));
// Homebrew: <opt>/bin/zig.
let brew = install("brew/bin");
assert_eq!(zig_dir(brew.parent().unwrap()), Some(brew));
// zvm: one directory down.
let zvm = install("zvm/x");
assert_eq!(zig_dir(&tmp.path().join("zvm")), Some(zvm));
assert_eq!(zig_dir(&tmp.path().join("missing")), None);
}
}
// ------------------------------------------------------------------ typescript
/// `node_modules/typescript/lib` of the project (root or a direct workspace member).
+2
Переглянути файл
@@ -52,6 +52,8 @@ pub enum SdkKind {
/// Maven homes.
Maven,
Ruby,
/// Zig toolchain directories.
Zig,
}
/// One installed interpreter / toolchain.
+10
Переглянути файл
@@ -61,6 +61,9 @@ fn mise_and_asdf_installs_are_detected_and_pinned_versions_used() {
script(&maven.join("bin/mvn"), "Apache Maven 3.9.6");
write(&maven.join("lib/maven-core-3.9.6.jar"), "");
script(&installs.join("gradle/8.7/bin/gradle"), "Gradle 8.7");
// Zig: asdf keeps the executable at the install root, zvm under ~/.zvm.
script(&asdf.join("installs/zig/0.14.1/zig"), "0.14.1");
script(&tmp.join("home/.zvm/0.13.0/zig"), "0.13.0");
let project = tmp.join("project");
write(
@@ -91,6 +94,13 @@ fn mise_and_asdf_installs_are_detected_and_pinned_versions_used() {
let mvn = find(&mavens, &maven);
assert_eq!((mvn.source.as_str(), mvn.version.as_deref()), ("mise", Some("3.9.6")));
let zigs = detect(SdkKind::Zig, Some(&project));
let zig = find(&zigs, &asdf.join("installs/zig"));
assert_eq!((zig.source.as_str(), zig.version.as_deref()), ("asdf", Some("0.14.1")));
assert_eq!(zig.path, asdf.join("installs/zig/0.14.1"), "the setting stores the directory");
let zvm = find(&zigs, &tmp.join("home/.zvm"));
assert_eq!((zvm.source.as_str(), zvm.version.as_deref()), ("zvm", Some("0.13.0")));
// Nothing configured in Settings: the pinned versions apply.
let s = Settings::default();
let jdk = ide_sdk::apply::project_jdk(&project, &s).expect("pinned JDK");
+1 -1
Переглянути файл
@@ -43,7 +43,7 @@ User-visible text is written in English at the call site and goes through the te
## WebKit compatibility
On macOS and Linux the app runs in WebKit, and the supported floor is Safari 16, the engine of macOS 13 (on macOS 11 and 12 a Safari update doesn't update the engine other apps use). `pnpm build` runs `scripts/check-webkit.ts` on the bundle, and `src/platform/webkitCompatibility.test.ts` checks application regexes. Avoid:
On macOS and Linux the app runs in WebKit, and the supported floor is Safari 15.4, the engine of macOS 12 (the app's minimum). `pnpm build` runs `scripts/check-webkit.ts` on the bundle, and `src/platform/webkitCompatibility.test.ts` checks application regexes. Avoid:
- regex lookbehind (`(?<=…)`, `(?<!…)`), which needs Safari 16.4, and the regex `v` flag;
- import attributes;
+1 -1
Переглянути файл
@@ -117,7 +117,7 @@ With tabs placed left or right, the tab column is as wide as its longest name, u
| **Go to Next Splitter** | `⌥⇥` | `Alt+Tab` |
| **Go to Previous Splitter** | `⌥⇧⇥` | `Alt+Shift+Tab` |
**Window › Editor Tabs** also offers **Split Down**, **Unsplit**, **Unsplit All**, **Move to Opposite Group**, **Open in Opposite Group** and **Change Splitter Orientation**. You can also drag a tab to an edge of the editor area to split it.
**Window › Editor Tabs** also offers **Split Down**, **Unsplit**, **Unsplit All**, **Move to Opposite Group**, **Open in Opposite Group** and **Change Splitter Orientation**. You can also drag a tab to an edge of the editor area to split it. In the Project view, **Open in Right Split** (`⇧↵` / `Shift+Enter`, also in the context menu) opens the selected file in the split to the right.
## View options
+1 -1
Переглянути файл
@@ -9,7 +9,7 @@ In the file names below, `<version>` is the release version, for example `0.1.40
## macOS
macOS 13 Ventura or later.
macOS 12 Monterey or later.
| Mac | File |
| ------------- | -------------------------------- |
+1 -1
Переглянути файл
@@ -43,7 +43,7 @@ description: "前端 UI 代码的规则:设计 token、CSS Modules、图标、
## WebKit 兼容性
在 macOS 和 Linux 上应用运行于 WebKit,最低支持 Safari 16,即 macOS 13 的引擎(macOS 11、12 上更新 Safari 不会更新其他应用使用的引擎)。`pnpm build` 会对产物运行 `scripts/check-webkit.ts`,`src/platform/webkitCompatibility.test.ts` 会检查应用中的正则。请避免:
在 macOS 和 Linux 上应用运行于 WebKit,最低支持 Safari 15.4,即 macOS 12 的引擎(应用的最低系统版本)。`pnpm build` 会对产物运行 `scripts/check-webkit.ts`,`src/platform/webkitCompatibility.test.ts` 会检查应用中的正则。请避免:
- 正则后行断言(`(?<=…)`、`(?<!…)`,需要 Safari 16.4)和正则 `v` 标志;
- import attributes;
+1 -1
Переглянути файл
@@ -117,7 +117,7 @@ description: "多光标与选区、行编辑、剪贴板历史、代码折叠、
| **转到下一个拆分器** | `⌥⇥` | `Alt+Tab` |
| **转到上一个拆分器** | `⌥⇧⇥` | `Alt+Shift+Tab` |
**窗口 › 编辑器标签页** 中还有 **向下拆分**、**取消拆分**、**全部取消拆分**、**移动到另一组**、**在相对组中打开** 和 **更改拆分方向**。也可以把标签页拖到编辑区的某一侧边缘来拆分。
**窗口 › 编辑器标签页** 中还有 **向下拆分**、**取消拆分**、**全部取消拆分**、**移动到另一组**、**在相对组中打开** 和 **更改拆分方向**。也可以把标签页拖到编辑区的某一侧边缘来拆分。在 Project 视图中,**在右侧拆分中打开**(`⇧↵` / `Shift+Enter`,右键菜单中也有)会把选中的文件打开到右侧拆分中。
## 显示选项
+1 -1
Переглянути файл
@@ -9,7 +9,7 @@ description: "在 macOS、Windows 或 Linux 上下载并安装 OpenIDEA,以及
## macOS
需要 macOS 13 Ventura 或更高版本。
需要 macOS 12 Monterey 或更高版本。
| Mac | 文件 |
| ---------- | -------------------------------- |
+6 -12
Переглянути файл
@@ -13,7 +13,7 @@
details: "启动错误详情",
timeout: "启动未在 60 秒内完成。",
outdatedMac:
"这台 Mac 的系统网页引擎过旧:OpenIDEA 的界面运行在 macOS 自带的 WebKit 引擎上,需要 macOS 13 Ventura 或更高版本。在 macOS 11、12 上更新 Safari 不会更新其他应用使用的引擎,需要升级 macOS。",
"这台 Mac 的系统网页引擎过旧:OpenIDEA 的界面运行在 macOS 自带的 WebKit 引擎上,需要 macOS 12 Monterey 或更高版本(引擎为 Safari 15.4 或更新)。更旧的系统缺少应用所需的引擎,需要升级 macOS。",
outdated:
"系统的 WebKitGTK 版本过旧:OpenIDEA 需要较新的 WebKitGTK(webkit2gtk-4.1)。请通过系统的包管理器更新后重新打开 OpenIDEA。",
}
@@ -27,20 +27,14 @@
details: "Startup error details",
timeout: "Startup did not finish within 60 seconds.",
outdatedMac:
"The system web engine on this Mac is too old: OpenIDEA's interface runs on macOS's built-in WebKit and needs macOS 13 Ventura or later. On macOS 11 and 12 a Safari update doesn't update the engine other apps use, so macOS itself needs upgrading.",
"The system web engine on this Mac is too old: OpenIDEA's interface runs on macOS's built-in WebKit and needs macOS 12 Monterey or later (Safari 15.4 or newer). Older macOS releases lack the engine the app needs, so macOS itself needs upgrading.",
outdated:
"The system's WebKitGTK is too old: OpenIDEA needs a recent WebKitGTK (webkit2gtk-4.1). Update it with your package manager, then open OpenIDEA again.",
};
// The bundle targets Safari 16 (vite.config.ts); an older system web engine can't even
// parse it. Container queries came with Safari 16, and WebKit's user agent doesn't name
// its version. Unknown (no CSS.supports) counts as current.
const outdated = () => {
try {
return typeof window.CSS?.supports === "function" && !window.CSS.supports("container-type", "inline-size");
} catch {
return false;
}
};
// The bundle targets Safari 15.4 (vite.config.ts), so an older system web engine can't
// even parse it. structuredClone came with Safari 15.4, and WebKit's user agent doesn't
// name its version.
const outdated = () => typeof structuredClone !== "function";
let failed = false;
let ready = false;
const describe = (reason) => {
+5 -1
Переглянути файл
@@ -10,12 +10,16 @@ it.each([
"Object.groupBy(items, key)",
"Array.fromAsync(items)",
"text.toWellFormed()",
"input.showPicker()",
'Intl.supportedValuesOf("collator")',
"items.toSorted(compare)",
"path.toReversed()",
'new RegExp("[a-z]", "v")',
'RegExp("(?<=a)b")',
"/[a-z]/v",
"/(?<!a)b/",
'import data from "./data.json" with { type: "json" }',
])("rejects %s in the Safari 16 startup graph", (source) => {
])("rejects %s in the Safari 15.4 startup graph", (source) => {
expect(checkSource(source, true).length).toBeGreaterThan(0);
});
+13 -4
Переглянути файл
@@ -3,7 +3,7 @@ import { dirname, resolve } from "node:path";
import { pathToFileURL } from "node:url";
import ts from "typescript";
// Safari 16 is macOS 13's system engine (the app's minimum). Keep this floor in sync with vite.config.ts.
// Safari 15.4 is the bundle's floor, macOS 12's engine (the app's minimum). Keep this floor in sync with vite.config.ts.
// Syntax lowering does not replace newer runtime APIs in dependencies.
const newerStatics = new Set([
"Promise.withResolvers",
@@ -15,7 +15,16 @@ const newerStatics = new Set([
"Uint8Array.fromBase64",
"Uint8Array.fromHex",
]);
const newerMethods = new Set(["isWellFormed", "toWellFormed"]);
const newerMethods = new Set([
"isWellFormed",
"toWellFormed",
// Safari 16 / 16.4 APIs above the floor.
"showPicker",
"supportedValuesOf",
"toSorted",
"toReversed",
"toSpliced",
]);
export function checkSource(source: string, startup: boolean): string[] {
const tree = ts.createSourceFile("bundle.js", source, ts.ScriptTarget.Latest, true, ts.ScriptKind.JS);
@@ -84,6 +93,6 @@ export function checkBuild(dir: string): string[] {
if (process.argv[1] && import.meta.url === pathToFileURL(resolve(process.argv[1])).href) {
const errors = checkBuild(resolve("dist"));
if (errors.length) throw new Error(`Safari 16 compatibility check failed:\n${errors.join("\n")}`);
console.log("Safari 16 startup API and bundle syntax checks passed");
if (errors.length) throw new Error(`Safari 15.4 compatibility check failed:\n${errors.join("\n")}`);
console.log("Safari 15.4 startup API and bundle syntax checks passed");
}
+1 -1
Переглянути файл
@@ -41,7 +41,7 @@
"longDescription": "OpenIDEA is an open-source IDE inspired by IntelliJ IDEA. Not affiliated with JetBrains.",
"macOS": {
"entitlements": "./Entitlements.plist",
"minimumSystemVersion": "13.0"
"minimumSystemVersion": "12.0"
}
},
"mainBinaryName": "openidea",
+41 -1
Переглянути файл
@@ -2056,6 +2056,11 @@ command?: string | null; options: AgentPermissionOption[];
* of question to answer instead of an option.
*/
questions?: AgentQuestion[];
/**
* Set when the agent asks for a form (ACP elicitation); answered with a JSON object of
* field name to its values, `decline`, or nothing to cancel.
*/
form?: AgentForm | null;
/** Name of the chosen option, or `None` while pending. Cancelled requests read "Cancelled". */
chosen: string | null } | { type: "error"; message: string };
@@ -2079,6 +2084,39 @@ export type AgentEvent =
/** The installed or configured agent providers changed. */
{ type: "providers" };
/** A form the agent asks the user to fill in (ACP `elicitation/create`, form mode). */
export type AgentForm = {
fields: AgentFormField[],
};
export type AgentFormField = {
/** The property name the answer is keyed by. */
name: string,
title: string,
description?: string,
required?: boolean,
kind: AgentFormFieldKind,
/** The choices of a `choice` or `choices` field. */
options?: AgentFormOption[],
/** The initial answer: option values, a text, a number, or `true` / `false`. */
default?: string[],
/** Bounds: the number of a `number` / `integer`, the length of a `text`, the count of `choices`. */
min?: number | null,
max?: number | null,
};
export type AgentFormFieldKind = "text" | "number" | "integer" | "boolean" |
/** One of `options`. */
"choice" |
/** Any of `options`. */
"choices";
export type AgentFormOption = {
value: string,
label: string,
description?: string,
};
export type AgentImage = {
mimeType: string,
/** Base64, without a `data:` prefix. */
@@ -9627,7 +9665,9 @@ export type SdkKind = "python" | "node" |
/** JDK homes. */
"jdk" |
/** Maven homes. */
"maven" | "ruby";
"maven" | "ruby" |
/** Zig toolchain directories. */
"zig";
/**
* IDEA's search context: matches anywhere, only in, or outside comments and
+14
Переглянути файл
@@ -290,6 +290,20 @@ export const documentSynced = Facet.define<() => Promise<void>, (() => Promise<v
combine: (values) => values[0] ?? null,
});
/**
* Undo / Redo of an editor whose history is kept outside CodeMirror (notebook cells share
* the notebook's backend history). Commands that would call CodeMirror's history (Vim's
* `u` / `Ctrl-R`) go through it instead.
*/
export interface ExternalHistory {
undo(): void;
redo(): void;
}
export const externalHistory = Facet.define<ExternalHistory, ExternalHistory | null>({
combine: (values) => values[0] ?? null,
});
export function whenSynced(view: EditorView): Promise<void> {
return view.state.facet(documentSynced)?.() ?? Promise.resolve();
}
+8 -8
Переглянути файл
@@ -74,7 +74,7 @@
flex: none;
display: flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
padding: 0 6px 0 8px;
}
.pin {
@@ -89,7 +89,7 @@
flex: none;
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
min-height: 36px;
padding: 0 12px;
background: var(--bg-editor-banner, color-mix(in srgb, var(--accent) 7%, var(--bg-editor, var(--bg-elev))));
@@ -133,8 +133,8 @@
display: grid;
grid-template-columns: minmax(220px, 420px) auto 1fr;
align-items: center;
column-gap: 6px;
row-gap: 6px;
column-gap: var(--space-1-5);
row-gap: var(--space-1-5);
padding: 6px 8px 6px 10px;
background: var(--bg-editor-inline, var(--bg-elev));
border-bottom: 1px solid var(--border-editor-tabs, var(--border));
@@ -155,7 +155,7 @@
.findButtons {
display: flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
}
.findCount {
font-size: var(--fs-ui);
@@ -173,14 +173,14 @@
.replaceButtons {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
}
/* Go to line */
.gotoBody {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
padding: 8px 16px 0;
}
.gotoHint {
@@ -316,7 +316,7 @@
flex: none;
display: flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
height: 26px;
padding: 0 8px;
overflow: hidden;
+1 -1
Переглянути файл
@@ -115,7 +115,7 @@ function EmptyEditorArea() {
return (
<div ref={ref} className={styles.area}>
<EmptyEditor />
{over && <div className={clsx(styles.dropZone, styles["drop-center"])} aria-hidden="true" />}
{over && <div className={styles.dropZone} aria-hidden="true" />}
</div>
);
}
+2 -2
Переглянути файл
@@ -58,7 +58,7 @@
.row {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
height: var(--h-list-row);
padding: 0 6px;
border-radius: var(--radius-row);
@@ -87,7 +87,7 @@
.childHeader {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
height: var(--h-list-row);
padding: 0 6px;
margin-bottom: 2px;
+10 -10
Переглянути файл
@@ -11,7 +11,7 @@
flex: none;
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
padding: 0 12px;
font-size: var(--fs-ui);
font-weight: 600;
@@ -96,7 +96,7 @@
.item {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
min-width: 0;
width: 100%;
font-size: var(--fs-ui);
@@ -263,7 +263,7 @@
bottom: 0;
display: flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
padding: 2px 6px;
border-top: 1px solid var(--border-popup);
background: var(--bg-popup);
@@ -283,7 +283,7 @@
flex: none;
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 0 6px 0 12px;
background: var(--bg-popup-inline, var(--bg-elev));
border-bottom: 1px solid var(--border-popup);
@@ -342,7 +342,7 @@
height: var(--h-row);
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
padding: 0 14px;
font-size: var(--fs-ui);
}
@@ -368,7 +368,7 @@
flex: none;
display: flex;
align-items: flex-start;
gap: 6px;
gap: var(--space-1-5);
padding: 10px 14px 0;
font-size: var(--fs-ui);
color: var(--fg-muted);
@@ -421,7 +421,7 @@
border: 0;
display: flex;
flex-direction: column;
gap: 6px;
gap: var(--space-1-5);
}
.reformatLegend {
margin-bottom: 6px;
@@ -432,21 +432,21 @@
.reformatOption {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
font-size: var(--fs-ui);
}
.pasteImports {
display: flex;
flex-direction: column;
gap: 12px;
gap: var(--space-3);
padding: 14px;
font-size: var(--fs-ui);
}
.pasteImportList {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
max-height: 280px;
overflow: auto;
overflow-wrap: anywhere;
+3 -3
Переглянути файл
@@ -19,7 +19,7 @@
flex: none;
display: flex;
flex-direction: column;
gap: 6px;
gap: var(--space-1-5);
}
.targets {
@@ -41,7 +41,7 @@
display: grid;
grid-template-columns: 1fr 110px;
align-items: center;
gap: 8px;
gap: var(--space-2);
padding: 0 8px;
min-height: var(--h-list-row);
}
@@ -88,6 +88,6 @@
.busy {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
color: var(--fg-muted);
}
+10 -10
Переглянути файл
@@ -35,7 +35,7 @@
.agentRow {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
width: 100%;
min-width: 0;
padding: 0 8px;
@@ -69,7 +69,7 @@
.registryState {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 6px 12px;
border-top: 1px solid var(--border);
color: var(--fg-muted);
@@ -79,7 +79,7 @@
.customActions {
display: flex;
flex-wrap: wrap;
gap: 6px;
gap: var(--space-1-5);
padding: 8px;
border-top: 1px solid var(--border);
}
@@ -116,7 +116,7 @@
.facts {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
margin-top: 2px;
color: var(--fg-muted);
@@ -143,12 +143,12 @@
.actions {
display: flex;
flex: none;
gap: 6px;
gap: var(--space-1-5);
}
.progress {
display: flex;
flex-direction: column;
gap: 4px;
gap: var(--space-1);
max-width: 360px;
margin: 10px 0 0 34px;
}
@@ -182,7 +182,7 @@
}
.links {
display: flex;
gap: 12px;
gap: var(--space-3);
}
.link {
padding: 0;
@@ -209,7 +209,7 @@
.sectionTitle {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
height: 22px;
margin-bottom: 4px;
color: var(--fg-strong);
@@ -244,7 +244,7 @@
grid-template-columns: minmax(150px, max-content) minmax(0, 1fr);
align-items: center;
column-gap: 10px;
row-gap: 4px;
row-gap: var(--space-1);
min-width: 0;
}
.label {
@@ -278,7 +278,7 @@
display: flex;
flex: 1;
align-items: center;
gap: 4px;
gap: var(--space-1);
min-width: 0;
max-width: 480px;
}
+1 -1
Переглянути файл
@@ -575,7 +575,7 @@ function Details({
{job && (
<div className={styles.progress}>
<ProgressBar value={job.fraction} aria-label={tx`Installing ${agent.name}`} />
<span className={styles.hint}>{job.message}</span>
<span>{job.message}</span>
</div>
)}
{!job && installed && update && <p className={styles.notice}>{tx`${update} is available`}</p>}
+5 -5
Переглянути файл
@@ -18,14 +18,14 @@
min-height: 0;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: 12px;
gap: var(--space-3);
}
.column {
min-height: 0;
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
padding: 10px;
border: 1px solid var(--border-strong);
border-radius: var(--radius-control);
@@ -42,7 +42,7 @@
min-height: 120px;
display: flex;
flex-direction: column;
gap: 4px;
gap: var(--space-1);
overflow: auto;
}
@@ -50,7 +50,7 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: 6px;
gap: var(--space-1-5);
padding: 4px 8px;
background: var(--bg-hover);
border-radius: var(--radius-control);
@@ -65,7 +65,7 @@
.add {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
}
.input {
+1 -1
Переглянути файл
@@ -1,7 +1,7 @@
.body {
display: flex;
flex-direction: column;
gap: 12px;
gap: var(--space-3);
height: 100%;
min-height: 0;
}
+7 -7
Переглянути файл
@@ -31,7 +31,7 @@
.row {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
flex: 1;
}
@@ -105,7 +105,7 @@
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
gap: var(--space-1);
padding: 24px 12px;
color: var(--fg-muted);
}
@@ -154,7 +154,7 @@
.dockedBar {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 2px 8px;
border-bottom: 1px solid var(--border);
}
@@ -215,7 +215,7 @@
padding: 4px 12px 8px;
display: flex;
flex-direction: column;
gap: 4px;
gap: var(--space-1);
}
.external > .row {
flex: none;
@@ -225,7 +225,7 @@
.chooser {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
}
.chooserList {
height: 312px;
@@ -242,14 +242,14 @@
.chooserRow {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
width: 100%;
}
.chooserFooter {
display: flex;
align-items: center;
gap: 12px;
gap: var(--space-3);
}
.chooserFolder {
flex: 0 0 auto;
+12 -12
Переглянути файл
@@ -75,7 +75,7 @@
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
gap: var(--space-2);
border-radius: inherit;
background: color-mix(in srgb, var(--bg-popup) 82%, transparent);
color: var(--fg-strong);
@@ -85,7 +85,7 @@
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
padding: 4px 6px 6px;
cursor: default;
}
@@ -95,13 +95,13 @@
flex-wrap: wrap;
align-items: center;
min-width: 0;
gap: 2px;
gap: var(--space-0-5);
}
.actions {
display: flex;
flex: none;
align-items: center;
gap: 4px;
gap: var(--space-1);
margin-left: auto;
}
/* Attach/reference buttons share the send button's 24px footprint and chrome. */
@@ -135,7 +135,7 @@
display: grid;
grid-template-columns: minmax(0, 80px) minmax(0, 1fr);
align-items: center;
gap: 12px;
gap: var(--space-3);
margin-top: 8px;
}
.settingsLabel {
@@ -147,7 +147,7 @@
.chip {
display: inline-flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
height: var(--h-control);
min-width: 0;
padding: 0 4px 0 6px;
@@ -229,7 +229,7 @@
display: flex;
align-items: baseline;
justify-content: space-between;
gap: 12px;
gap: var(--space-3);
}
.effortValue {
color: var(--fg-strong);
@@ -295,7 +295,7 @@
.modeOption {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
height: 24px;
margin: 0 6px;
padding: 0 8px;
@@ -318,7 +318,7 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
gap: var(--space-3);
margin-top: 6px;
padding: 8px 14px 2px;
border-top: 1px solid var(--border);
@@ -329,7 +329,7 @@
.bar {
flex-direction: row;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
}
.toolbar {
flex-wrap: nowrap;
@@ -392,7 +392,7 @@
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 8px 10px 0;
cursor: default;
}
@@ -539,7 +539,7 @@
.popupFooter {
display: flex;
flex-wrap: wrap;
gap: 4px 14px;
gap: var(--space-1) 14px;
padding: 5px 12px 6px;
border-top: 1px solid var(--border);
color: var(--fg-subtle);
+183
Переглянути файл
@@ -0,0 +1,183 @@
import { useId, useState } from "react";
import type { AgentForm, AgentFormField, AgentTask } from "@/bindings";
import { Button, Checkbox, Input, Radio, T } from "@/ui";
import type { PermissionEntry } from "./permission";
import { respond } from "./store";
import styles from "./Session.module.css";
/** Each field's answer as the backend reads it: option values, a text, a number, or `true` / `false`. */
type Values = Record<string, string[]>;
const within = (field: AgentFormField, n: number) =>
(field.min == null || n >= field.min) && (field.max == null || n <= field.max);
function isValid(field: AgentFormField, value: string[]) {
const given = value.map((item) => item.trim()).filter(Boolean);
if (!given.length) return !field.required;
switch (field.kind) {
case "number":
case "integer": {
const n = Number(given[0]);
return Number.isFinite(n) && (field.kind === "number" || Number.isInteger(n)) && within(field, n);
}
case "text":
return within(field, given[0]!.length);
case "choices":
return within(field, given.length);
default:
return true;
}
}
/** An agent's open form (ACP elicitation), answered above the composer like a question. */
export function FormCard({ task, entry, form }: { task: AgentTask; entry: PermissionEntry; form: AgentForm }) {
const [values, setValues] = useState<Values>(() =>
Object.fromEntries(
form.fields.map((field) => [
field.name,
field.kind === "boolean" ? [String(field.default?.[0] === "true")] : (field.default ?? []),
]),
),
);
const [busy, setBusy] = useState(false);
const complete = form.fields.every((field) => isValid(field, values[field.name] ?? []));
// `decline` declines the form, nothing cancels it, and the values accept it.
const send = (reply: string | null) => {
setBusy(true);
void respond(task.id, entry.id, reply).finally(() => setBusy(false));
};
return (
<form
className={styles.questionCard}
aria-label={entry.title}
onSubmit={(event) => {
event.preventDefault();
if (complete) send(JSON.stringify(values));
}}
onKeyDown={(event) => {
if (event.key === "Escape") send(null);
}}
>
{/* A one-question form often titles its field with the message; it is shown once, as the field's. */}
{entry.title && !form.fields.some((field) => field.title === entry.title) && (
<p className={styles.formMessage}>{entry.title}</p>
)}
<fieldset className={styles.formFields} disabled={busy}>
{form.fields.map((field) => (
<FormField
key={field.name}
field={field}
value={values[field.name] ?? []}
onChange={(value) => setValues({ ...values, [field.name]: value })}
/>
))}
</fieldset>
<div className={styles.questionActions}>
<Button variant="ghost" disabled={busy} onClick={() => send(null)}>
Cancel
</Button>
<Button disabled={busy} onClick={() => send("decline")}>
Decline
</Button>
<Button type="submit" variant="primary" disabled={busy || !complete}>
Submit
</Button>
</div>
</form>
);
}
function FormField({
field,
value,
onChange,
}: {
field: AgentFormField;
value: string[];
onChange: (value: string[]) => void;
}) {
const id = useId();
const title = (
<>
{field.title}
{field.required && (
<span className={styles.questionTag}>
<T>Required</T>
</span>
)}
</>
);
const description = field.description && <span className={styles.questionDescription}>{field.description}</span>;
const optionLabel = (label: string, about?: string) => (
<span className={styles.questionOptionText}>
<span className={styles.questionLabel}>{label}</span>
{about && <span className={styles.questionDescription}>{about}</span>}
</span>
);
if (field.kind === "boolean") {
return (
<div className={styles.question}>
<div className={styles.questionChoices}>
<Checkbox
className={styles.questionOption}
checked={value[0] === "true"}
label={optionLabel(field.title, field.description)}
onChange={(checked) => onChange([String(checked)])}
/>
</div>
</div>
);
}
if (field.kind === "choice" || field.kind === "choices") {
return (
<fieldset className={styles.question}>
<legend className={styles.questionText}>{title}</legend>
{description}
<div className={styles.questionChoices}>
{(field.options ?? []).map((option) =>
field.kind === "choices" ? (
<Checkbox
key={option.value}
className={styles.questionOption}
checked={value.includes(option.value)}
label={optionLabel(option.label, option.description)}
onChange={(checked) =>
onChange(checked ? [...value, option.value] : value.filter((v) => v !== option.value))
}
/>
) : (
<Radio
key={option.value}
className={styles.questionOption}
name={id}
checked={value[0] === option.value}
label={optionLabel(option.label, option.description)}
onChange={() => onChange([option.value])}
/>
),
)}
</div>
</fieldset>
);
}
const numeric = field.kind !== "text";
return (
<div className={styles.question}>
<label className={styles.questionText} htmlFor={id}>
{title}
</label>
<Input
id={id}
type={numeric ? "number" : "text"}
inputMode={field.kind === "integer" ? "numeric" : numeric ? "decimal" : undefined}
step={field.kind === "integer" ? 1 : numeric ? "any" : undefined}
min={numeric ? (field.min ?? undefined) : undefined}
max={numeric ? (field.max ?? undefined) : undefined}
maxLength={numeric ? undefined : (field.max ?? undefined)}
invalid={value.some((item) => item.trim()) && !isValid(field, value)}
value={value[0] ?? ""}
onChange={(event) => onChange([event.target.value])}
/>
</div>
);
}
+4 -4
Переглянути файл
@@ -15,7 +15,7 @@
width: min(var(--agent-conversation-width), 100%);
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
}
.fitWidth .inner {
width: 100%;
@@ -35,7 +35,7 @@
flex-wrap: wrap;
align-items: center;
/* The chips' own padding spaces them. */
gap: 2px;
gap: var(--space-0-5);
padding: 0 2px;
font-size: var(--fs-small);
}
@@ -66,7 +66,7 @@
padding: 16px 12px 12px;
}
.docked .inner {
gap: 8px;
gap: var(--space-2);
}
.docked .where {
flex-wrap: nowrap;
@@ -95,7 +95,7 @@
.notes {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
height: 0;
}
.docked .notes {
+11 -17
Переглянути файл
@@ -10,13 +10,13 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
gap: var(--space-3);
}
.headerActions {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
}
.title {
@@ -52,7 +52,7 @@
.error {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 6px 8px;
border-radius: var(--radius-control);
background: color-mix(in srgb, var(--danger) 12%, transparent);
@@ -63,7 +63,7 @@
.notice {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 6px 8px;
border-radius: var(--radius-control);
background: var(--accent-soft);
@@ -89,13 +89,13 @@
justify-content: space-between;
min-height: 32px;
padding: 2px 4px;
gap: 8px;
gap: var(--space-2);
}
.sectionToggle {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
flex: 1;
min-width: 0;
padding: 4px 2px;
@@ -143,12 +143,6 @@
padding: 2px 0 6px;
}
.emptySection {
padding: 6px 24px 8px;
color: var(--fg-muted);
font-size: var(--fs-small);
}
.sectionNote {
margin: 0;
padding: 2px 24px 6px;
@@ -161,7 +155,7 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
gap: var(--space-3);
padding: 6px 8px 6px 22px;
border-radius: var(--radius-control);
}
@@ -173,7 +167,7 @@
.rowMain {
display: flex;
flex-direction: column;
gap: 2px;
gap: var(--space-0-5);
min-width: 0;
flex: 1;
}
@@ -197,7 +191,7 @@
.rowActions {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
flex-shrink: 0;
}
@@ -206,7 +200,7 @@
display: grid;
grid-template-columns: max-content minmax(0, 1fr);
align-items: start;
gap: 10px 12px;
gap: 10px var(--space-3);
padding: 12px 16px 4px;
}
@@ -223,7 +217,7 @@
.formControl {
display: flex;
flex-direction: column;
gap: 4px;
gap: var(--space-1);
min-width: 0;
}
+3 -3
Переглянути файл
@@ -2,7 +2,7 @@
.chip {
display: inline-flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
max-width: 100%;
height: 20px;
padding: 0 6px 0 4px;
@@ -126,7 +126,7 @@
.cardHead {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 6px 10px;
}
.cardPath {
@@ -201,7 +201,7 @@
.codeHead {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
height: 26px;
padding: 0 4px 0 8px;
border-bottom: 1px solid var(--border);
+95 -54
Переглянути файл
@@ -91,7 +91,7 @@
flex-wrap: wrap;
/* The changes chip sits above the line; the facts stay on that line's baseline. */
align-items: flex-end;
gap: 2px 6px;
gap: var(--space-0-5) var(--space-1-5);
min-width: 0;
padding: 0 2px;
overflow: hidden;
@@ -104,7 +104,7 @@
flex: 0 1 auto;
max-width: 100%;
align-items: center;
gap: 4px;
gap: var(--space-1);
height: 22px;
min-width: 0;
color: var(--fg-secondary);
@@ -122,7 +122,7 @@
max-width: 100%;
align-items: center;
/* The chips' own padding spaces them. */
gap: 2px;
gap: var(--space-0-5);
min-width: 0;
overflow: hidden;
}
@@ -144,7 +144,7 @@
flex: 1 1 auto;
flex-wrap: wrap;
align-items: center;
gap: 2px 8px;
gap: var(--space-0-5) var(--space-2);
min-width: 0;
}
/* Shrinks before the terminal buttons do: in a narrow docked session the meters clip, not the controls. */
@@ -154,7 +154,7 @@
margin-left: auto;
align-items: center;
height: 22px;
gap: 8px;
gap: var(--space-2);
max-width: 100%;
min-width: 0;
overflow: hidden;
@@ -163,13 +163,13 @@
display: flex;
flex: none;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
}
/* What changed (files, commits) above the meters; both open the Changes pane. */
.statusChips {
display: inline-flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
max-width: 100%;
min-width: 0;
}
@@ -177,7 +177,7 @@
composes: surface from "../../ui/Chip.module.css";
display: inline-flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
max-width: 100%;
min-width: 0;
padding: 0 8px;
@@ -207,6 +207,31 @@
color: var(--fg-subtle);
}
/* The archived-task notice: an editor notification banner above the conversation. */
.banner {
flex: none;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
gap: var(--space-1) var(--space-2);
min-height: 36px;
padding: 9px 12px;
background: var(--bg-feedback-warning);
border-bottom: 1px solid var(--border-feedback-warning);
color: var(--fg-strong);
}
.bannerText {
flex: 1 1 240px;
min-width: 0;
max-height: 33vh;
overflow-y: auto;
white-space: pre-wrap;
overflow-wrap: anywhere;
}
.bannerSpacer {
flex: 1;
}
/* The conversation with its find bar. */
.streamArea {
min-width: 0;
@@ -320,7 +345,7 @@
.messageFooter {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
min-height: var(--h-control-small);
max-width: 100%;
flex-wrap: wrap;
@@ -378,7 +403,7 @@
}
.messageActions {
display: inline-flex;
gap: 4px;
gap: var(--space-1);
max-width: 100%;
flex-wrap: wrap;
opacity: 0;
@@ -442,7 +467,7 @@
flex: none;
display: flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
padding: 4px 8px;
border-bottom: 1px solid var(--border);
}
@@ -498,14 +523,14 @@
.editBar {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
margin-top: 6px;
font-size: var(--fs-small);
}
.editButtons {
display: flex;
gap: 6px;
gap: var(--space-1-5);
margin-left: auto;
}
@@ -735,7 +760,7 @@
.thought summary {
display: flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
min-width: 0;
height: var(--h-row);
color: var(--fg-muted);
@@ -773,7 +798,7 @@
.tool {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
min-width: 0;
box-sizing: border-box;
min-height: var(--h-row);
@@ -828,7 +853,7 @@
.processSummary {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
width: 100%;
max-width: 100%;
box-sizing: border-box;
@@ -876,7 +901,7 @@
.processBody {
display: flex;
flex-direction: column;
gap: 2px;
gap: var(--space-0-5);
max-height: calc(var(--h-row) * 16);
overflow-y: auto;
margin-top: 2px;
@@ -900,7 +925,7 @@
.plan {
display: grid;
gap: 2px;
gap: var(--space-0-5);
}
.planTitle {
font-weight: 600;
@@ -909,7 +934,7 @@
.planItem {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
}
.planDone {
color: var(--fg-muted);
@@ -1017,7 +1042,7 @@
.error {
display: flex;
gap: 6px;
gap: var(--space-1-5);
align-items: flex-start;
color: var(--danger);
white-space: pre-wrap;
@@ -1027,7 +1052,7 @@
.working {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
color: var(--fg-muted);
}
@@ -1049,7 +1074,7 @@
flex: none;
display: flex;
flex-direction: column;
gap: 6px;
gap: var(--space-1-5);
align-self: center;
width: 100%;
max-width: calc(var(--session-content-width) + var(--space-3) * 2);
@@ -1060,12 +1085,12 @@
.background {
display: flex;
flex-direction: column;
gap: 2px;
gap: var(--space-0-5);
}
.backgroundTask {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-height: 24px;
padding: 0 4px 0 8px;
border-radius: var(--radius-row);
@@ -1085,12 +1110,12 @@
.queue {
display: flex;
flex-direction: column;
gap: 2px;
gap: var(--space-0-5);
}
.queued {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-height: 28px;
padding: 0 4px 0 8px;
border-radius: var(--radius-row);
@@ -1145,7 +1170,7 @@
.images {
display: flex;
flex-wrap: wrap;
gap: 6px;
gap: var(--space-1-5);
margin-top: 4px;
}
.imageItem {
@@ -1185,14 +1210,14 @@
.attachments {
display: flex;
flex-wrap: wrap;
gap: 4px 6px;
gap: var(--space-1) var(--space-1-5);
margin-top: 4px;
font-size: var(--fs-small);
}
.attachment {
display: inline-flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
}
.changes {
@@ -1225,7 +1250,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
height: 32px;
flex: none;
padding: 0 6px 0 10px;
@@ -1270,7 +1295,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
}
.changeName {
flex: 0 1 auto;
@@ -1302,7 +1327,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
}
.changeGroupName {
min-width: 0;
@@ -1317,7 +1342,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
}
.changeCommitHash {
flex: none;
@@ -1348,7 +1373,7 @@
.subagent {
display: flex;
flex-direction: column;
gap: 4px;
gap: var(--space-1);
padding: 6px 8px;
border: 1px solid var(--border);
border-radius: var(--radius-small);
@@ -1357,7 +1382,7 @@
.subagentHead {
display: flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
min-width: 0;
}
.subagentOpen {
@@ -1365,7 +1390,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 2px 4px;
margin: -2px -4px;
border: 0;
@@ -1441,7 +1466,7 @@
flex: none;
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
height: 30px;
padding: 0 8px 0 6px;
border-bottom: 1px solid var(--border);
@@ -1452,7 +1477,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
overflow: hidden;
}
.crumb {
@@ -1498,12 +1523,12 @@
.subagentStrip {
display: flex;
flex-wrap: wrap;
gap: 4px;
gap: var(--space-1);
}
.subagentChip {
display: inline-flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
max-width: 240px;
height: 22px;
padding: 0 8px;
@@ -1531,7 +1556,7 @@
flex: none;
display: flex;
flex-direction: column;
gap: 12px;
gap: var(--space-3);
max-height: 50vh;
overflow-y: auto;
/* The composer's width, so the card sits exactly over the box it belongs to. */
@@ -1573,7 +1598,7 @@
.question {
display: flex;
flex-direction: column;
gap: 2px;
gap: var(--space-0-5);
min-width: 0;
margin: 0;
padding: 0;
@@ -1607,7 +1632,7 @@
.questionChoices {
display: flex;
flex-direction: column;
gap: 6px;
gap: var(--space-1-5);
}
.question .questionChoices > * {
border: 1px solid var(--border);
@@ -1633,7 +1658,7 @@
.questionChoice {
display: flex;
align-items: flex-start;
gap: 8px;
gap: var(--space-2);
}
.questionOptionText {
display: flex;
@@ -1663,19 +1688,19 @@
.questionBody {
display: flex;
flex-direction: column;
gap: 6px;
gap: var(--space-1-5);
}
.questionChoices {
display: flex;
flex-direction: column;
gap: 2px;
gap: var(--space-0-5);
min-width: 0;
}
@container question-card (min-width: 640px) {
.questionBodyWithPreview {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
gap: 12px;
gap: var(--space-3);
align-items: start;
}
.questionBodyWithPreview .questionPreview {
@@ -1691,7 +1716,7 @@
display: flex;
flex-direction: column;
grid-area: 1 / 1;
gap: 4px;
gap: var(--space-1);
min-width: 0;
visibility: hidden;
}
@@ -1724,12 +1749,12 @@
flex-wrap: wrap;
align-items: center;
justify-content: flex-end;
gap: 8px;
gap: var(--space-2);
}
.questionPager {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
}
.questionPage {
color: var(--fg-subtle);
@@ -1737,6 +1762,22 @@
font-variant-numeric: tabular-nums;
white-space: nowrap;
}
/* An agent's form (ACP elicitation): its message, then every field at once, in the question card. */
.formMessage {
margin: 0;
color: var(--fg-strong);
white-space: pre-wrap;
overflow-wrap: anywhere;
}
.formFields {
display: flex;
flex-direction: column;
gap: var(--space-3);
min-width: 0;
margin: 0;
padding: 0;
border: 0;
}
/* Reasoning while it streams (auto): bounded, its tail in view. */
.thoughtLive .thoughtBody {
@@ -1771,7 +1812,7 @@
.tray {
display: flex;
flex-direction: column;
gap: 2px;
gap: var(--space-0-5);
}
.tray:empty {
display: none;
@@ -1783,12 +1824,12 @@
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 4px;
gap: var(--space-1);
}
.trayChip {
display: inline-flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
height: var(--h-row);
padding: 0 var(--space-2);
border: none;
@@ -1807,7 +1848,7 @@
.trayPlan {
display: flex;
flex-direction: column;
gap: 2px;
gap: var(--space-0-5);
padding: 2px var(--space-2) 4px calc(var(--space-2) * 2);
font-size: var(--fs-small);
}
+8 -9
Переглянути файл
@@ -97,7 +97,9 @@ import {
type Activity,
} from "./workingStatus";
import { AgentReply, MessageActions, ReplyActions } from "./AgentReply";
import { FormCard } from "./FormCard";
import {
asksInCard,
commandPrefix,
permissionDetails,
permissionOption,
@@ -2305,9 +2307,7 @@ function PermissionLine({ task, entry }: { task: AgentTask; entry: PermissionEnt
) : (
<span className={styles.permissionDetail}>{shortTitle(task, detail)}</span>
)}
{!entry.questions?.length && (
<PermissionAnswers task={task} entry={entry} className={styles.permissionAnswers} />
)}
{!asksInCard(entry) && <PermissionAnswers task={task} entry={entry} className={styles.permissionAnswers} />}
</>
)}
</div>
@@ -2332,12 +2332,13 @@ const isRecommended = (label: string) => label.endsWith(RECOMMENDED_SUFFIX);
const plainLabel = (label: string) => (isRecommended(label) ? label.slice(0, -RECOMMENDED_SUFFIX.length) : label);
/** An open `AskUserQuestion` request, as a card above the composer; one question at a time. */
/** An open `AskUserQuestion` request or agent form, as a card above the composer; one question at a time. */
function QuestionCard({ task, entries }: { task: AgentTask; entries: AgentEntry[] | null }) {
const entry = entries?.find(
(candidate): candidate is PermissionEntry =>
candidate.type === "permission" && !candidate.chosen && !!candidate.questions?.length,
candidate.type === "permission" && !candidate.chosen && asksInCard(candidate),
);
if (entry?.form) return <FormCard key={entry.id} task={task} entry={entry} form={entry.form} />;
return entry?.questions ? (
<QuestionForm key={entry.id} task={task} entry={entry} questions={entry.questions} />
) : null;
@@ -2629,9 +2630,7 @@ function QuestionForm({
*/
function Tray({ task, entries, children }: { task: AgentTask; entries: AgentEntry[] | null; children: ReactNode }) {
const tx = useTx();
const pending = entries?.find(
(e): e is PermissionEntry => e.type === "permission" && !e.chosen && !e.questions?.length,
);
const pending = entries?.find((e): e is PermissionEntry => e.type === "permission" && !e.chosen && !asksInCard(e));
const plan = entries?.findLast((e): e is Extract<AgentEntry, { type: "plan" }> => e.type === "plan");
const [planOpen, setPlanOpen] = useState(false);
const done = plan?.items.filter((i) => i.status === "completed").length ?? 0;
@@ -2705,7 +2704,7 @@ function WorkingRow({
);
}
if (task.status !== "running" && task.status !== "starting") return null;
if (entries?.some((e) => e.type === "permission" && !e.chosen && !e.questions?.length)) return null;
if (entries?.some((e) => e.type === "permission" && !e.chosen && !asksInCard(e))) return null;
const userAt = entries?.findLastIndex((e) => e.type === "user") ?? -1;
const lastUser = userAt >= 0 ? (entries![userAt] as UserEntry) : undefined;
return (
+5 -5
Переглянути файл
@@ -16,13 +16,13 @@
.activity {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
}
.after {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
}
.seconds {
@@ -35,7 +35,7 @@
min-height: 120px;
display: flex;
flex-direction: column;
gap: 4px;
gap: var(--space-1);
padding: 8px;
overflow: auto;
border: 1px solid var(--border-strong);
@@ -46,7 +46,7 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: 6px;
gap: var(--space-1-5);
padding: 4px 8px;
background: var(--bg-hover);
border-radius: var(--radius-control);
@@ -64,7 +64,7 @@
.add {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
}
.input {
+3
Переглянути файл
@@ -3,6 +3,9 @@ import { tx } from "@/platform/i18n";
export type PermissionEntry = Extract<AgentEntry, { type: "permission" }>;
/** Questions and forms are answered in a card above the composer, not with the request's options. */
export const asksInCard = (entry: PermissionEntry) => !!entry.questions?.length || !!entry.form;
export function permissionDetails(entry: PermissionEntry, provider = "Codex") {
// The backend names the command from the request's structured input; the title is the
// agent's own words and never makes a request a command.
+62
Переглянути файл
@@ -1460,6 +1460,68 @@ describe("a pending AskUserQuestion", () => {
});
});
describe("a pending agent form", () => {
const form = {
type: "permission" as const,
id: 12,
title: "How should I refactor?",
chosen: null,
options: [{ id: "decline", name: "Decline", kind: "reject_once" }],
form: {
fields: [
{
name: "strategy",
title: "Strategy",
required: true,
kind: "choice" as const,
options: [
{ value: "safe", label: "Conservative", description: "Small steps" },
{ value: "bold", label: "Aggressive" },
],
},
{ name: "count", title: "Files", kind: "integer" as const, min: 1, max: 5 },
{ name: "tests", title: "Run tests", kind: "boolean" as const },
],
},
};
const open = async () => {
backend.entries.set("A", [form]);
backend.answers = [];
useAgents.setState({ entries: new Map(backend.entries) });
render(<SessionEditor input={input("A")} />);
return screen.findByRole("form", { name: "How should I refactor?" });
};
it("sends the values once every required field is valid", async () => {
const card = await open();
const submit = within(card).getByRole("button", { name: "Submit" });
expect(submit).toHaveProperty("disabled", true);
fireEvent.click(within(card).getByRole("radio", { name: /^Aggressive/ }));
expect(submit).toHaveProperty("disabled", false);
const files = within(card).getByRole("spinbutton", { name: /^Files/ });
fireEvent.change(files, { target: { value: "9" } });
expect(submit).toHaveProperty("disabled", true);
fireEvent.change(files, { target: { value: "3" } });
fireEvent.click(within(card).getByRole("checkbox", { name: /^Run tests/ }));
fireEvent.click(submit);
await waitFor(() =>
expect(backend.answers).toEqual([
["A", 12, JSON.stringify({ strategy: ["bold"], count: ["3"], tests: ["true"] })],
]),
);
});
it("declines with Decline and cancels with Escape", async () => {
const card = await open();
fireEvent.click(within(card).getByRole("button", { name: "Decline" }));
await waitFor(() => expect(backend.answers).toEqual([["A", 12, "decline"]]));
backend.answers = [];
fireEvent.keyDown(within(card).getByRole("radio", { name: /^Conservative/ }), { key: "Escape" });
await waitFor(() => expect(backend.answers).toEqual([["A", 12, null]]));
});
});
describe("a pending permission request above the composer", () => {
const command = 'python3 -c \'from pathlib import Path\np = Path("note.txt")\np.write_text("one\\ntwo")\'';
const options = [
+12 -12
Переглянути файл
@@ -18,7 +18,7 @@
flex: none;
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
height: var(--h-row);
padding: 0 10px;
border-bottom: 1px solid var(--border);
@@ -39,7 +39,7 @@
.row {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
flex: 1;
white-space: nowrap;
@@ -115,7 +115,7 @@
flex: none;
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
width: 100%;
height: var(--h-row);
padding: 0 8px;
@@ -163,7 +163,7 @@
.scope {
display: flex;
flex-direction: column;
gap: 2px;
gap: var(--space-0-5);
margin: 0;
padding: 0;
border: 0;
@@ -176,7 +176,7 @@
.radioRow {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
padding: 3px 0;
color: var(--fg);
cursor: default;
@@ -187,7 +187,7 @@
}
.dirRow {
display: flex;
gap: 6px;
gap: var(--space-1-5);
padding: 4px 0 0 22px;
}
.grow {
@@ -197,7 +197,7 @@
.fieldRow {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
}
.languageSelect {
min-width: 180px;
@@ -245,7 +245,7 @@
.previewItem {
display: flex;
align-items: flex-start;
gap: 8px;
gap: var(--space-2);
padding: 4px 8px;
border-bottom: 1px solid var(--border);
}
@@ -257,7 +257,7 @@
flex: 1;
display: flex;
flex-direction: column;
gap: 2px;
gap: var(--space-0-5);
}
.previewWhere {
color: var(--fg-subtle);
@@ -298,7 +298,7 @@
.details {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
padding: 10px 12px;
overflow: auto;
border-left: 1px solid var(--border);
@@ -312,7 +312,7 @@
.detailsTitle {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
color: var(--fg-strong);
}
.detailsMessage {
@@ -322,5 +322,5 @@
}
.detailsActions {
display: flex;
gap: 6px;
gap: var(--space-1-5);
}
+3 -3
Переглянути файл
@@ -1,19 +1,19 @@
.body {
display: flex;
flex-direction: column;
gap: 16px;
gap: var(--space-4);
padding: 20px;
}
.field {
display: grid;
grid-template-columns: 80px 1fr;
align-items: center;
gap: 12px;
gap: var(--space-3);
}
.row {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
min-width: 0;
}
.row > input {
+9 -9
Переглянути файл
@@ -14,7 +14,7 @@
min-width: 0;
display: flex;
flex-direction: column;
gap: 2px;
gap: var(--space-0-5);
line-height: 1.55;
}
.productName {
@@ -37,7 +37,7 @@
}
.fact {
display: flex;
gap: 4px;
gap: var(--space-1);
min-width: 0;
}
.fact dt {
@@ -57,7 +57,7 @@
.links {
display: flex;
flex-wrap: wrap;
gap: 4px 16px;
gap: var(--space-1) var(--space-4);
}
.link {
padding: 0;
@@ -94,7 +94,7 @@
.keymapBar {
display: flex;
align-items: center;
gap: 12px;
gap: var(--space-3);
padding: 8px 12px;
border-bottom: 1px solid var(--border-popup);
}
@@ -139,7 +139,7 @@
.keymapRow {
display: flex;
align-items: center;
gap: 12px;
gap: var(--space-3);
min-height: var(--h-row);
padding: 0 4px;
border-radius: var(--radius-row);
@@ -157,13 +157,13 @@
.keymapKeys {
flex: none;
display: flex;
gap: 4px;
gap: var(--space-1);
}
.invalidateBody {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
padding: 14px;
color: var(--fg);
font-size: var(--fs-ui);
@@ -185,13 +185,13 @@
.importSummary {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
}
.importList {
margin: 0;
display: grid;
grid-template-columns: max-content 1fr;
gap: 2px 16px;
gap: var(--space-0-5) var(--space-4);
}
.importList dt {
color: var(--fg-muted);
+7 -7
Переглянути файл
@@ -31,7 +31,7 @@
.entry {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
width: 100%;
height: 26px;
padding: 0 8px;
@@ -68,7 +68,7 @@
display: grid;
grid-template-columns: max-content minmax(0, 1fr);
align-items: center;
gap: 8px 12px;
gap: var(--space-2) var(--space-3);
}
.label {
color: var(--fg);
@@ -76,7 +76,7 @@
}
.inline {
display: flex;
gap: 8px;
gap: var(--space-2);
}
.inline > :first-child {
flex: 1;
@@ -103,7 +103,7 @@
.missing {
display: flex;
align-items: flex-start;
gap: 8px;
gap: var(--space-2);
padding: 8px 10px;
border: 1px solid var(--border-feedback-warning);
border-radius: var(--radius-control, 4px);
@@ -136,17 +136,17 @@
.dependencies {
display: flex;
flex-direction: column;
gap: 6px;
gap: var(--space-1-5);
}
.chips {
display: flex;
flex-wrap: wrap;
gap: 4px;
gap: var(--space-1);
}
.chip {
display: inline-flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
height: 22px;
padding: 0 6px 0 8px;
border: 1px solid var(--border);
+8 -8
Переглянути файл
@@ -9,7 +9,7 @@
flex: none;
display: flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
padding: 0 6px;
}
.sep {
@@ -22,7 +22,7 @@
flex: none;
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-height: 28px;
padding: 2px 10px;
font-size: var(--fs-small);
@@ -57,14 +57,14 @@
.loading {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
padding: 12px;
color: var(--fg-muted);
}
.row {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
flex: 1;
white-space: nowrap;
@@ -110,7 +110,7 @@
.popupHeader {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
height: var(--h-row);
padding: 4px 10px 0;
font-size: var(--fs-small);
@@ -124,7 +124,7 @@
.inputRow {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 6px 10px;
border-bottom: 1px solid var(--border-popup);
}
@@ -164,7 +164,7 @@
.completion {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
min-width: 0;
flex: 1;
}
@@ -196,7 +196,7 @@
.popupFooter {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
padding: 6px 10px;
border-top: 1px solid var(--border-popup);
font-size: var(--fs-small);
+7 -7
Переглянути файл
@@ -10,7 +10,7 @@
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 6px;
gap: var(--space-1-5);
min-height: 36px;
padding: 4px 8px;
border-bottom: 1px solid var(--border);
@@ -37,7 +37,7 @@
flex: none;
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-height: 28px;
padding: 2px 10px;
font-size: var(--fs-small);
@@ -74,7 +74,7 @@
.row {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
flex: 1;
white-space: nowrap;
@@ -124,7 +124,7 @@
flex: none;
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-height: 32px;
padding: 0 10px;
border-bottom: 1px solid var(--border);
@@ -142,7 +142,7 @@
flex: none;
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 6px 10px;
font-size: var(--fs-small);
color: var(--fg-secondary);
@@ -162,7 +162,7 @@
.usageHeader {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-height: 26px;
}
.usageVersion {
@@ -190,7 +190,7 @@
.step {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-height: 22px;
white-space: nowrap;
}
+1 -1
Переглянути файл
@@ -22,7 +22,7 @@
.row {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
flex: 1;
white-space: nowrap;
+2 -2
Переглянути файл
@@ -14,7 +14,7 @@
flex: none;
display: flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
padding: 0 6px;
}
.sep {
@@ -43,7 +43,7 @@
.row {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
flex: 1;
white-space: nowrap;
+1 -1
Переглянути файл
@@ -29,7 +29,7 @@
.row {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
flex: 1;
white-space: nowrap;
+1 -1
Переглянути файл
@@ -50,7 +50,7 @@
.line {
display: flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
min-height: 24px;
}
.name {
+1 -1
Переглянути файл
@@ -1,7 +1,7 @@
.toolbar {
display: flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
padding: 3px 6px;
flex-shrink: 0;
}
+2 -2
Переглянути файл
@@ -9,7 +9,7 @@
flex: none;
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
padding: 0 10px;
border-bottom: 1px solid var(--border-popup);
font-size: var(--fs-small);
@@ -62,7 +62,7 @@
.row {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
min-width: 0;
width: 100%;
}
+3 -3
Переглянути файл
@@ -14,7 +14,7 @@
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
padding: 4px 0;
border-right: 1px solid var(--border);
}
@@ -29,7 +29,7 @@
flex: none;
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 0 10px;
font-size: var(--fs-ui);
color: var(--fg-subtle);
@@ -72,7 +72,7 @@
.row {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
flex: 1;
white-space: nowrap;
+3 -3
Переглянути файл
@@ -46,7 +46,7 @@
bottom: 0;
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
width: 104px;
height: 54px;
padding: 0 10px;
@@ -79,7 +79,7 @@
min-width: 0;
display: flex;
flex-direction: column;
gap: 4px;
gap: var(--space-1);
color: var(--fg-muted);
font-size: var(--fs-small);
text-align: center;
@@ -111,7 +111,7 @@
.recent {
display: grid;
grid-template-columns: repeat(10, minmax(0, 1fr));
gap: 8px 5px;
gap: var(--space-2) 5px;
margin: 12px 12px 0;
padding-top: 10px;
border-top: 1px solid var(--border);
+6 -6
Переглянути файл
@@ -20,7 +20,7 @@
display: grid;
grid-template-columns: minmax(120px, 1fr) 170px 170px;
align-items: center;
column-gap: 8px;
column-gap: var(--space-2);
}
.header.noBranches,
.row.noBranches {
@@ -35,7 +35,7 @@
.headerCell {
display: inline-flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
min-width: 0;
padding: 0;
border: 0;
@@ -62,7 +62,7 @@
.name {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
}
.icon {
@@ -75,7 +75,7 @@
.cell {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
}
.bar {
@@ -112,7 +112,7 @@
display: flex;
flex-direction: column;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
}
/* Manage Coverage Reports */
@@ -126,7 +126,7 @@
.reportRow {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
flex: 1;
white-space: nowrap;
+46 -46
Переглянути файл
@@ -31,7 +31,7 @@
position: relative;
display: flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
padding: 0 6px;
border-right: 1px solid var(--border);
overflow: hidden;
@@ -139,7 +139,7 @@
.toolbar {
display: flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
height: var(--h-header);
padding: 0 6px;
flex: none;
@@ -237,7 +237,7 @@
flex: none;
display: flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
padding: 0 6px;
}
.dbToolbarSep {
@@ -259,7 +259,7 @@
.nodeRow {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
}
/* The whole tree row, indent included, so a coloured source and its children form one band. */
@@ -307,7 +307,7 @@
.consoleBar {
display: flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
height: var(--h-header);
padding: 0 8px;
background: var(--bg-editor);
@@ -338,7 +338,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 0 8px;
color: var(--fg-muted);
}
@@ -352,7 +352,7 @@
.pager {
display: flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
color: var(--fg-secondary);
font-size: var(--fs-small);
white-space: nowrap;
@@ -370,7 +370,7 @@
display: grid;
grid-template-columns: fit-content(40%) minmax(0, 1fr);
align-items: center;
gap: 8px 12px;
gap: var(--space-2) var(--space-3);
min-width: 0;
padding: 14px;
overflow-wrap: anywhere;
@@ -397,7 +397,7 @@
}
.formRow {
display: flex;
gap: 8px;
gap: var(--space-2);
align-items: center;
}
.formRow[hidden],
@@ -409,7 +409,7 @@
grid-column: 1 / -1;
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
color: var(--fg-strong);
}
.formSection::after {
@@ -490,7 +490,7 @@
.colorValue {
display: inline-flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
}
.colorSwatch {
width: 12px;
@@ -500,12 +500,12 @@
.namePicker {
display: flex;
flex-direction: column;
gap: 6px;
gap: var(--space-1-5);
}
.nameList {
display: flex;
flex-direction: column;
gap: 4px;
gap: var(--space-1);
max-height: 180px;
overflow: auto;
padding-left: 22px;
@@ -513,14 +513,14 @@
.propertyTable {
display: flex;
flex-direction: column;
gap: 4px;
gap: var(--space-1);
}
.propertyHead,
.propertyRow {
display: grid;
grid-template-columns: 1fr 1fr 24px;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
}
.propertyHead {
color: var(--fg-secondary);
@@ -620,7 +620,7 @@
:global(.cm-openidea-db-banner) {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
min-height: 28px;
padding: 0 6px 0 10px;
background: color-mix(in srgb, var(--danger) 10%, var(--bg-editor));
@@ -682,7 +682,7 @@
.previewBlock {
display: flex;
flex-direction: column;
gap: 4px;
gap: var(--space-1);
min-width: 0;
}
.previewTitle {
@@ -734,7 +734,7 @@
}
.modifyToolbar {
display: flex;
gap: 2px;
gap: var(--space-0-5);
padding: 2px 4px;
border-bottom: 1px solid var(--border);
}
@@ -746,7 +746,7 @@
.modifyItem {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
height: 24px;
padding: 0 8px;
cursor: default;
@@ -767,7 +767,7 @@
grid-template-columns: max-content 1fr;
align-content: start;
align-items: center;
gap: 8px 12px;
gap: var(--space-2) var(--space-3);
padding: 12px;
overflow: auto;
}
@@ -777,17 +777,17 @@
padding: 10px 12px;
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
}
.quickDocRows {
margin: 0;
display: flex;
flex-direction: column;
gap: 2px;
gap: var(--space-0-5);
}
.quickDocRows > div {
display: flex;
gap: 6px;
gap: var(--space-1-5);
}
.quickDocRows dt {
font-weight: 600;
@@ -837,7 +837,7 @@
right: 12px;
bottom: 12px;
display: flex;
gap: 8px;
gap: var(--space-2);
align-items: center;
padding: 3px 10px;
border: 1px solid var(--border);
@@ -859,7 +859,7 @@
.columnsPopup {
display: flex;
flex-direction: column;
gap: 6px;
gap: var(--space-1-5);
width: 320px;
padding: 8px;
}
@@ -870,14 +870,14 @@
display: flex;
flex: 1;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
white-space: nowrap;
}
.filterPopup {
display: flex;
flex-direction: column;
gap: 6px;
gap: var(--space-1-5);
width: 280px;
padding: 8px;
}
@@ -888,7 +888,7 @@
.filterValue {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-height: var(--h-row);
}
.filterValue > :first-child {
@@ -910,7 +910,7 @@
.filterButtons {
display: flex;
flex-wrap: wrap;
gap: 6px;
gap: var(--space-1-5);
}
.sidePanel {
flex: none;
@@ -934,24 +934,24 @@
.recordFields {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
padding: 8px;
}
.recordField {
display: flex;
flex-direction: column;
gap: 4px;
gap: var(--space-1);
}
.recordLabel {
display: flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
color: var(--fg-secondary);
}
.valueView {
display: flex;
flex-direction: column;
gap: 6px;
gap: var(--space-1-5);
height: 100%;
padding: 8px;
box-sizing: border-box;
@@ -998,7 +998,7 @@
flex-direction: column;
flex: 1;
min-height: 0;
gap: 6px;
gap: var(--space-1-5);
overflow: hidden;
}
.valueWindowBody .valueEditor {
@@ -1040,7 +1040,7 @@
.chartBar {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
height: var(--h-header);
padding: 0 8px;
flex: none;
@@ -1102,7 +1102,7 @@
.planRow {
display: grid;
grid-template-columns: minmax(160px, 1fr) 1fr;
gap: 12px;
gap: var(--space-3);
width: 100%;
}
.planHeader {
@@ -1113,7 +1113,7 @@
.planOperation {
display: flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
overflow: hidden;
text-overflow: ellipsis;
}
@@ -1144,14 +1144,14 @@
/* Export / history / import dialogs. */
.exportDialog {
display: flex;
gap: 16px;
gap: var(--space-4);
height: 420px;
padding: 14px;
}
.exportOptions {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
width: 300px;
flex: none;
}
@@ -1164,7 +1164,7 @@
min-width: 0;
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
}
.exportPreviewText,
.historyPreview {
@@ -1206,21 +1206,21 @@
}
.historyDialog {
display: flex;
gap: 12px;
gap: var(--space-3);
height: 440px;
padding: 14px;
}
.historyList {
display: flex;
flex-direction: column;
gap: 6px;
gap: var(--space-1-5);
width: 300px;
flex: none;
min-height: 0;
}
.historyItem {
display: flex;
gap: 8px;
gap: var(--space-2);
align-items: baseline;
width: 100%;
min-width: 0;
@@ -1263,7 +1263,7 @@
}
.sqlCompletionOption {
display: flex;
gap: 12px;
gap: var(--space-3);
align-items: center;
width: 100%;
padding: 4px 8px;
@@ -1346,7 +1346,7 @@
flex: none;
display: flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
padding: 4px 8px;
background: var(--bg-elev);
border-bottom: 1px solid var(--border);
@@ -1382,7 +1382,7 @@
transform: translateX(-50%);
display: flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
padding: 2px 4px;
border: 1px solid var(--border-popup, var(--border));
border-radius: var(--radius-small);
+2 -1
Переглянути файл
@@ -149,7 +149,8 @@ export function DatabaseView() {
if (!st.treeReveal) return;
const path = st.treeReveal.path;
const frame = requestAnimationFrame(() => {
path.toReversed().some((key) => tree.current?.reveal(key));
// Spread + reverse instead of toReversed(), which needs Safari 16.4 (the floor is 15.4).
[...path].reverse().some((key) => tree.current?.reveal(key));
tree.current?.focus();
});
return () => cancelAnimationFrame(frame);
+10 -10
Переглянути файл
@@ -16,7 +16,7 @@
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 8px 16px;
gap: var(--space-2) var(--space-4);
padding: 8px 12px;
border-bottom: 1px solid var(--border);
}
@@ -25,14 +25,14 @@
min-width: 0;
display: flex;
flex-direction: column;
gap: 2px;
gap: var(--space-0-5);
}
.title,
.totals {
display: flex;
flex-wrap: wrap;
align-items: baseline;
column-gap: 12px;
column-gap: var(--space-3);
min-width: 0;
}
.label {
@@ -56,7 +56,7 @@
flex: none;
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
}
.compare {
width: 200px;
@@ -126,7 +126,7 @@
flex: none;
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
padding: 4px 8px;
border-bottom: 1px solid var(--border);
}
@@ -138,7 +138,7 @@
.note {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 8px 12px;
color: var(--fg-subtle);
}
@@ -177,7 +177,7 @@
display: grid;
grid-template-columns: var(--heap-columns);
align-items: center;
column-gap: 12px;
column-gap: var(--space-3);
width: 100%;
}
.head {
@@ -252,7 +252,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: 12px;
gap: var(--space-3);
}
.treeRow > :first-child {
flex: 1;
@@ -274,7 +274,7 @@
.object {
display: inline-flex;
align-items: baseline;
gap: 8px;
gap: var(--space-2);
min-width: 0;
max-width: 100%;
overflow: hidden;
@@ -336,5 +336,5 @@
.openProgress {
display: flex;
flex-direction: column;
gap: 6px;
gap: var(--space-1-5);
}
+4 -4
Переглянути файл
@@ -6,7 +6,7 @@
padding: 6px 12px 8px;
display: flex;
flex-direction: column;
gap: 2px;
gap: var(--space-0-5);
}
.title {
@@ -31,13 +31,13 @@
.groups {
display: flex;
flex-wrap: wrap;
gap: 4px 20px;
gap: var(--space-1) 20px;
}
.group {
display: flex;
flex-direction: column;
gap: 2px;
gap: var(--space-0-5);
}
.groupTitle {
@@ -49,6 +49,6 @@
.row {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-height: 22px;
}
+5 -5
Переглянути файл
@@ -9,7 +9,7 @@
.toolbar {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 4px 8px;
border-bottom: 1px solid var(--border);
}
@@ -23,7 +23,7 @@
.categories {
display: flex;
flex: none;
gap: 2px;
gap: var(--space-0-5);
}
.category {
@@ -49,7 +49,7 @@
.actions {
display: flex;
gap: 4px;
gap: var(--space-1);
padding-top: 6px;
}
@@ -78,7 +78,7 @@
.row {
display: grid;
grid-template-columns: minmax(120px, 3fr) minmax(60px, 1.4fr) 64px 88px 76px 76px;
gap: 8px;
gap: var(--space-2);
padding: 0 8px;
align-items: center;
min-height: 22px;
@@ -159,7 +159,7 @@
.header {
display: flex;
gap: 8px;
gap: var(--space-2);
font-family: var(--font-mono);
font-size: var(--fs-small);
user-select: text;
+3 -3
Переглянути файл
@@ -36,7 +36,7 @@
.item {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-height: 24px;
padding: 0 8px 0 12px;
}
@@ -76,7 +76,7 @@
min-width: 0;
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
padding: 10px 12px;
}
@@ -126,7 +126,7 @@
.actions {
display: flex;
gap: 8px;
gap: var(--space-2);
}
.note {
+3 -3
Переглянути файл
@@ -12,7 +12,7 @@
flex: none;
display: flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
height: var(--h-row);
padding: 0 4px 0 12px;
border-bottom: 1px solid var(--border);
@@ -35,7 +35,7 @@
flex: none;
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
padding: 4px 12px;
font-size: var(--fs-ui);
}
@@ -95,7 +95,7 @@
}
.message {
gap: 8px;
gap: var(--space-2);
color: var(--fg-subtle);
}
+6 -6
Переглянути файл
@@ -12,7 +12,7 @@
flex: none;
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
padding: 4px 8px;
border-bottom: 1px solid var(--border);
}
@@ -52,7 +52,7 @@
flex: none;
display: flex;
align-items: center;
gap: 12px;
gap: var(--space-3);
padding-block: 4px;
border-bottom: 1px solid var(--border);
}
@@ -85,7 +85,7 @@
display: grid;
grid-template-columns: var(--memory-columns);
align-items: center;
column-gap: 12px;
column-gap: var(--space-3);
width: 100%;
}
@@ -106,7 +106,7 @@
flex: 1;
display: flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
min-width: 0;
height: 100%;
padding: 0;
@@ -161,7 +161,7 @@
.className {
display: flex;
align-items: baseline;
gap: 8px;
gap: var(--space-2);
min-width: 0;
font-family: var(--font-mono);
}
@@ -223,7 +223,7 @@
display: flex;
flex-wrap: wrap;
align-items: baseline;
column-gap: 12px;
column-gap: var(--space-3);
padding: 4px 12px;
border-top: 1px solid var(--border);
color: var(--fg-muted);
+6 -6
Переглянути файл
@@ -23,7 +23,7 @@
flex: none;
display: flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
padding: 0 8px 0 4px;
border-bottom: 1px solid var(--border);
min-width: 0;
@@ -47,7 +47,7 @@
.tabs {
display: flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
flex: none;
}
@@ -112,7 +112,7 @@
flex: none;
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 0 8px;
border-radius: var(--radius-small);
text-align: left;
@@ -180,7 +180,7 @@
flex: none;
display: flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
padding: 0 4px 0 12px;
border-bottom: 1px solid var(--border);
}
@@ -190,7 +190,7 @@
flex: none;
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
}
.prompt {
@@ -231,7 +231,7 @@
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
padding: 4px 0;
border-right: 1px solid var(--border);
}
+1 -1
Переглянути файл
@@ -11,7 +11,7 @@
.item {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
height: var(--h-list-row);
margin: 0 6px;
padding: 0 8px 0 6px;
+11 -11
Переглянути файл
@@ -12,7 +12,7 @@
.field {
display: flex;
flex-direction: column;
gap: 4px;
gap: var(--space-1);
}
.label {
@@ -26,13 +26,13 @@
padding: 10px 12px;
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
}
.bpTitle {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
color: var(--fg-emphasis);
font-weight: 500;
}
@@ -71,14 +71,14 @@
.bpFooter {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
margin-top: 2px;
}
.link {
display: inline-flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
color: var(--accent);
font-size: var(--fs-ui);
cursor: pointer;
@@ -108,7 +108,7 @@
flex: none;
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 0 8px 0 12px;
border-bottom: 1px solid var(--border-popup);
}
@@ -122,7 +122,7 @@
.chooserRow {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
min-width: 0;
width: 100%;
padding: 0 8px;
@@ -185,7 +185,7 @@
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 4px 8px;
gap: var(--space-1) var(--space-2);
}
/* Grows with the dialog when it is resized. */
@@ -211,7 +211,7 @@
padding: 6px 12px 8px;
display: flex;
flex-direction: column;
gap: 2px;
gap: var(--space-0-5);
}
.exceptionsTitle {
font-size: var(--fs-small);
@@ -226,7 +226,7 @@
.exceptionGroup {
display: flex;
flex-direction: column;
gap: 2px;
gap: var(--space-0-5);
}
.exceptionAdapter {
font-size: var(--fs-small);
@@ -260,7 +260,7 @@
.evalInputRow {
display: flex;
align-items: flex-start;
gap: 4px;
gap: var(--space-1);
}
.evalInput {
flex: 1;
+11 -11
Переглянути файл
@@ -10,7 +10,7 @@
flex: none;
display: flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
padding: 0 6px;
}
.serverSelect {
@@ -42,14 +42,14 @@
display: flex;
flex-direction: column;
align-items: flex-start;
gap: 8px;
gap: var(--space-2);
padding: 10px;
}
.center {
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
gap: var(--space-2);
padding: 16px;
color: var(--fg-subtle);
}
@@ -72,7 +72,7 @@
.report {
display: flex;
flex-direction: column;
gap: 4px;
gap: var(--space-1);
}
.reportErrors {
margin: 0;
@@ -98,7 +98,7 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: 12px;
gap: var(--space-3);
padding: 10px 16px;
flex: none;
}
@@ -111,7 +111,7 @@
.sync {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
height: 100%;
min-height: 0;
padding: 8px 10px 0;
@@ -121,7 +121,7 @@
flex-wrap: wrap;
align-items: center;
flex: none;
gap: 4px;
gap: var(--space-1);
}
.separator {
height: 20px;
@@ -151,7 +151,7 @@
.fileFilter {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
white-space: nowrap;
}
.compareBy select {
@@ -179,7 +179,7 @@
.comparisonRoots > span {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
min-width: 0;
border: 1px solid var(--border);
border-radius: var(--radius-control, 4px);
@@ -244,7 +244,7 @@
.fileName {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
overflow: hidden;
text-overflow: ellipsis;
}
@@ -315,7 +315,7 @@
display: flex;
align-items: flex-start;
flex-direction: column;
gap: 12px;
gap: var(--space-3);
}
/* SSH password prompt */
+3 -3
Переглянути файл
@@ -8,7 +8,7 @@
.header {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
}
.login {
color: var(--fg-strong);
@@ -34,7 +34,7 @@
.row {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
width: 100%;
min-width: 0;
}
@@ -68,7 +68,7 @@
display: flex;
align-items: center;
justify-content: center;
gap: 8px;
gap: var(--space-2);
}
.muted {
color: var(--fg-subtle);
+15 -15
Переглянути файл
@@ -21,7 +21,7 @@
flex-direction: column;
align-items: center;
justify-content: center;
gap: 6px;
gap: var(--space-1-5);
min-height: 0;
padding: 12px;
text-align: center;
@@ -44,7 +44,7 @@
.textLink {
display: inline-flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
min-width: 0;
padding: 0;
border: none;
@@ -73,7 +73,7 @@
display: flex;
flex: none;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
padding: 8px 12px;
}
@@ -97,7 +97,7 @@
display: flex;
flex: none;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 8px 8px 0;
}
.headRepo > :last-child {
@@ -128,7 +128,7 @@
.headRow {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
height: 100%;
padding: 0 8px;
overflow: hidden;
@@ -157,7 +157,7 @@
display: flex;
flex: none;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
max-height: 50%;
padding: 2px 12px 8px;
overflow: auto;
@@ -165,7 +165,7 @@
.commitsHeader {
display: flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
min-height: 28px;
}
.commitsTitle {
@@ -177,12 +177,12 @@
.commitInfo {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
}
.commitTop {
display: flex;
align-items: flex-start;
gap: 8px;
gap: var(--space-2);
}
.commitTop > .textLink {
flex: none;
@@ -213,7 +213,7 @@
.fileRow {
display: inline-flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
min-width: 0;
white-space: nowrap;
}
@@ -297,7 +297,7 @@
.userItem {
display: inline-flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
}
/* Status and the option button */
@@ -312,19 +312,19 @@
.status {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
max-width: 100%;
}
.statusRow {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
min-width: 0;
}
.statusText {
display: inline-flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
min-width: 0;
}
.ellipsis {
@@ -375,7 +375,7 @@
.dialogForm {
display: flex;
flex-direction: column;
gap: 6px;
gap: var(--space-1-5);
}
.dialogLabel {
color: var(--fg);
+18 -18
Переглянути файл
@@ -16,7 +16,7 @@
flex-direction: column;
align-items: center;
justify-content: center;
gap: 6px;
gap: var(--space-1-5);
min-height: 0;
padding: 12px;
color: var(--fg-secondary);
@@ -46,7 +46,7 @@
display: inline-flex;
flex: none;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
align-self: flex-start;
max-width: 100%;
padding: 0;
@@ -74,13 +74,13 @@
display: flex;
flex: none;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
padding: 16px 14px 16px 16px;
}
.titleRow {
display: flex;
align-items: flex-start;
gap: 8px;
gap: var(--space-2);
}
.title {
flex: 1;
@@ -110,7 +110,7 @@
flex: none;
align-items: center;
justify-content: space-between;
gap: 8px;
gap: var(--space-2);
min-width: 0;
padding: 0 14px 4px 16px;
}
@@ -118,13 +118,13 @@
display: flex;
flex: none;
align-items: center;
gap: 4px;
gap: var(--space-1);
padding: 6px 0 5px;
}
.branch {
display: flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
min-width: 0;
padding: 6px 0 5px;
}
@@ -162,7 +162,7 @@
.advertiser {
display: flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
margin-top: 4px;
padding: 5px 10px;
border-top: 1px solid var(--border);
@@ -198,7 +198,7 @@
.commitRow {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
height: 100%;
margin: 0 6px;
padding: 0 8px;
@@ -226,7 +226,7 @@
display: flex;
flex: 1;
flex-direction: column;
gap: 4px;
gap: var(--space-1);
min-width: 0;
}
@@ -235,13 +235,13 @@
display: flex;
flex: none;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
padding: 0 14px 12px 16px;
}
.commitInfoTop {
display: flex;
align-items: flex-start;
gap: 8px;
gap: var(--space-2);
}
.commitInfoTitle {
flex: 1;
@@ -279,7 +279,7 @@
display: flex;
flex: 1;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
white-space: nowrap;
}
@@ -309,7 +309,7 @@
.counter {
display: inline-flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
color: var(--fg-secondary);
}
.readSlot {
@@ -365,7 +365,7 @@
.statusRow {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
min-width: 0;
padding: 5px 0;
}
@@ -404,7 +404,7 @@
.progressText {
display: inline-flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
color: var(--fg-secondary);
}
/* JBOptionButton: the main action and an arrow opening the others. */
@@ -439,7 +439,7 @@
.submitPopup {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
width: var(--submit-width);
min-width: 320px;
height: var(--submit-height);
@@ -477,5 +477,5 @@
display: flex;
flex: none;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
}
+1 -1
Переглянути файл
@@ -29,6 +29,6 @@
.page {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
padding: 4px 0;
}
+5 -5
Переглянути файл
@@ -42,7 +42,7 @@
display: flex;
flex: 1;
align-items: center;
gap: 4px;
gap: var(--space-1);
min-width: 0;
padding: 2px 10px 4px;
margin-bottom: -2px;
@@ -92,7 +92,7 @@
.chipMain {
display: inline-flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
height: 100%;
max-width: 200px;
padding: 0 4px 0 6px;
@@ -170,7 +170,7 @@
.right {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
}
.left {
@@ -211,7 +211,7 @@
display: inline-flex;
flex: none;
align-items: center;
gap: 4px;
gap: var(--space-1);
padding-right: 1px;
color: var(--fg);
font-variant-numeric: tabular-nums;
@@ -259,7 +259,7 @@
.balloonRow {
display: flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
height: 24px;
white-space: nowrap;
}
+1 -1
Переглянути файл
@@ -16,7 +16,7 @@
display: inline-flex;
align-items: center;
justify-content: center;
gap: 4px;
gap: var(--space-1);
height: 22px;
min-width: 22px;
padding: 0 3px;
+3 -3
Переглянути файл
@@ -44,7 +44,7 @@
.commits {
display: flex;
flex-direction: column;
gap: 4px;
gap: var(--space-1);
}
.commit {
display: flex;
@@ -65,7 +65,7 @@
display: flex;
flex-direction: column;
align-items: center;
gap: 4px;
gap: var(--space-1);
max-width: calc(42em + 32px);
padding: 16px 10px;
text-align: center;
@@ -84,7 +84,7 @@
display: inline-flex;
flex-wrap: wrap;
align-items: center;
gap: 4px;
gap: var(--space-1);
}
.composer {
padding: 10px 16px;
+17 -17
Переглянути файл
@@ -31,7 +31,7 @@
display: flex;
flex: 1;
flex-direction: column;
gap: 4px;
gap: var(--space-1);
min-width: 0;
max-width: var(--gh-content-width, 42em);
}
@@ -41,7 +41,7 @@
.header {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
min-height: 20px;
}
.title {
@@ -49,7 +49,7 @@
flex: 1;
flex-wrap: wrap;
align-items: center;
gap: 8px;
gap: var(--space-2);
min-width: 0;
}
.author {
@@ -68,7 +68,7 @@
display: flex;
flex: none;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
margin-left: auto;
}
.tag {
@@ -109,7 +109,7 @@
.status {
display: flex;
gap: 8px;
gap: var(--space-2);
min-width: 0;
}
.status::before {
@@ -149,7 +149,7 @@
display: flex;
flex: 1;
flex-direction: column;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
max-width: var(--gh-content-width, 42em);
}
@@ -182,19 +182,19 @@
flex-wrap: wrap;
align-items: center;
justify-content: flex-end;
gap: 12px;
gap: var(--space-3);
}
.hints {
display: flex;
flex-wrap: wrap;
gap: 12px;
gap: var(--space-3);
min-width: 0;
color: var(--fg-secondary);
font-size: var(--fs-small);
}
.buttons {
display: flex;
gap: 8px;
gap: var(--space-2);
}
.mentions {
max-height: 240px;
@@ -205,7 +205,7 @@
.mention {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 2px 8px;
white-space: nowrap;
cursor: pointer;
@@ -219,12 +219,12 @@
.reactions {
display: flex;
flex-wrap: wrap;
gap: 8px;
gap: var(--space-2);
}
.pill {
display: inline-flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
height: 24px;
padding: 0 8px 0 6px;
border: 1px solid transparent;
@@ -279,7 +279,7 @@
.threadContent {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
}
.preview {
display: -webkit-box;
@@ -300,7 +300,7 @@
.fileHeader {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-height: 28px;
padding: 2px 6px 2px 10px;
}
@@ -364,7 +364,7 @@
.foldedReplies {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
}
.compactFooter {
display: flex;
@@ -393,7 +393,7 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: 8px;
gap: var(--space-2);
padding: 4px 8px;
border-bottom: 1px solid var(--gh-bubble-border);
background: var(--bg-editor);
@@ -418,7 +418,7 @@
.commitPopup {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
width: 450px;
padding: 10px;
}
+4 -59
Переглянути файл
@@ -18,25 +18,11 @@
.listTab {
padding-top: 8px;
}
.column {
display: flex;
flex: 1;
flex-direction: column;
min-height: 0;
}
.grow {
flex: 1;
min-height: 0;
}
.scroll {
height: 100%;
overflow: auto;
}
.loading {
display: flex;
align-items: center;
justify-content: center;
gap: 6px;
gap: var(--space-1-5);
height: 100%;
color: var(--fg-secondary);
}
@@ -50,24 +36,18 @@
.tabs {
min-width: 0;
}
.repoTitle {
overflow: hidden;
color: var(--fg-secondary);
text-overflow: ellipsis;
white-space: nowrap;
}
/* Repository selector (several GitHub remotes) */
.selector {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
padding: 12px;
}
.selectorRow {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
}
.error {
color: var(--danger);
@@ -79,7 +59,7 @@
display: flex;
flex: none;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-height: 26px;
padding: 0 6px 0 10px;
border-bottom: 1px solid var(--border);
@@ -96,38 +76,3 @@
}
/* Placeholder panels */
.plainRow {
display: flex;
flex-direction: column;
justify-content: center;
height: 100%;
padding: 0 13px;
overflow: hidden;
}
.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.secondary {
color: var(--fg-secondary);
font-size: var(--fs-small);
}
.detailsTitle {
color: var(--fg-strong);
font-weight: 600;
}
.buttons {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 6px;
}
.timelineStub {
display: flex;
flex-direction: column;
gap: 8px;
width: 100%;
max-width: 720px;
text-align: left;
}
+5 -10
Переглянути файл
@@ -87,7 +87,7 @@
display: inline-flex;
flex: none;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
max-width: 100%;
color: var(--fg);
white-space: nowrap;
@@ -120,7 +120,7 @@
.chooserRow {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
height: 100%;
padding: 0 8px;
overflow: hidden;
@@ -152,7 +152,7 @@
display: flex;
flex: none;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 4px 10px 6px;
color: var(--fg-secondary);
font-size: var(--fs-small);
@@ -227,7 +227,7 @@
flex-direction: column;
align-items: center;
justify-content: center;
gap: 6px;
gap: var(--space-1-5);
min-height: 0;
padding: 16px;
color: var(--fg-secondary);
@@ -242,14 +242,9 @@
.form {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
padding: 14px;
}
.formRow {
display: flex;
align-items: center;
gap: 10px;
}
.fieldLabel {
color: var(--fg-secondary);
font-size: var(--fs-small);
+6 -9
Переглянути файл
@@ -14,7 +14,7 @@
display: flex;
flex-direction: column;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
padding: 4px 0;
border-right: 1px solid var(--border);
}
@@ -40,7 +40,7 @@
flex: none;
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 0 10px;
font-size: var(--fs-ui);
color: var(--fg-subtle);
@@ -51,7 +51,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding-right: 10px;
white-space: nowrap;
}
@@ -68,9 +68,6 @@
.ok {
color: var(--success);
}
.code {
font-weight: 600;
}
.result {
height: 100%;
display: flex;
@@ -82,7 +79,7 @@
flex: none;
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 0 10px;
white-space: nowrap;
border-bottom: 1px solid var(--border);
@@ -135,7 +132,7 @@
.editorToolbar {
display: flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
height: var(--h-header);
padding: 0 8px;
background: var(--bg-editor);
@@ -272,7 +269,7 @@
.envToolbar {
flex: none;
display: flex;
gap: 2px;
gap: var(--space-0-5);
padding: 2px 4px;
border-bottom: 1px solid var(--border);
}
+5 -5
Переглянути файл
@@ -19,7 +19,7 @@
.toolbar {
display: flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
height: var(--h-header);
padding: 0 8px;
background: var(--bg-editor);
@@ -45,7 +45,7 @@
.entry {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
height: var(--h-list-row);
padding: 0 8px;
border: none;
@@ -66,7 +66,7 @@
.runningRow {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
height: var(--h-list-row);
padding: 0 8px;
color: var(--fg-secondary);
@@ -112,7 +112,7 @@
.statusLine {
display: flex;
align-items: center;
gap: 12px;
gap: var(--space-3);
height: var(--h-header);
padding: 0 8px;
flex: none;
@@ -195,7 +195,7 @@
.pendingLine {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
color: var(--fg-secondary);
}
.pendingRequest {
+2 -2
Переглянути файл
@@ -10,7 +10,7 @@
flex: none;
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 4px 8px;
border-bottom: 1px solid var(--border);
background: var(--bg-elev);
@@ -53,7 +53,7 @@
left: 0;
width: 100%;
display: flex;
gap: 8px;
gap: var(--space-2);
padding: 0 8px;
box-sizing: border-box;
white-space: pre-wrap;
+4 -4
Переглянути файл
@@ -1,5 +1,5 @@
.status {
gap: 6px;
gap: var(--space-1-5);
}
.dot {
width: 8px;
@@ -10,14 +10,14 @@
.edit {
display: grid;
grid-template-columns: 220px 1fr;
gap: 12px;
gap: var(--space-3);
height: 300px;
padding: 14px;
}
.column {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
min-height: 0;
}
.list {
@@ -34,7 +34,7 @@
}
.buttons {
display: flex;
gap: 6px;
gap: var(--space-1-5);
}
.empty {
padding: 6px 8px;
+5 -1
Переглянути файл
@@ -12,7 +12,7 @@ import {
import { defaultKeymap, indentWithTab } from "@codemirror/commands";
import { bracketMatching, indentOnInput, syntaxHighlighting } from "@codemirror/language";
import type { NotebookCellDoc } from "@/bindings";
import { cellEditorExtensions, embeddedEditorExtensions } from "@/editor/api";
import { cellEditorExtensions, embeddedEditorExtensions, externalHistory } from "@/editor/api";
import { openideaTheme } from "@/editor/core/cm/theme";
import { openideaHighlightStyle } from "@/editor/core/cm/highlight";
import { selectionMarks } from "@/editor/core/cm/selectionMarks";
@@ -97,6 +97,10 @@ export function CellEditor({
]),
),
keymap.of([indentWithTab, ...defaultKeymap]),
externalHistory.of({
undo: () => void session.undo().catch((e) => session.report(e)),
redo: () => void session.redo().catch((e) => session.report(e)),
}),
embeddedEditorExtensions(session.path),
language.of([]),
services.current.of(languageServices(type, initialDoc.current)),
+4 -4
Переглянути файл
@@ -42,7 +42,7 @@
.error {
display: flex;
align-items: flex-start;
gap: 12px;
gap: var(--space-3);
padding: 8px 12px;
color: var(--danger, var(--fg));
border-bottom: 1px solid var(--border);
@@ -93,7 +93,7 @@
.cellToolbar {
display: flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
min-height: 28px;
padding: 2px 6px;
background: var(--bg-elev, var(--bg-app));
@@ -202,7 +202,7 @@
.addBar {
display: flex;
justify-content: center;
gap: 8px;
gap: var(--space-2);
flex-wrap: wrap;
padding: 12px 16px 32px;
}
@@ -211,7 +211,7 @@
padding: 5px;
}
.toolbar {
gap: 2px;
gap: var(--space-0-5);
}
.interpreter {
max-width: 180px;
+6 -6
Переглянути файл
@@ -1,5 +1,5 @@
.indicator {
gap: 6px;
gap: var(--space-1-5);
}
.panel {
width: 380px;
@@ -23,7 +23,7 @@
align-items: center;
min-height: var(--h-list-row);
padding: 0 12px;
gap: 8px;
gap: var(--space-2);
}
.label {
color: var(--fg-secondary);
@@ -44,7 +44,7 @@
align-items: center;
min-height: var(--h-list-row);
padding: 0 12px;
gap: 8px;
gap: var(--space-2);
}
.groupTitle {
flex: 1;
@@ -64,7 +64,7 @@
.columns {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
}
.columns .groupTitle {
color: var(--fg-subtle);
@@ -109,7 +109,7 @@
}
.actions {
display: flex;
gap: 6px;
gap: var(--space-1-5);
padding: 8px 12px 2px;
justify-content: flex-end;
}
@@ -133,7 +133,7 @@
display: flex;
align-items: center;
padding: 0 4px 4px 12px;
gap: 6px;
gap: var(--space-1-5);
}
.overlayTitle {
flex: 1;
+3 -3
Переглянути файл
@@ -4,12 +4,12 @@
.array {
display: flex;
flex-direction: column;
gap: 12px;
gap: var(--space-3);
min-width: 0;
}
.field {
gap: 4px;
gap: var(--space-1);
}
.group h3 {
@@ -44,7 +44,7 @@
.buttons {
display: flex;
gap: 6px;
gap: var(--space-1-5);
flex-wrap: wrap;
}
+18 -18
Переглянути файл
@@ -1,7 +1,7 @@
.page {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
min-width: 0;
height: 100%;
min-height: 420px;
@@ -9,7 +9,7 @@
.topBar {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
}
.side {
display: flex;
@@ -61,7 +61,7 @@
.groupHeader {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
height: var(--h-row);
padding: 0 12px;
color: var(--fg-muted);
@@ -73,7 +73,7 @@
.groupToggle {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
height: 100%;
padding: 0;
@@ -94,7 +94,7 @@
.notice {
display: flex;
align-items: flex-start;
gap: 6px;
gap: var(--space-1-5);
margin: 0 8px 4px;
padding: 6px 8px;
border-radius: var(--radius-small);
@@ -150,7 +150,7 @@
.row {
display: flex;
align-items: center;
gap: 4px;
gap: var(--space-1);
padding-right: 8px;
}
.row:hover {
@@ -187,7 +187,7 @@
.rowMeta {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
color: var(--fg-muted);
font-size: var(--fs-small);
font-variant-numeric: tabular-nums;
@@ -226,7 +226,7 @@
display: flex;
flex: 1 1 160px;
flex-direction: column;
gap: 2px;
gap: var(--space-0-5);
min-width: 0;
}
.detailTabs {
@@ -242,7 +242,7 @@
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 8px;
gap: var(--space-2);
}
/* Badges are counter pills (`min-width: 16px`): in a narrow window they wrap instead of shrinking under their text. */
.titleLine > * {
@@ -266,7 +266,7 @@
display: flex;
flex: none;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
}
.description {
margin: 10px 0 0;
@@ -284,7 +284,7 @@
.facts {
display: grid;
grid-template-columns: max-content minmax(0, 1fr);
gap: 2px 16px;
gap: var(--space-0-5) var(--space-4);
margin: 12px 0 0;
}
.facts dt {
@@ -379,7 +379,7 @@
display: flex;
flex-wrap: wrap;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
margin: 6px 0 0 26px;
}
@@ -409,7 +409,7 @@
.consentNotice {
display: flex;
align-items: center;
gap: 12px;
gap: var(--space-3);
justify-content: space-between;
padding: 8px 10px;
border: 1px solid var(--border);
@@ -435,7 +435,7 @@
.rowTitle {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
min-width: 0;
}
.rowDescription {
@@ -449,7 +449,7 @@
display: inline-flex;
flex: none;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
color: var(--fg-muted);
font-size: var(--fs-small);
font-variant-numeric: tabular-nums;
@@ -532,7 +532,7 @@
.intellijThemesStatus {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
padding: 8px 10px;
color: var(--fg-muted);
}
@@ -541,13 +541,13 @@
flex: 1;
flex-direction: column;
justify-content: center;
gap: 2px;
gap: var(--space-0-5);
min-width: 0;
}
.intellijPluginHead {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
min-width: 0;
}
.intellijPluginThemes {
+1 -1
Переглянути файл
@@ -104,7 +104,7 @@
.layout {
display: flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
}
.body {
flex: 1;
+3 -3
Переглянути файл
@@ -8,7 +8,7 @@
.toolbar {
display: flex;
align-items: center;
gap: 2px;
gap: var(--space-0-5);
padding: 2px 6px;
border-bottom: 1px solid var(--border);
}
@@ -68,7 +68,7 @@
.listItem {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
height: 24px;
padding: 0 8px;
cursor: default;
@@ -104,7 +104,7 @@
.field {
display: flex;
flex-direction: column;
gap: 4px;
gap: var(--space-1);
}
.fieldLabel {
+3 -3
Переглянути файл
@@ -26,7 +26,7 @@
flex: none;
display: flex;
align-items: flex-start;
gap: 6px;
gap: var(--space-1-5);
padding: 4px 10px;
border-bottom: 1px solid var(--border);
font-size: var(--fs-small);
@@ -60,7 +60,7 @@
flex: none;
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
padding: 2px 8px;
border-bottom: 1px solid var(--border);
}
@@ -136,7 +136,7 @@
.treeRow {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
min-width: 0;
flex: 1;
white-space: nowrap;
+5 -5
Переглянути файл
@@ -1,7 +1,7 @@
.form {
display: flex;
flex-direction: column;
gap: 8px;
gap: var(--space-2);
padding: 14px;
}
@@ -32,14 +32,14 @@
.options {
display: flex;
flex-direction: column;
gap: 6px;
gap: var(--space-1-5);
margin-top: 4px;
}
.busy {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
color: var(--fg-muted);
font-size: var(--fs-ui);
}
@@ -67,7 +67,7 @@
height: var(--h-row);
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
font-size: var(--fs-ui);
}
@@ -103,7 +103,7 @@
.previewLineRow {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
height: var(--h-row);
}
+2 -2
Переглянути файл
@@ -9,7 +9,7 @@
.search {
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
height: var(--h-row);
padding: 0 10px;
border-bottom: 1px solid var(--border-popup);
@@ -30,7 +30,7 @@
.row {
display: flex;
align-items: center;
gap: 8px;
gap: var(--space-2);
min-width: 0;
flex: 1;
}
+2 -2
Переглянути файл
@@ -70,7 +70,7 @@
display: inline-flex;
flex: 0 1 auto;
align-items: center;
gap: 4px;
gap: var(--space-1);
min-width: 0;
margin-left: 6px;
overflow: hidden;
@@ -138,7 +138,7 @@
z-index: var(--z-tooltip);
display: flex;
align-items: center;
gap: 6px;
gap: var(--space-1-5);
height: 22px;
padding: 0 8px;
border-radius: var(--radius-small);
Loaded 100 of 218 files, more files were not shown because too many files have changed in this diff. Show more