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

..
Автор SHA1 Повідомлення Дата
l0ng-ai b298313b67 fix(lsp): highlight a library class the Kotlin server shows as Java as Java
A virtual `.class` document has no language by its name, so it took its
server's first language. The Kotlin language server shows classes from
Java jars as Java stubs, which were then highlighted as Kotlin: Java
keywords such as `public` and `private` stayed uncoloured. A `.class`
stub whose package or import line ends with `;` is now Java.
2026-11-15 23:39:33 +08:00
223 змінених файлів з 1165 додано та 2672 видалено

No files matched your search

-1
Переглянути файл
@@ -42,7 +42,6 @@ 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.
+10 -8
Переглянути файл
@@ -10,14 +10,12 @@ 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 the `thought_level` choices of the
/// session's model: they describe that model only, and other models may offer different ones.
/// Opens `session/new`, reads `configOptions`, and records per-model `thought_level` choices.
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 {
@@ -64,17 +62,21 @@ 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 = 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 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 commands = updates
.commands
.lock()
.clone()
.or_else(|| new.get("availableCommands").map(|_| config::commands_of(&new, &launch.id)));
Ok::<_, String>(Discovered { config: options, commands, levels })
Ok::<_, String>(Discovered { config: options, commands, levels: levels.into_iter().collect() })
};
let result = tokio::time::timeout(DISCOVER_TIMEOUT, work).await;
peer.kill();
-9
Переглянути файл
@@ -58,8 +58,6 @@ 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 },
@@ -322,13 +320,6 @@ impl Handler for Dialect {
}
self.inner.on_request(method, params)
}
fn on_request_raw(&self, method: &str, params: Value, raw: &[u8]) -> Result<Value, (i64, String, Option<Value>)> {
if self.v2() && method == "session/request_permission" {
return self.on_request_with_data(method, params);
}
self.inner.on_request_raw(method, params, raw)
}
}
/// A v2 permission request with the v1 `toolCall` (its subject's, titled with the request's title).
+1 -5
Переглянути файл
@@ -97,13 +97,10 @@ 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"]);
}
@@ -171,8 +168,7 @@ 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"));
// 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.contains_key("m1") && cursor.thought_levels.contains_key("m2"));
assert!(cursor.thought_levels["m1"].iter().any(|o| o.category.as_deref() == Some("thought_level")));
}
+1 -53
Переглянути файл
@@ -56,16 +56,6 @@ 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 {
@@ -339,17 +329,11 @@ impl AgentCatalogs {
Ok(found) => {
let mut cache = shared.known.lock();
let known = cache.entry(key.2.clone()).or_default();
let mut catalog = CatalogData {
let 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 {
@@ -382,42 +366,6 @@ 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()
+1 -38
Переглянути файл
@@ -199,8 +199,7 @@ 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"]);
// 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.keys().map(String::as_str).collect::<Vec<_>>(), ["new", "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"));
@@ -221,42 +220,6 @@ 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();
-305
Переглянути файл
@@ -1,305 +0,0 @@
//! 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::Deserialize;
use serde::de::{Deserializer, IgnoredAny, MapAccess, Visitor};
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 })
}
/// Orders the fields as the request's schema lists them: `Value` keeps object keys sorted, and
/// the agent's order is the one its form reads in.
pub(crate) fn in_schema_order(form: &mut AgentForm, raw: &[u8]) {
#[derive(Deserialize)]
struct Request {
params: Params,
}
#[derive(Deserialize)]
struct Params {
#[serde(rename = "requestedSchema")]
schema: Schema,
}
#[derive(Deserialize)]
struct Schema {
properties: Keys,
}
struct Keys(Vec<String>);
impl<'de> Deserialize<'de> for Keys {
fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D::Error> {
struct Visit;
impl<'de> Visitor<'de> for Visit {
type Value = Keys;
fn expecting(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
f.write_str("an object")
}
fn visit_map<A: MapAccess<'de>>(self, mut map: A) -> Result<Keys, A::Error> {
let mut keys = Vec::new();
while let Some((key, IgnoredAny)) = map.next_entry::<String, IgnoredAny>()? {
keys.push(key);
}
Ok(Keys(keys))
}
}
deserializer.deserialize_map(Visit)
}
}
let Ok(request) = serde_json::from_slice::<Request>(raw) else { return };
let order = request.params.schema.properties.0;
form.fields.sort_by_key(|field| order.iter().position(|name| *name == field.name).unwrap_or(usize::MAX));
}
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 fields_follow_the_schema_order() {
let raw = br#"{ "jsonrpc": "2.0", "id": 3, "method": "elicitation/create", "params": { "mode": "form",
"requestedSchema": { "type": "object", "properties": {
"strategy": { "type": "string" }, "tests": { "type": "boolean" }, "note": { "type": "string" }
} } } }"#;
let params = serde_json::from_slice::<Value>(raw).unwrap()["params"].take();
let mut form = form_of(&params).unwrap();
in_schema_order(&mut form, raw);
assert_eq!(form.fields.iter().map(|f| f.name.as_str()).collect::<Vec<_>>(), ["strategy", "tests", "note"]);
}
#[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" }));
}
}
+20 -106
Переглянути файл
@@ -11,7 +11,6 @@ mod acp;
mod catalogs;
mod config;
mod conversation;
mod elicitation;
mod external;
pub mod mcp;
mod model;
@@ -224,7 +223,6 @@ 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;
@@ -246,12 +244,6 @@ 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)
{
@@ -262,9 +254,6 @@ 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);
}
@@ -1872,24 +1861,12 @@ impl Task {
let s = self.state.lock();
s.busy && s.task.status == AgentStatus::Running
};
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 {
let Some(live) = live.filter(|l| running && (prompt.images.is_empty() || l.capabilities.images)) else {
return Err(prompt);
};
let content = self.content(&live, &prompt).await;
let sent: Result<Value, RpcError> =
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()),
};
live.peer.request("_openidea/steer", json!({ "sessionId": live.session, "prompt": content }), None).await;
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);
@@ -2389,7 +2366,12 @@ 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 };
let title = self.labelled(params, 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 options: Vec<AgentPermissionOption> = params
.get("options")
.and_then(Value::as_array)
@@ -2421,7 +2403,6 @@ impl Task {
command: None,
options,
questions: Vec::new(),
form: None,
chosen: Some("Denied: side conversations are read-only".to_owned()),
});
return match reject {
@@ -2448,7 +2429,6 @@ impl Task {
command: shown.clone(),
options,
questions: Vec::new(),
form: None,
chosen: Some(format!("Blocked by policy ({pattern})")),
});
return match reject {
@@ -2469,7 +2449,6 @@ 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 } });
@@ -2485,7 +2464,6 @@ impl Task {
command: shown,
options: options.clone(),
questions,
form: None,
chosen: None,
});
self.permissions.lock().insert(id, tx);
@@ -2512,7 +2490,17 @@ impl Task {
.and_then(|reply| options.iter().find(|option| &option.id == reply))
.map_or_else(|| "Cancelled".to_owned(), |option| option.name.clone()),
};
self.settle(entry, name);
{
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);
}
// 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 {
@@ -2544,57 +2532,6 @@ 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, raw: Option<&[u8]>) -> Result<Value, String> {
let mut form = elicitation::form_of(params)?;
if let Some(raw) = raw {
elicitation::in_schema_order(&mut form, raw);
}
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) {
@@ -2659,18 +2596,9 @@ 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, None).map_err(|e| (codes::INVALID_PARAMS, e)),
_ => Err((codes::METHOD_NOT_FOUND, format!("unsupported method {method}"))),
}
}
fn on_request_raw(&self, method: &str, params: Value, raw: &[u8]) -> Result<Value, (i64, String, Option<Value>)> {
if method != "elicitation/create" {
return self.on_request_with_data(method, params);
}
let task = self.task.upgrade().ok_or((codes::INTERNAL_ERROR, "task closed".to_owned(), None))?;
task.elicit(&params, Some(raw)).map_err(|e| (codes::INVALID_PARAMS, e, None))
}
}
/// The prompt trimmed, or `None` when there is nothing to send.
@@ -2937,27 +2865,13 @@ 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: steer_method(init).is_some(),
steer: meta("/openidea/steer"),
background_tasks: meta("/openidea/backgroundTasks"),
read_only: false,
};
-57
Переглянути файл
@@ -316,59 +316,6 @@ 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")]
@@ -449,10 +396,6 @@ 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,9 +51,6 @@ 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 {
@@ -159,10 +156,6 @@ 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}}}}),
@@ -190,13 +183,6 @@ 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!({}))
@@ -295,23 +281,6 @@ 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()
@@ -1091,42 +1060,6 @@ 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();
@@ -2052,58 +1985,6 @@ 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,7 +441,6 @@ mod tests {
command: None,
options: vec![],
questions: vec![],
form: None,
chosen: None,
});
assert_eq!(t.end_turn(None), vec![2, 3]);
-2
Переглянути файл
@@ -19,7 +19,6 @@ pub enum Tool {
Maven,
Gradle,
Ruby,
Zig,
}
impl Tool {
@@ -33,7 +32,6 @@ impl Tool {
Tool::Maven => &["maven"],
Tool::Gradle => &["gradle"],
Tool::Ruby => &["ruby"],
Tool::Zig => &["zig"],
}
}
}
+11 -25
Переглянути файл
@@ -78,8 +78,8 @@ impl Needle {
let mut b = 0;
if n.eq_ignore_ascii_case(q) {
b += EXACT;
} else if let Some(dot) = n.iter().position(|&b| b == b'.')
&& n[..dot].eq_ignore_ascii_case(q)
} else if let Some(dot) = name.find('.')
&& name.as_bytes()[..dot].eq_ignore_ascii_case(q)
{
b += EXACT_STEM;
} else if n.len() >= q.len() && n[..q.len()].eq_ignore_ascii_case(q) {
@@ -97,31 +97,17 @@ fn hump_bonus(s: &str, indices: &[u32]) -> u32 {
if indices.is_empty() {
return 0;
}
// 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 chars: Vec<char> = s.chars().collect();
let is_start = |i: usize| {
if i == 0 {
return true;
}
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 (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
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
}
#[derive(Clone, Copy)]
+8 -21
Переглянути файл
@@ -215,18 +215,12 @@ pub trait Handler: Send + Sync + 'static {
/// Respond to a server→client request (e.g. `workspace/configuration`).
fn on_request(&self, method: &str, params: Value) -> Result<Value, (i64, String)>;
/// [`on_request`](Self::on_request) for handlers whose errors carry `data`.
/// [`on_request`](Self::on_request) for handlers whose errors carry `data`. This is the
/// one the connection calls.
fn on_request_with_data(&self, method: &str, params: Value) -> Result<Value, (i64, String, Option<Value>)> {
self.on_request(method, params).map_err(|(code, message)| (code, message, None))
}
/// [`on_request_with_data`](Self::on_request_with_data) with the request as received, for
/// handlers that need what `Value` drops, such as the order of an object's keys. This is the
/// one the connection calls.
fn on_request_raw(&self, method: &str, params: Value, _raw: &[u8]) -> Result<Value, (i64, String, Option<Value>)> {
self.on_request_with_data(method, params)
}
/// Called once the response to a `method` request is queued: what it sends follows the response.
fn after_response(&self, _method: &str) {}
@@ -583,8 +577,8 @@ impl Peer {
tracing::error!("jsonrpc notification handler panicked on {method}");
}
}
Incoming::Request(id, method, params, raw) => {
runtime.spawn(handle_request(inner.clone(), handler.clone(), id, method, params, raw));
Incoming::Request(id, method, params) => {
runtime.spawn(handle_request(inner.clone(), handler.clone(), id, method, params));
}
Incoming::Response(tx, result) => {
let _ = tx.send(result);
@@ -767,21 +761,14 @@ fn parse_id(id: &Value) -> Option<i64> {
enum Incoming {
Notification(String, Value),
Request(Value, String, Value, Arc<[u8]>),
Request(Value, String, Value),
Response(oneshot::Sender<Result<Value, RpcError>>, Result<Value, RpcError>),
}
async fn handle_request(
inner: Arc<Inner>,
handler: Arc<dyn Handler>,
id: Value,
method: String,
params: Value,
raw: Arc<[u8]>,
) {
async fn handle_request(inner: Arc<Inner>, handler: Arc<dyn Handler>, id: Value, method: String, params: Value) {
let m = method.clone();
let h = handler.clone();
let result = tokio::task::spawn_blocking(move || h.on_request_raw(&m, params, &raw)).await;
let result = tokio::task::spawn_blocking(move || h.on_request_with_data(&m, params)).await;
let reply = match result {
Ok(Ok(result)) => json!({ "jsonrpc": "2.0", "id": id, "result": result }),
Ok(Err((code, message, data))) => {
@@ -821,7 +808,7 @@ fn dispatch(inner: &Arc<Inner>, handler: &dyn Handler, notif_tx: &std::sync::mps
let params = obj.remove("params").unwrap_or(Value::Null);
match id {
Some(id) if !id.is_null() => {
let _ = notif_tx.send(Incoming::Request(id, method, params, Arc::from(body)));
let _ = notif_tx.send(Incoming::Request(id, method, params));
}
_ => {
let _ = notif_tx.send(Incoming::Notification(method, params));
-82
Переглянути файл
@@ -25,7 +25,6 @@ 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);
@@ -41,7 +40,6 @@ 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,
}
}
@@ -741,86 +739,6 @@ 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,8 +52,6 @@ pub enum SdkKind {
/// Maven homes.
Maven,
Ruby,
/// Zig toolchain directories.
Zig,
}
/// One installed interpreter / toolchain.
-10
Переглянути файл
@@ -61,9 +61,6 @@ 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(
@@ -94,13 +91,6 @@ 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 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:
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:
- 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. 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.
**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.
## 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 12 Monterey or later.
macOS 13 Ventura or later.
| Mac | File |
| ------------- | -------------------------------- |
+1 -1
Переглянути файл
@@ -43,7 +43,7 @@ description: "前端 UI 代码的规则:设计 token、CSS Modules、图标、
## WebKit 兼容性
在 macOS 和 Linux 上应用运行于 WebKit,最低支持 Safari 15.4,即 macOS 12 的引擎(应用的最低系统版本)。`pnpm build` 会对产物运行 `scripts/check-webkit.ts`,`src/platform/webkitCompatibility.test.ts` 会检查应用中的正则。请避免:
在 macOS 和 Linux 上应用运行于 WebKit,最低支持 Safari 16,即 macOS 13 的引擎(macOS 11、12 上更新 Safari 不会更新其他应用使用的引擎)。`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 12 Monterey 或更高版本。
需要 macOS 13 Ventura 或更高版本。
| Mac | 文件 |
| ---------- | -------------------------------- |
+12 -6
Переглянути файл
@@ -13,7 +13,7 @@
details: "启动错误详情",
timeout: "启动未在 60 秒内完成。",
outdatedMac:
"这台 Mac 的系统网页引擎过旧:OpenIDEA 的界面运行在 macOS 自带的 WebKit 引擎上,需要 macOS 12 Monterey 或更高版本(引擎为 Safari 15.4 或更新)。更旧的系统缺少应用所需的引擎,需要升级 macOS。",
"这台 Mac 的系统网页引擎过旧:OpenIDEA 的界面运行在 macOS 自带的 WebKit 引擎上,需要 macOS 13 Ventura 或更高版本。在 macOS 11、12 上更新 Safari 不会更新其他应用使用的引擎,需要升级 macOS。",
outdated:
"系统的 WebKitGTK 版本过旧:OpenIDEA 需要较新的 WebKitGTK(webkit2gtk-4.1)。请通过系统的包管理器更新后重新打开 OpenIDEA。",
}
@@ -27,14 +27,20 @@
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 12 Monterey or later (Safari 15.4 or newer). Older macOS releases lack the engine the app needs, 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 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.",
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 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";
// 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;
}
};
let failed = false;
let ready = false;
const describe = (reason) => {
+1 -5
Переглянути файл
@@ -10,16 +10,12 @@ 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 15.4 startup graph", (source) => {
])("rejects %s in the Safari 16 startup graph", (source) => {
expect(checkSource(source, true).length).toBeGreaterThan(0);
});
+4 -13
Переглянути файл
@@ -3,7 +3,7 @@ import { dirname, resolve } from "node:path";
import { pathToFileURL } from "node:url";
import ts from "typescript";
// 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.
// Safari 16 is macOS 13's system 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,16 +15,7 @@ const newerStatics = new Set([
"Uint8Array.fromBase64",
"Uint8Array.fromHex",
]);
const newerMethods = new Set([
"isWellFormed",
"toWellFormed",
// Safari 16 / 16.4 APIs above the floor.
"showPicker",
"supportedValuesOf",
"toSorted",
"toReversed",
"toSpliced",
]);
const newerMethods = new Set(["isWellFormed", "toWellFormed"]);
export function checkSource(source: string, startup: boolean): string[] {
const tree = ts.createSourceFile("bundle.js", source, ts.ScriptTarget.Latest, true, ts.ScriptKind.JS);
@@ -93,6 +84,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 15.4 compatibility check failed:\n${errors.join("\n")}`);
console.log("Safari 15.4 startup API and bundle syntax checks passed");
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");
}
+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": "12.0"
"minimumSystemVersion": "13.0"
}
},
"mainBinaryName": "openidea",
+1 -41
Переглянути файл
@@ -2056,11 +2056,6 @@ 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 };
@@ -2084,39 +2079,6 @@ 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. */
@@ -9665,9 +9627,7 @@ export type SdkKind = "python" | "node" |
/** JDK homes. */
"jdk" |
/** Maven homes. */
"maven" | "ruby" |
/** Zig toolchain directories. */
"zig";
"maven" | "ruby";
/**
* IDEA's search context: matches anywhere, only in, or outside comments and
-14
Переглянути файл
@@ -290,20 +290,6 @@ 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();
}
+2 -5
Переглянути файл
@@ -1,7 +1,4 @@
import { tags as t, type styleTags } from "@lezer/highlight";
/**
* @lezer/javascript styles `.` as a deref operator, but not `?.`; it tags `this` as `self` (Python's
* `self` colour) and `super` as an atom, which WebStorm colours as keywords.
*/
export const JS_TAGS: Parameters<typeof styleTags>[0] = { "?.": t.derefOperator, "this super": t.keyword };
/** @lezer/javascript styles `.` as a deref operator, but not `?.`. */
export const JS_TAGS: Parameters<typeof styleTags>[0] = { "?.": t.derefOperator };
-25
Переглянути файл
@@ -270,31 +270,6 @@ describe("language modes", () => {
}
});
it("colours `this` and `super` as keywords in Java, JavaScript, TypeScript and C++", async () => {
const highlighter = tagHighlighter([
{ tag: t.keyword, class: "keyword" },
{ tag: t.self, class: "self" },
{ tag: t.atom, class: "atom" },
]);
for (const [mode, path, doc, expected] of [
["Java", "/p/A.java", "class A extends B { A() { super(); this.a = 1; } }", ["super", "this"]],
["JavaScript", "/p/a.js", "class A extends B { m() { super.m(); this.a = 1; } }", ["super", "this"]],
["TypeScript", "/p/a.ts", "class A extends B { m() { super.m(); this.a = 1; } }", ["super", "this"]],
["C++", "/p/a.cpp", "void A::m() { this->a = 1; }", ["this"]],
] as const) {
const support = await loadSupport(findLanguageDescription(mode, path)!);
const found: Array<[string, string]> = [];
highlightTree(support!.language.parser.parse(doc), highlighter, (from, to, style) =>
found.push([doc.slice(from, to), style]),
);
const words = new Set<string>(expected);
expect(
found.filter(([text]) => words.has(text)),
mode,
).toEqual(expected.map((word) => [word, "keyword"]));
}
});
it("recognizes go.mod and go.work files by mode and filename", async () => {
for (const [mode, path] of [
["GoMod", "/project/go.mod"],
+1 -5
Переглянути файл
@@ -293,11 +293,9 @@ const CSS_TAGS: Parameters<typeof styleTags>[0] = {
"ClassName IdName PseudoClassName ColorLiteral CallTag": t.tagName,
};
// @lezer/java tags annotations as plain identifiers, and `this` as `self` (Python's `self` colour);
// IntelliJ colours `this` as a keyword.
// @lezer/java tags annotations as plain identifiers.
export const JAVA_TAGS: Parameters<typeof styleTags>[0] = {
"MarkerAnnotation/Identifier Annotation/Identifier MarkerAnnotation Annotation": t.annotation,
this: t.keyword,
};
/** Highlighting the stock grammars lack or colour unlike IntelliJ. */
@@ -308,8 +306,6 @@ const EXTRA_TAGS: Record<string, Parameters<typeof styleTags>[0]> = {
JSX: JS_TAGS,
TSX: JS_TAGS,
Java: JAVA_TAGS,
// CLion colours `this` as a keyword.
"C++": { this: t.keyword },
PHP: {
"; ,": t.separator,
"ClassDeclaration/Name BaseClause/Name InterfaceClause/Name": t.className,
+8 -8
Переглянути файл
@@ -74,7 +74,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 0 6px 0 8px;
}
.pin {
@@ -89,7 +89,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
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: var(--space-1-5);
row-gap: var(--space-1-5);
column-gap: 6px;
row-gap: 6px;
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: var(--space-0-5);
gap: 2px;
}
.findCount {
font-size: var(--fs-ui);
@@ -173,14 +173,14 @@
.replaceButtons {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
/* Go to line */
.gotoBody {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
padding: 8px 16px 0;
}
.gotoHint {
@@ -316,7 +316,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
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={styles.dropZone} aria-hidden="true" />}
{over && <div className={clsx(styles.dropZone, styles["drop-center"])} aria-hidden="true" />}
</div>
);
}
+2 -2
Переглянути файл
@@ -58,7 +58,7 @@
.row {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: var(--h-list-row);
padding: 0 6px;
border-radius: var(--radius-row);
@@ -87,7 +87,7 @@
.childHeader {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
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: var(--space-2);
gap: 8px;
padding: 0 12px;
font-size: var(--fs-ui);
font-weight: 600;
@@ -96,7 +96,7 @@
.item {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-width: 0;
width: 100%;
font-size: var(--fs-ui);
@@ -263,7 +263,7 @@
bottom: 0;
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
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: var(--space-1-5);
gap: 6px;
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: var(--space-2);
gap: 8px;
padding: 0 14px;
font-size: var(--fs-ui);
}
@@ -368,7 +368,7 @@
flex: none;
display: flex;
align-items: flex-start;
gap: var(--space-1-5);
gap: 6px;
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: var(--space-1-5);
gap: 6px;
}
.reformatLegend {
margin-bottom: 6px;
@@ -432,21 +432,21 @@
.reformatOption {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
font-size: var(--fs-ui);
}
.pasteImports {
display: flex;
flex-direction: column;
gap: var(--space-3);
gap: 12px;
padding: 14px;
font-size: var(--fs-ui);
}
.pasteImportList {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
max-height: 280px;
overflow: auto;
overflow-wrap: anywhere;
+3 -3
Переглянути файл
@@ -19,7 +19,7 @@
flex: none;
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
}
.targets {
@@ -41,7 +41,7 @@
display: grid;
grid-template-columns: 1fr 110px;
align-items: center;
gap: var(--space-2);
gap: 8px;
padding: 0 8px;
min-height: var(--h-list-row);
}
@@ -88,6 +88,6 @@
.busy {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
color: var(--fg-muted);
}
+10 -10
Переглянути файл
@@ -35,7 +35,7 @@
.agentRow {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
width: 100%;
min-width: 0;
padding: 0 8px;
@@ -69,7 +69,7 @@
.registryState {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 6px 12px;
border-top: 1px solid var(--border);
color: var(--fg-muted);
@@ -79,7 +79,7 @@
.customActions {
display: flex;
flex-wrap: wrap;
gap: var(--space-1-5);
gap: 6px;
padding: 8px;
border-top: 1px solid var(--border);
}
@@ -116,7 +116,7 @@
.facts {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
margin-top: 2px;
color: var(--fg-muted);
@@ -143,12 +143,12 @@
.actions {
display: flex;
flex: none;
gap: var(--space-1-5);
gap: 6px;
}
.progress {
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
max-width: 360px;
margin: 10px 0 0 34px;
}
@@ -182,7 +182,7 @@
}
.links {
display: flex;
gap: var(--space-3);
gap: 12px;
}
.link {
padding: 0;
@@ -209,7 +209,7 @@
.sectionTitle {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
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: var(--space-1);
row-gap: 4px;
min-width: 0;
}
.label {
@@ -278,7 +278,7 @@
display: flex;
flex: 1;
align-items: center;
gap: var(--space-1);
gap: 4px;
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>{job.message}</span>
<span className={styles.hint}>{job.message}</span>
</div>
)}
{!job && installed && update && <p className={styles.notice}>{tx`${update} is available`}</p>}
+6 -6
Переглянути файл
@@ -18,14 +18,14 @@
min-height: 0;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
gap: var(--space-3);
gap: 12px;
}
.column {
min-height: 0;
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
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: var(--space-1);
gap: 4px;
overflow: auto;
}
@@ -50,9 +50,9 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-1-5);
gap: 6px;
padding: 4px 8px;
background: var(--bg-hover);
background: var(--bg-subtle);
border-radius: var(--radius-control);
font-family: var(--font-mono);
font-size: var(--fs-small);
@@ -65,7 +65,7 @@
.add {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
.input {
+1 -1
Переглянути файл
@@ -1,7 +1,7 @@
.body {
display: flex;
flex-direction: column;
gap: var(--space-3);
gap: 12px;
height: 100%;
min-height: 0;
}
+7 -7
Переглянути файл
@@ -31,7 +31,7 @@
.row {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
flex: 1;
}
@@ -105,7 +105,7 @@
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-1);
gap: 4px;
padding: 24px 12px;
color: var(--fg-muted);
}
@@ -154,7 +154,7 @@
.dockedBar {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 2px 8px;
border-bottom: 1px solid var(--border);
}
@@ -215,7 +215,7 @@
padding: 4px 12px 8px;
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
}
.external > .row {
flex: none;
@@ -225,7 +225,7 @@
.chooser {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
}
.chooserList {
height: 312px;
@@ -242,14 +242,14 @@
.chooserRow {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
width: 100%;
}
.chooserFooter {
display: flex;
align-items: center;
gap: var(--space-3);
gap: 12px;
}
.chooserFolder {
flex: 0 0 auto;
+12 -12
Переглянути файл
@@ -75,7 +75,7 @@
display: flex;
align-items: center;
justify-content: center;
gap: var(--space-2);
gap: 8px;
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: var(--space-0-5);
gap: 2px;
padding: 4px 6px 6px;
cursor: default;
}
@@ -95,13 +95,13 @@
flex-wrap: wrap;
align-items: center;
min-width: 0;
gap: var(--space-0-5);
gap: 2px;
}
.actions {
display: flex;
flex: none;
align-items: center;
gap: var(--space-1);
gap: 4px;
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: var(--space-3);
gap: 12px;
margin-top: 8px;
}
.settingsLabel {
@@ -147,7 +147,7 @@
.chip {
display: inline-flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
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: var(--space-3);
gap: 12px;
}
.effortValue {
color: var(--fg-strong);
@@ -295,7 +295,7 @@
.modeOption {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: 24px;
margin: 0 6px;
padding: 0 8px;
@@ -318,7 +318,7 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-3);
gap: 12px;
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: var(--space-1-5);
gap: 6px;
}
.toolbar {
flex-wrap: nowrap;
@@ -392,7 +392,7 @@
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 8px 10px 0;
cursor: default;
}
@@ -539,7 +539,7 @@
.popupFooter {
display: flex;
flex-wrap: wrap;
gap: var(--space-1) 14px;
gap: 4px 14px;
padding: 5px 12px 6px;
border-top: 1px solid var(--border);
color: var(--fg-subtle);
-183
Переглянути файл
@@ -1,183 +0,0 @@
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: var(--space-2);
gap: 8px;
}
.fitWidth .inner {
width: 100%;
@@ -35,7 +35,7 @@
flex-wrap: wrap;
align-items: center;
/* The chips' own padding spaces them. */
gap: var(--space-0-5);
gap: 2px;
padding: 0 2px;
font-size: var(--fs-small);
}
@@ -66,7 +66,7 @@
padding: 16px 12px 12px;
}
.docked .inner {
gap: var(--space-2);
gap: 8px;
}
.docked .where {
flex-wrap: nowrap;
@@ -95,7 +95,7 @@
.notes {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
height: 0;
}
.docked .notes {
+17 -11
Переглянути файл
@@ -10,13 +10,13 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-3);
gap: 12px;
}
.headerActions {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
}
.title {
@@ -52,7 +52,7 @@
.error {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
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: var(--space-1-5);
gap: 6px;
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: var(--space-2);
gap: 8px;
}
.sectionToggle {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
flex: 1;
min-width: 0;
padding: 4px 2px;
@@ -143,6 +143,12 @@
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;
@@ -155,7 +161,7 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-3);
gap: 12px;
padding: 6px 8px 6px 22px;
border-radius: var(--radius-control);
}
@@ -167,7 +173,7 @@
.rowMain {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
min-width: 0;
flex: 1;
}
@@ -191,7 +197,7 @@
.rowActions {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
flex-shrink: 0;
}
@@ -200,7 +206,7 @@
display: grid;
grid-template-columns: max-content minmax(0, 1fr);
align-items: start;
gap: 10px var(--space-3);
gap: 10px 12px;
padding: 12px 16px 4px;
}
@@ -217,7 +223,7 @@
.formControl {
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
min-width: 0;
}
+3 -3
Переглянути файл
@@ -2,7 +2,7 @@
.chip {
display: inline-flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
max-width: 100%;
height: 20px;
padding: 0 6px 0 4px;
@@ -126,7 +126,7 @@
.cardHead {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 6px 10px;
}
.cardPath {
@@ -201,7 +201,7 @@
.codeHead {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: 26px;
padding: 0 4px 0 8px;
border-bottom: 1px solid var(--border);
+54 -95
Переглянути файл
@@ -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: var(--space-0-5) var(--space-1-5);
gap: 2px 6px;
min-width: 0;
padding: 0 2px;
overflow: hidden;
@@ -104,7 +104,7 @@
flex: 0 1 auto;
max-width: 100%;
align-items: center;
gap: var(--space-1);
gap: 4px;
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: var(--space-0-5);
gap: 2px;
min-width: 0;
overflow: hidden;
}
@@ -144,7 +144,7 @@
flex: 1 1 auto;
flex-wrap: wrap;
align-items: center;
gap: var(--space-0-5) var(--space-2);
gap: 2px 8px;
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: var(--space-2);
gap: 8px;
max-width: 100%;
min-width: 0;
overflow: hidden;
@@ -163,13 +163,13 @@
display: flex;
flex: none;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
}
/* What changed (files, commits) above the meters; both open the Changes pane. */
.statusChips {
display: inline-flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
max-width: 100%;
min-width: 0;
}
@@ -177,7 +177,7 @@
composes: surface from "../../ui/Chip.module.css";
display: inline-flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
max-width: 100%;
min-width: 0;
padding: 0 8px;
@@ -207,31 +207,6 @@
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;
@@ -345,7 +320,7 @@
.messageFooter {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-height: var(--h-control-small);
max-width: 100%;
flex-wrap: wrap;
@@ -403,7 +378,7 @@
}
.messageActions {
display: inline-flex;
gap: var(--space-1);
gap: 4px;
max-width: 100%;
flex-wrap: wrap;
opacity: 0;
@@ -467,7 +442,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 4px 8px;
border-bottom: 1px solid var(--border);
}
@@ -523,14 +498,14 @@
.editBar {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
margin-top: 6px;
font-size: var(--fs-small);
}
.editButtons {
display: flex;
gap: var(--space-1-5);
gap: 6px;
margin-left: auto;
}
@@ -760,7 +735,7 @@
.thought summary {
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
min-width: 0;
height: var(--h-row);
color: var(--fg-muted);
@@ -798,7 +773,7 @@
.tool {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-width: 0;
box-sizing: border-box;
min-height: var(--h-row);
@@ -853,7 +828,7 @@
.processSummary {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
width: 100%;
max-width: 100%;
box-sizing: border-box;
@@ -901,7 +876,7 @@
.processBody {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
max-height: calc(var(--h-row) * 16);
overflow-y: auto;
margin-top: 2px;
@@ -925,7 +900,7 @@
.plan {
display: grid;
gap: var(--space-0-5);
gap: 2px;
}
.planTitle {
font-weight: 600;
@@ -934,7 +909,7 @@
.planItem {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
.planDone {
color: var(--fg-muted);
@@ -1042,7 +1017,7 @@
.error {
display: flex;
gap: var(--space-1-5);
gap: 6px;
align-items: flex-start;
color: var(--danger);
white-space: pre-wrap;
@@ -1052,7 +1027,7 @@
.working {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
color: var(--fg-muted);
}
@@ -1074,7 +1049,7 @@
flex: none;
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
align-self: center;
width: 100%;
max-width: calc(var(--session-content-width) + var(--space-3) * 2);
@@ -1085,12 +1060,12 @@
.background {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
}
.backgroundTask {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 24px;
padding: 0 4px 0 8px;
border-radius: var(--radius-row);
@@ -1110,12 +1085,12 @@
.queue {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
}
.queued {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 28px;
padding: 0 4px 0 8px;
border-radius: var(--radius-row);
@@ -1170,7 +1145,7 @@
.images {
display: flex;
flex-wrap: wrap;
gap: var(--space-1-5);
gap: 6px;
margin-top: 4px;
}
.imageItem {
@@ -1210,14 +1185,14 @@
.attachments {
display: flex;
flex-wrap: wrap;
gap: var(--space-1) var(--space-1-5);
gap: 4px 6px;
margin-top: 4px;
font-size: var(--fs-small);
}
.attachment {
display: inline-flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
}
.changes {
@@ -1250,7 +1225,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: 32px;
flex: none;
padding: 0 6px 0 10px;
@@ -1295,7 +1270,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
}
.changeName {
flex: 0 1 auto;
@@ -1327,7 +1302,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
.changeGroupName {
min-width: 0;
@@ -1342,7 +1317,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
.changeCommitHash {
flex: none;
@@ -1373,7 +1348,7 @@
.subagent {
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
padding: 6px 8px;
border: 1px solid var(--border);
border-radius: var(--radius-small);
@@ -1382,7 +1357,7 @@
.subagentHead {
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
min-width: 0;
}
.subagentOpen {
@@ -1390,7 +1365,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 2px 4px;
margin: -2px -4px;
border: 0;
@@ -1466,7 +1441,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: 30px;
padding: 0 8px 0 6px;
border-bottom: 1px solid var(--border);
@@ -1477,7 +1452,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
overflow: hidden;
}
.crumb {
@@ -1523,12 +1498,12 @@
.subagentStrip {
display: flex;
flex-wrap: wrap;
gap: var(--space-1);
gap: 4px;
}
.subagentChip {
display: inline-flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
max-width: 240px;
height: 22px;
padding: 0 8px;
@@ -1556,7 +1531,7 @@
flex: none;
display: flex;
flex-direction: column;
gap: var(--space-3);
gap: 12px;
max-height: 50vh;
overflow-y: auto;
/* The composer's width, so the card sits exactly over the box it belongs to. */
@@ -1598,7 +1573,7 @@
.question {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
min-width: 0;
margin: 0;
padding: 0;
@@ -1632,7 +1607,7 @@
.questionChoices {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
}
.question .questionChoices > * {
border: 1px solid var(--border);
@@ -1658,7 +1633,7 @@
.questionChoice {
display: flex;
align-items: flex-start;
gap: var(--space-2);
gap: 8px;
}
.questionOptionText {
display: flex;
@@ -1688,19 +1663,19 @@
.questionBody {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
}
.questionChoices {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
min-width: 0;
}
@container question-card (min-width: 640px) {
.questionBodyWithPreview {
display: grid;
grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
gap: var(--space-3);
gap: 12px;
align-items: start;
}
.questionBodyWithPreview .questionPreview {
@@ -1716,7 +1691,7 @@
display: flex;
flex-direction: column;
grid-area: 1 / 1;
gap: var(--space-1);
gap: 4px;
min-width: 0;
visibility: hidden;
}
@@ -1749,12 +1724,12 @@
flex-wrap: wrap;
align-items: center;
justify-content: flex-end;
gap: var(--space-2);
gap: 8px;
}
.questionPager {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
.questionPage {
color: var(--fg-subtle);
@@ -1762,22 +1737,6 @@
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 {
@@ -1812,7 +1771,7 @@
.tray {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
}
.tray:empty {
display: none;
@@ -1824,12 +1783,12 @@
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--space-1);
gap: 4px;
}
.trayChip {
display: inline-flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: var(--h-row);
padding: 0 var(--space-2);
border: none;
@@ -1848,7 +1807,7 @@
.trayPlan {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
padding: 2px var(--space-2) 4px calc(var(--space-2) * 2);
font-size: var(--fs-small);
}
+9 -8
Переглянути файл
@@ -97,9 +97,7 @@ import {
type Activity,
} from "./workingStatus";
import { AgentReply, MessageActions, ReplyActions } from "./AgentReply";
import { FormCard } from "./FormCard";
import {
asksInCard,
commandPrefix,
permissionDetails,
permissionOption,
@@ -2307,7 +2305,9 @@ function PermissionLine({ task, entry }: { task: AgentTask; entry: PermissionEnt
) : (
<span className={styles.permissionDetail}>{shortTitle(task, detail)}</span>
)}
{!asksInCard(entry) && <PermissionAnswers task={task} entry={entry} className={styles.permissionAnswers} />}
{!entry.questions?.length && (
<PermissionAnswers task={task} entry={entry} className={styles.permissionAnswers} />
)}
</>
)}
</div>
@@ -2332,13 +2332,12 @@ 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 or agent form, as a card above the composer; one question at a time. */
/** An open `AskUserQuestion` request, 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 && asksInCard(candidate),
candidate.type === "permission" && !candidate.chosen && !!candidate.questions?.length,
);
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;
@@ -2630,7 +2629,9 @@ 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 && !asksInCard(e));
const pending = entries?.find(
(e): e is PermissionEntry => e.type === "permission" && !e.chosen && !e.questions?.length,
);
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;
@@ -2704,7 +2705,7 @@ function WorkingRow({
);
}
if (task.status !== "running" && task.status !== "starting") return null;
if (entries?.some((e) => e.type === "permission" && !e.chosen && !asksInCard(e))) return null;
if (entries?.some((e) => e.type === "permission" && !e.chosen && !e.questions?.length)) return null;
const userAt = entries?.findLastIndex((e) => e.type === "user") ?? -1;
const lastUser = userAt >= 0 ? (entries![userAt] as UserEntry) : undefined;
return (
+6 -6
Переглянути файл
@@ -16,13 +16,13 @@
.activity {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
}
.after {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
}
.seconds {
@@ -35,7 +35,7 @@
min-height: 120px;
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
padding: 8px;
overflow: auto;
border: 1px solid var(--border-strong);
@@ -46,9 +46,9 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-1-5);
gap: 6px;
padding: 4px 8px;
background: var(--bg-hover);
background: var(--bg-subtle);
border-radius: var(--radius-control);
}
@@ -64,7 +64,7 @@
.add {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
.input {
-3
Переглянути файл
@@ -3,9 +3,6 @@ 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,68 +1460,6 @@ 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: var(--space-2);
gap: 8px;
height: var(--h-row);
padding: 0 10px;
border-bottom: 1px solid var(--border);
@@ -39,7 +39,7 @@
.row {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
flex: 1;
white-space: nowrap;
@@ -115,7 +115,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
width: 100%;
height: var(--h-row);
padding: 0 8px;
@@ -163,7 +163,7 @@
.scope {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
margin: 0;
padding: 0;
border: 0;
@@ -176,7 +176,7 @@
.radioRow {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
padding: 3px 0;
color: var(--fg);
cursor: default;
@@ -187,7 +187,7 @@
}
.dirRow {
display: flex;
gap: var(--space-1-5);
gap: 6px;
padding: 4px 0 0 22px;
}
.grow {
@@ -197,7 +197,7 @@
.fieldRow {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
}
.languageSelect {
min-width: 180px;
@@ -245,7 +245,7 @@
.previewItem {
display: flex;
align-items: flex-start;
gap: var(--space-2);
gap: 8px;
padding: 4px 8px;
border-bottom: 1px solid var(--border);
}
@@ -257,7 +257,7 @@
flex: 1;
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
}
.previewWhere {
color: var(--fg-subtle);
@@ -298,7 +298,7 @@
.details {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
padding: 10px 12px;
overflow: auto;
border-left: 1px solid var(--border);
@@ -312,7 +312,7 @@
.detailsTitle {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
color: var(--fg-strong);
}
.detailsMessage {
@@ -322,5 +322,5 @@
}
.detailsActions {
display: flex;
gap: var(--space-1-5);
gap: 6px;
}
+3 -3
Переглянути файл
@@ -1,19 +1,19 @@
.body {
display: flex;
flex-direction: column;
gap: var(--space-4);
gap: 16px;
padding: 20px;
}
.field {
display: grid;
grid-template-columns: 80px 1fr;
align-items: center;
gap: var(--space-3);
gap: 12px;
}
.row {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-width: 0;
}
.row > input {
+9 -9
Переглянути файл
@@ -14,7 +14,7 @@
min-width: 0;
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
line-height: 1.55;
}
.productName {
@@ -37,7 +37,7 @@
}
.fact {
display: flex;
gap: var(--space-1);
gap: 4px;
min-width: 0;
}
.fact dt {
@@ -57,7 +57,7 @@
.links {
display: flex;
flex-wrap: wrap;
gap: var(--space-1) var(--space-4);
gap: 4px 16px;
}
.link {
padding: 0;
@@ -94,7 +94,7 @@
.keymapBar {
display: flex;
align-items: center;
gap: var(--space-3);
gap: 12px;
padding: 8px 12px;
border-bottom: 1px solid var(--border-popup);
}
@@ -139,7 +139,7 @@
.keymapRow {
display: flex;
align-items: center;
gap: var(--space-3);
gap: 12px;
min-height: var(--h-row);
padding: 0 4px;
border-radius: var(--radius-row);
@@ -157,13 +157,13 @@
.keymapKeys {
flex: none;
display: flex;
gap: var(--space-1);
gap: 4px;
}
.invalidateBody {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
padding: 14px;
color: var(--fg);
font-size: var(--fs-ui);
@@ -185,13 +185,13 @@
.importSummary {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
}
.importList {
margin: 0;
display: grid;
grid-template-columns: max-content 1fr;
gap: var(--space-0-5) var(--space-4);
gap: 2px 16px;
}
.importList dt {
color: var(--fg-muted);
+7 -7
Переглянути файл
@@ -31,7 +31,7 @@
.entry {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
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: var(--space-2) var(--space-3);
gap: 8px 12px;
}
.label {
color: var(--fg);
@@ -76,7 +76,7 @@
}
.inline {
display: flex;
gap: var(--space-2);
gap: 8px;
}
.inline > :first-child {
flex: 1;
@@ -103,7 +103,7 @@
.missing {
display: flex;
align-items: flex-start;
gap: var(--space-2);
gap: 8px;
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: var(--space-1-5);
gap: 6px;
}
.chips {
display: flex;
flex-wrap: wrap;
gap: var(--space-1);
gap: 4px;
}
.chip {
display: inline-flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
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: var(--space-0-5);
gap: 2px;
padding: 0 6px;
}
.sep {
@@ -22,7 +22,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 28px;
padding: 2px 10px;
font-size: var(--fs-small);
@@ -57,14 +57,14 @@
.loading {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
padding: 12px;
color: var(--fg-muted);
}
.row {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
flex: 1;
white-space: nowrap;
@@ -110,7 +110,7 @@
.popupHeader {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
height: var(--h-row);
padding: 4px 10px 0;
font-size: var(--fs-small);
@@ -124,7 +124,7 @@
.inputRow {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 6px 10px;
border-bottom: 1px solid var(--border-popup);
}
@@ -164,7 +164,7 @@
.completion {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-width: 0;
flex: 1;
}
@@ -196,7 +196,7 @@
.popupFooter {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
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: var(--space-1-5);
gap: 6px;
min-height: 36px;
padding: 4px 8px;
border-bottom: 1px solid var(--border);
@@ -37,7 +37,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 28px;
padding: 2px 10px;
font-size: var(--fs-small);
@@ -74,7 +74,7 @@
.row {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
flex: 1;
white-space: nowrap;
@@ -124,7 +124,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 32px;
padding: 0 10px;
border-bottom: 1px solid var(--border);
@@ -142,7 +142,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 6px 10px;
font-size: var(--fs-small);
color: var(--fg-secondary);
@@ -162,7 +162,7 @@
.usageHeader {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 26px;
}
.usageVersion {
@@ -190,7 +190,7 @@
.step {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 22px;
white-space: nowrap;
}
+1 -1
Переглянути файл
@@ -22,7 +22,7 @@
.row {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
flex: 1;
white-space: nowrap;
+2 -2
Переглянути файл
@@ -14,7 +14,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 0 6px;
}
.sep {
@@ -43,7 +43,7 @@
.row {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
flex: 1;
white-space: nowrap;
+1 -1
Переглянути файл
@@ -29,7 +29,7 @@
.row {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
flex: 1;
white-space: nowrap;
+1 -1
Переглянути файл
@@ -50,7 +50,7 @@
.line {
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
min-height: 24px;
}
.name {
+1 -1
Переглянути файл
@@ -1,7 +1,7 @@
.toolbar {
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 3px 6px;
flex-shrink: 0;
}
+2 -2
Переглянути файл
@@ -9,7 +9,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
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: var(--space-2);
gap: 8px;
min-width: 0;
width: 100%;
}
+3 -3
Переглянути файл
@@ -14,7 +14,7 @@
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 4px 0;
border-right: 1px solid var(--border);
}
@@ -29,7 +29,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 0 10px;
font-size: var(--fs-ui);
color: var(--fg-subtle);
@@ -72,7 +72,7 @@
.row {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
flex: 1;
white-space: nowrap;
+3 -3
Переглянути файл
@@ -46,7 +46,7 @@
bottom: 0;
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
width: 104px;
height: 54px;
padding: 0 10px;
@@ -79,7 +79,7 @@
min-width: 0;
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
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: var(--space-2) 5px;
gap: 8px 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: var(--space-2);
column-gap: 8px;
}
.header.noBranches,
.row.noBranches {
@@ -35,7 +35,7 @@
.headerCell {
display: inline-flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
min-width: 0;
padding: 0;
border: 0;
@@ -62,7 +62,7 @@
.name {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
}
.icon {
@@ -75,7 +75,7 @@
.cell {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
}
.bar {
@@ -112,7 +112,7 @@
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
/* Manage Coverage Reports */
@@ -126,7 +126,7 @@
.reportRow {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
flex: 1;
white-space: nowrap;
+46 -46
Переглянути файл
@@ -31,7 +31,7 @@
position: relative;
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
padding: 0 6px;
border-right: 1px solid var(--border);
overflow: hidden;
@@ -139,7 +139,7 @@
.toolbar {
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
height: var(--h-header);
padding: 0 6px;
flex: none;
@@ -237,7 +237,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 0 6px;
}
.dbToolbarSep {
@@ -259,7 +259,7 @@
.nodeRow {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
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: var(--space-1);
gap: 4px;
height: var(--h-header);
padding: 0 8px;
background: var(--bg-editor);
@@ -338,7 +338,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 0 8px;
color: var(--fg-muted);
}
@@ -352,7 +352,7 @@
.pager {
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
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: var(--space-2) var(--space-3);
gap: 8px 12px;
min-width: 0;
padding: 14px;
overflow-wrap: anywhere;
@@ -397,7 +397,7 @@
}
.formRow {
display: flex;
gap: var(--space-2);
gap: 8px;
align-items: center;
}
.formRow[hidden],
@@ -409,7 +409,7 @@
grid-column: 1 / -1;
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
color: var(--fg-strong);
}
.formSection::after {
@@ -490,7 +490,7 @@
.colorValue {
display: inline-flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
.colorSwatch {
width: 12px;
@@ -500,12 +500,12 @@
.namePicker {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
}
.nameList {
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
max-height: 180px;
overflow: auto;
padding-left: 22px;
@@ -513,14 +513,14 @@
.propertyTable {
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
}
.propertyHead,
.propertyRow {
display: grid;
grid-template-columns: 1fr 1fr 24px;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
.propertyHead {
color: var(--fg-secondary);
@@ -620,7 +620,7 @@
:global(.cm-openidea-db-banner) {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
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: var(--space-1);
gap: 4px;
min-width: 0;
}
.previewTitle {
@@ -734,7 +734,7 @@
}
.modifyToolbar {
display: flex;
gap: var(--space-0-5);
gap: 2px;
padding: 2px 4px;
border-bottom: 1px solid var(--border);
}
@@ -746,7 +746,7 @@
.modifyItem {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: 24px;
padding: 0 8px;
cursor: default;
@@ -767,7 +767,7 @@
grid-template-columns: max-content 1fr;
align-content: start;
align-items: center;
gap: var(--space-2) var(--space-3);
gap: 8px 12px;
padding: 12px;
overflow: auto;
}
@@ -777,17 +777,17 @@
padding: 10px 12px;
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
}
.quickDocRows {
margin: 0;
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
}
.quickDocRows > div {
display: flex;
gap: var(--space-1-5);
gap: 6px;
}
.quickDocRows dt {
font-weight: 600;
@@ -837,7 +837,7 @@
right: 12px;
bottom: 12px;
display: flex;
gap: var(--space-2);
gap: 8px;
align-items: center;
padding: 3px 10px;
border: 1px solid var(--border);
@@ -859,7 +859,7 @@
.columnsPopup {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
width: 320px;
padding: 8px;
}
@@ -870,14 +870,14 @@
display: flex;
flex: 1;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
white-space: nowrap;
}
.filterPopup {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
width: 280px;
padding: 8px;
}
@@ -888,7 +888,7 @@
.filterValue {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: var(--h-row);
}
.filterValue > :first-child {
@@ -910,7 +910,7 @@
.filterButtons {
display: flex;
flex-wrap: wrap;
gap: var(--space-1-5);
gap: 6px;
}
.sidePanel {
flex: none;
@@ -934,24 +934,24 @@
.recordFields {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
padding: 8px;
}
.recordField {
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
}
.recordLabel {
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
color: var(--fg-secondary);
}
.valueView {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
height: 100%;
padding: 8px;
box-sizing: border-box;
@@ -998,7 +998,7 @@
flex-direction: column;
flex: 1;
min-height: 0;
gap: var(--space-1-5);
gap: 6px;
overflow: hidden;
}
.valueWindowBody .valueEditor {
@@ -1040,7 +1040,7 @@
.chartBar {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: var(--h-header);
padding: 0 8px;
flex: none;
@@ -1102,7 +1102,7 @@
.planRow {
display: grid;
grid-template-columns: minmax(160px, 1fr) 1fr;
gap: var(--space-3);
gap: 12px;
width: 100%;
}
.planHeader {
@@ -1113,7 +1113,7 @@
.planOperation {
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
overflow: hidden;
text-overflow: ellipsis;
}
@@ -1144,14 +1144,14 @@
/* Export / history / import dialogs. */
.exportDialog {
display: flex;
gap: var(--space-4);
gap: 16px;
height: 420px;
padding: 14px;
}
.exportOptions {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
width: 300px;
flex: none;
}
@@ -1164,7 +1164,7 @@
min-width: 0;
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
}
.exportPreviewText,
.historyPreview {
@@ -1206,21 +1206,21 @@
}
.historyDialog {
display: flex;
gap: var(--space-3);
gap: 12px;
height: 440px;
padding: 14px;
}
.historyList {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
width: 300px;
flex: none;
min-height: 0;
}
.historyItem {
display: flex;
gap: var(--space-2);
gap: 8px;
align-items: baseline;
width: 100%;
min-width: 0;
@@ -1263,7 +1263,7 @@
}
.sqlCompletionOption {
display: flex;
gap: var(--space-3);
gap: 12px;
align-items: center;
width: 100%;
padding: 4px 8px;
@@ -1346,7 +1346,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
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: var(--space-0-5);
gap: 2px;
padding: 2px 4px;
border: 1px solid var(--border-popup, var(--border));
border-radius: var(--radius-small);
+1 -2
Переглянути файл
@@ -149,8 +149,7 @@ export function DatabaseView() {
if (!st.treeReveal) return;
const path = st.treeReveal.path;
const frame = requestAnimationFrame(() => {
// Spread + reverse instead of toReversed(), which needs Safari 16.4 (the floor is 15.4).
[...path].reverse().some((key) => tree.current?.reveal(key));
path.toReversed().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: var(--space-2) var(--space-4);
gap: 8px 16px;
padding: 8px 12px;
border-bottom: 1px solid var(--border);
}
@@ -25,14 +25,14 @@
min-width: 0;
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
}
.title,
.totals {
display: flex;
flex-wrap: wrap;
align-items: baseline;
column-gap: var(--space-3);
column-gap: 12px;
min-width: 0;
}
.label {
@@ -56,7 +56,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
}
.compare {
width: 200px;
@@ -126,7 +126,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
padding: 4px 8px;
border-bottom: 1px solid var(--border);
}
@@ -138,7 +138,7 @@
.note {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 8px 12px;
color: var(--fg-subtle);
}
@@ -177,7 +177,7 @@
display: grid;
grid-template-columns: var(--heap-columns);
align-items: center;
column-gap: var(--space-3);
column-gap: 12px;
width: 100%;
}
.head {
@@ -252,7 +252,7 @@
min-width: 0;
display: flex;
align-items: center;
gap: var(--space-3);
gap: 12px;
}
.treeRow > :first-child {
flex: 1;
@@ -274,7 +274,7 @@
.object {
display: inline-flex;
align-items: baseline;
gap: var(--space-2);
gap: 8px;
min-width: 0;
max-width: 100%;
overflow: hidden;
@@ -336,5 +336,5 @@
.openProgress {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
}
+4 -4
Переглянути файл
@@ -6,7 +6,7 @@
padding: 6px 12px 8px;
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
}
.title {
@@ -31,13 +31,13 @@
.groups {
display: flex;
flex-wrap: wrap;
gap: var(--space-1) 20px;
gap: 4px 20px;
}
.group {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
}
.groupTitle {
@@ -49,6 +49,6 @@
.row {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 22px;
}
+5 -5
Переглянути файл
@@ -9,7 +9,7 @@
.toolbar {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 4px 8px;
border-bottom: 1px solid var(--border);
}
@@ -23,7 +23,7 @@
.categories {
display: flex;
flex: none;
gap: var(--space-0-5);
gap: 2px;
}
.category {
@@ -49,7 +49,7 @@
.actions {
display: flex;
gap: var(--space-1);
gap: 4px;
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: var(--space-2);
gap: 8px;
padding: 0 8px;
align-items: center;
min-height: 22px;
@@ -159,7 +159,7 @@
.header {
display: flex;
gap: var(--space-2);
gap: 8px;
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: var(--space-1-5);
gap: 6px;
min-height: 24px;
padding: 0 8px 0 12px;
}
@@ -76,7 +76,7 @@
min-width: 0;
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
padding: 10px 12px;
}
@@ -126,7 +126,7 @@
.actions {
display: flex;
gap: var(--space-2);
gap: 8px;
}
.note {
+3 -3
Переглянути файл
@@ -12,7 +12,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
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: var(--space-2);
gap: 8px;
padding: 4px 12px;
font-size: var(--fs-ui);
}
@@ -95,7 +95,7 @@
}
.message {
gap: var(--space-2);
gap: 8px;
color: var(--fg-subtle);
}
+6 -6
Переглянути файл
@@ -12,7 +12,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
padding: 4px 8px;
border-bottom: 1px solid var(--border);
}
@@ -52,7 +52,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-3);
gap: 12px;
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: var(--space-3);
column-gap: 12px;
width: 100%;
}
@@ -106,7 +106,7 @@
flex: 1;
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
min-width: 0;
height: 100%;
padding: 0;
@@ -161,7 +161,7 @@
.className {
display: flex;
align-items: baseline;
gap: var(--space-2);
gap: 8px;
min-width: 0;
font-family: var(--font-mono);
}
@@ -223,7 +223,7 @@
display: flex;
flex-wrap: wrap;
align-items: baseline;
column-gap: var(--space-3);
column-gap: 12px;
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: var(--space-0-5);
gap: 2px;
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: var(--space-0-5);
gap: 2px;
flex: none;
}
@@ -112,7 +112,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 0 8px;
border-radius: var(--radius-small);
text-align: left;
@@ -180,7 +180,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
padding: 0 4px 0 12px;
border-bottom: 1px solid var(--border);
}
@@ -190,7 +190,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
}
.prompt {
@@ -231,7 +231,7 @@
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 4px 0;
border-right: 1px solid var(--border);
}
+1 -1
Переглянути файл
@@ -11,7 +11,7 @@
.item {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
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: var(--space-1);
gap: 4px;
}
.label {
@@ -26,13 +26,13 @@
padding: 10px 12px;
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
}
.bpTitle {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
color: var(--fg-emphasis);
font-weight: 500;
}
@@ -71,14 +71,14 @@
.bpFooter {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
margin-top: 2px;
}
.link {
display: inline-flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
color: var(--accent);
font-size: var(--fs-ui);
cursor: pointer;
@@ -108,7 +108,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 0 8px 0 12px;
border-bottom: 1px solid var(--border-popup);
}
@@ -122,7 +122,7 @@
.chooserRow {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-width: 0;
width: 100%;
padding: 0 8px;
@@ -185,7 +185,7 @@
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--space-1) var(--space-2);
gap: 4px 8px;
}
/* Grows with the dialog when it is resized. */
@@ -211,7 +211,7 @@
padding: 6px 12px 8px;
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
}
.exceptionsTitle {
font-size: var(--fs-small);
@@ -226,7 +226,7 @@
.exceptionGroup {
display: flex;
flex-direction: column;
gap: var(--space-0-5);
gap: 2px;
}
.exceptionAdapter {
font-size: var(--fs-small);
@@ -260,7 +260,7 @@
.evalInputRow {
display: flex;
align-items: flex-start;
gap: var(--space-1);
gap: 4px;
}
.evalInput {
flex: 1;
+11 -11
Переглянути файл
@@ -10,7 +10,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 0 6px;
}
.serverSelect {
@@ -42,14 +42,14 @@
display: flex;
flex-direction: column;
align-items: flex-start;
gap: var(--space-2);
gap: 8px;
padding: 10px;
}
.center {
display: flex;
align-items: center;
justify-content: center;
gap: var(--space-2);
gap: 8px;
padding: 16px;
color: var(--fg-subtle);
}
@@ -72,7 +72,7 @@
.report {
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
}
.reportErrors {
margin: 0;
@@ -98,7 +98,7 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-3);
gap: 12px;
padding: 10px 16px;
flex: none;
}
@@ -111,7 +111,7 @@
.sync {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
height: 100%;
min-height: 0;
padding: 8px 10px 0;
@@ -121,7 +121,7 @@
flex-wrap: wrap;
align-items: center;
flex: none;
gap: var(--space-1);
gap: 4px;
}
.separator {
height: 20px;
@@ -151,7 +151,7 @@
.fileFilter {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
white-space: nowrap;
}
.compareBy select {
@@ -179,7 +179,7 @@
.comparisonRoots > span {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
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: var(--space-1-5);
gap: 6px;
overflow: hidden;
text-overflow: ellipsis;
}
@@ -315,7 +315,7 @@
display: flex;
align-items: flex-start;
flex-direction: column;
gap: var(--space-3);
gap: 12px;
}
/* SSH password prompt */
+3 -3
Переглянути файл
@@ -8,7 +8,7 @@
.header {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
}
.login {
color: var(--fg-strong);
@@ -34,7 +34,7 @@
.row {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
width: 100%;
min-width: 0;
}
@@ -68,7 +68,7 @@
display: flex;
align-items: center;
justify-content: center;
gap: var(--space-2);
gap: 8px;
}
.muted {
color: var(--fg-subtle);
+15 -15
Переглянути файл
@@ -21,7 +21,7 @@
flex-direction: column;
align-items: center;
justify-content: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 0;
padding: 12px;
text-align: center;
@@ -44,7 +44,7 @@
.textLink {
display: inline-flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
min-width: 0;
padding: 0;
border: none;
@@ -73,7 +73,7 @@
display: flex;
flex: none;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
padding: 8px 12px;
}
@@ -97,7 +97,7 @@
display: flex;
flex: none;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 8px 8px 0;
}
.headRepo > :last-child {
@@ -128,7 +128,7 @@
.headRow {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: 100%;
padding: 0 8px;
overflow: hidden;
@@ -157,7 +157,7 @@
display: flex;
flex: none;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
max-height: 50%;
padding: 2px 12px 8px;
overflow: auto;
@@ -165,7 +165,7 @@
.commitsHeader {
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
min-height: 28px;
}
.commitsTitle {
@@ -177,12 +177,12 @@
.commitInfo {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
}
.commitTop {
display: flex;
align-items: flex-start;
gap: var(--space-2);
gap: 8px;
}
.commitTop > .textLink {
flex: none;
@@ -213,7 +213,7 @@
.fileRow {
display: inline-flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
min-width: 0;
white-space: nowrap;
}
@@ -297,7 +297,7 @@
.userItem {
display: inline-flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
}
/* Status and the option button */
@@ -312,19 +312,19 @@
.status {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
max-width: 100%;
}
.statusRow {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-width: 0;
}
.statusText {
display: inline-flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
min-width: 0;
}
.ellipsis {
@@ -375,7 +375,7 @@
.dialogForm {
display: flex;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
}
.dialogLabel {
color: var(--fg);
+18 -18
Переглянути файл
@@ -16,7 +16,7 @@
flex-direction: column;
align-items: center;
justify-content: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 0;
padding: 12px;
color: var(--fg-secondary);
@@ -46,7 +46,7 @@
display: inline-flex;
flex: none;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
align-self: flex-start;
max-width: 100%;
padding: 0;
@@ -74,13 +74,13 @@
display: flex;
flex: none;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
padding: 16px 14px 16px 16px;
}
.titleRow {
display: flex;
align-items: flex-start;
gap: var(--space-2);
gap: 8px;
}
.title {
flex: 1;
@@ -110,7 +110,7 @@
flex: none;
align-items: center;
justify-content: space-between;
gap: var(--space-2);
gap: 8px;
min-width: 0;
padding: 0 14px 4px 16px;
}
@@ -118,13 +118,13 @@
display: flex;
flex: none;
align-items: center;
gap: var(--space-1);
gap: 4px;
padding: 6px 0 5px;
}
.branch {
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
min-width: 0;
padding: 6px 0 5px;
}
@@ -162,7 +162,7 @@
.advertiser {
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
margin-top: 4px;
padding: 5px 10px;
border-top: 1px solid var(--border);
@@ -198,7 +198,7 @@
.commitRow {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: 100%;
margin: 0 6px;
padding: 0 8px;
@@ -226,7 +226,7 @@
display: flex;
flex: 1;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
min-width: 0;
}
@@ -235,13 +235,13 @@
display: flex;
flex: none;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
padding: 0 14px 12px 16px;
}
.commitInfoTop {
display: flex;
align-items: flex-start;
gap: var(--space-2);
gap: 8px;
}
.commitInfoTitle {
flex: 1;
@@ -279,7 +279,7 @@
display: flex;
flex: 1;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
white-space: nowrap;
}
@@ -309,7 +309,7 @@
.counter {
display: inline-flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
color: var(--fg-secondary);
}
.readSlot {
@@ -365,7 +365,7 @@
.statusRow {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-width: 0;
padding: 5px 0;
}
@@ -404,7 +404,7 @@
.progressText {
display: inline-flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
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: var(--space-2);
gap: 8px;
width: var(--submit-width);
min-width: 320px;
height: var(--submit-height);
@@ -477,5 +477,5 @@
display: flex;
flex: none;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
+1 -1
Переглянути файл
@@ -29,6 +29,6 @@
.page {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
padding: 4px 0;
}
+5 -5
Переглянути файл
@@ -42,7 +42,7 @@
display: flex;
flex: 1;
align-items: center;
gap: var(--space-1);
gap: 4px;
min-width: 0;
padding: 2px 10px 4px;
margin-bottom: -2px;
@@ -92,7 +92,7 @@
.chipMain {
display: inline-flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
height: 100%;
max-width: 200px;
padding: 0 4px 0 6px;
@@ -170,7 +170,7 @@
.right {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
}
.left {
@@ -211,7 +211,7 @@
display: inline-flex;
flex: none;
align-items: center;
gap: var(--space-1);
gap: 4px;
padding-right: 1px;
color: var(--fg);
font-variant-numeric: tabular-nums;
@@ -259,7 +259,7 @@
.balloonRow {
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
height: 24px;
white-space: nowrap;
}
+1 -1
Переглянути файл
@@ -16,7 +16,7 @@
display: inline-flex;
align-items: center;
justify-content: center;
gap: var(--space-1);
gap: 4px;
height: 22px;
min-width: 22px;
padding: 0 3px;
+3 -3
Переглянути файл
@@ -44,7 +44,7 @@
.commits {
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
}
.commit {
display: flex;
@@ -65,7 +65,7 @@
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-1);
gap: 4px;
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: var(--space-1);
gap: 4px;
}
.composer {
padding: 10px 16px;
+17 -17
Переглянути файл
@@ -31,7 +31,7 @@
display: flex;
flex: 1;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
min-width: 0;
max-width: var(--gh-content-width, 42em);
}
@@ -41,7 +41,7 @@
.header {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-height: 20px;
}
.title {
@@ -49,7 +49,7 @@
flex: 1;
flex-wrap: wrap;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-width: 0;
}
.author {
@@ -68,7 +68,7 @@
display: flex;
flex: none;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
margin-left: auto;
}
.tag {
@@ -109,7 +109,7 @@
.status {
display: flex;
gap: var(--space-2);
gap: 8px;
min-width: 0;
}
.status::before {
@@ -149,7 +149,7 @@
display: flex;
flex: 1;
flex-direction: column;
gap: var(--space-1-5);
gap: 6px;
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: var(--space-3);
gap: 12px;
}
.hints {
display: flex;
flex-wrap: wrap;
gap: var(--space-3);
gap: 12px;
min-width: 0;
color: var(--fg-secondary);
font-size: var(--fs-small);
}
.buttons {
display: flex;
gap: var(--space-2);
gap: 8px;
}
.mentions {
max-height: 240px;
@@ -205,7 +205,7 @@
.mention {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 2px 8px;
white-space: nowrap;
cursor: pointer;
@@ -219,12 +219,12 @@
.reactions {
display: flex;
flex-wrap: wrap;
gap: var(--space-2);
gap: 8px;
}
.pill {
display: inline-flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
height: 24px;
padding: 0 8px 0 6px;
border: 1px solid transparent;
@@ -279,7 +279,7 @@
.threadContent {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
}
.preview {
display: -webkit-box;
@@ -300,7 +300,7 @@
.fileHeader {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 28px;
padding: 2px 6px 2px 10px;
}
@@ -364,7 +364,7 @@
.foldedReplies {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
}
.compactFooter {
display: flex;
@@ -393,7 +393,7 @@
display: flex;
align-items: center;
justify-content: space-between;
gap: var(--space-2);
gap: 8px;
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: var(--space-2);
gap: 8px;
width: 450px;
padding: 10px;
}
+59 -4
Переглянути файл
@@ -18,11 +18,25 @@
.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: var(--space-1-5);
gap: 6px;
height: 100%;
color: var(--fg-secondary);
}
@@ -36,18 +50,24 @@
.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: var(--space-2);
gap: 8px;
padding: 12px;
}
.selectorRow {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
}
.error {
color: var(--danger);
@@ -59,7 +79,7 @@
display: flex;
flex: none;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-height: 26px;
padding: 0 6px 0 10px;
border-bottom: 1px solid var(--border);
@@ -76,3 +96,38 @@
}
/* 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;
}
+10 -5
Переглянути файл
@@ -87,7 +87,7 @@
display: inline-flex;
flex: none;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
max-width: 100%;
color: var(--fg);
white-space: nowrap;
@@ -120,7 +120,7 @@
.chooserRow {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: 100%;
padding: 0 8px;
overflow: hidden;
@@ -152,7 +152,7 @@
display: flex;
flex: none;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
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: var(--space-1-5);
gap: 6px;
min-height: 0;
padding: 16px;
color: var(--fg-secondary);
@@ -242,9 +242,14 @@
.form {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
padding: 14px;
}
.formRow {
display: flex;
align-items: center;
gap: 10px;
}
.fieldLabel {
color: var(--fg-secondary);
font-size: var(--fs-small);
+9 -6
Переглянути файл
@@ -14,7 +14,7 @@
display: flex;
flex-direction: column;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 4px 0;
border-right: 1px solid var(--border);
}
@@ -40,7 +40,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
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: var(--space-1-5);
gap: 6px;
padding-right: 10px;
white-space: nowrap;
}
@@ -68,6 +68,9 @@
.ok {
color: var(--success);
}
.code {
font-weight: 600;
}
.result {
height: 100%;
display: flex;
@@ -79,7 +82,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 0 10px;
white-space: nowrap;
border-bottom: 1px solid var(--border);
@@ -132,7 +135,7 @@
.editorToolbar {
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
height: var(--h-header);
padding: 0 8px;
background: var(--bg-editor);
@@ -269,7 +272,7 @@
.envToolbar {
flex: none;
display: flex;
gap: var(--space-0-5);
gap: 2px;
padding: 2px 4px;
border-bottom: 1px solid var(--border);
}
+5 -5
Переглянути файл
@@ -19,7 +19,7 @@
.toolbar {
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
height: var(--h-header);
padding: 0 8px;
background: var(--bg-editor);
@@ -45,7 +45,7 @@
.entry {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
height: var(--h-list-row);
padding: 0 8px;
border: none;
@@ -66,7 +66,7 @@
.runningRow {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
height: var(--h-list-row);
padding: 0 8px;
color: var(--fg-secondary);
@@ -112,7 +112,7 @@
.statusLine {
display: flex;
align-items: center;
gap: var(--space-3);
gap: 12px;
height: var(--h-header);
padding: 0 8px;
flex: none;
@@ -195,7 +195,7 @@
.pendingLine {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
color: var(--fg-secondary);
}
.pendingRequest {
+2 -2
Переглянути файл
@@ -10,7 +10,7 @@
flex: none;
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
padding: 4px 8px;
border-bottom: 1px solid var(--border);
background: var(--bg-elev);
@@ -53,7 +53,7 @@
left: 0;
width: 100%;
display: flex;
gap: var(--space-2);
gap: 8px;
padding: 0 8px;
box-sizing: border-box;
white-space: pre-wrap;
+4 -4
Переглянути файл
@@ -1,5 +1,5 @@
.status {
gap: var(--space-1-5);
gap: 6px;
}
.dot {
width: 8px;
@@ -10,14 +10,14 @@
.edit {
display: grid;
grid-template-columns: 220px 1fr;
gap: var(--space-3);
gap: 12px;
height: 300px;
padding: 14px;
}
.column {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
min-height: 0;
}
.list {
@@ -34,7 +34,7 @@
}
.buttons {
display: flex;
gap: var(--space-1-5);
gap: 6px;
}
.empty {
padding: 6px 8px;
+1 -5
Переглянути файл
@@ -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, externalHistory } from "@/editor/api";
import { cellEditorExtensions, embeddedEditorExtensions } 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,10 +97,6 @@ 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: var(--space-3);
gap: 12px;
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: var(--space-0-5);
gap: 2px;
min-height: 28px;
padding: 2px 6px;
background: var(--bg-elev, var(--bg-app));
@@ -202,7 +202,7 @@
.addBar {
display: flex;
justify-content: center;
gap: var(--space-2);
gap: 8px;
flex-wrap: wrap;
padding: 12px 16px 32px;
}
@@ -211,7 +211,7 @@
padding: 5px;
}
.toolbar {
gap: var(--space-0-5);
gap: 2px;
}
.interpreter {
max-width: 180px;
+6 -6
Переглянути файл
@@ -1,5 +1,5 @@
.indicator {
gap: var(--space-1-5);
gap: 6px;
}
.panel {
width: 380px;
@@ -23,7 +23,7 @@
align-items: center;
min-height: var(--h-list-row);
padding: 0 12px;
gap: var(--space-2);
gap: 8px;
}
.label {
color: var(--fg-secondary);
@@ -44,7 +44,7 @@
align-items: center;
min-height: var(--h-list-row);
padding: 0 12px;
gap: var(--space-2);
gap: 8px;
}
.groupTitle {
flex: 1;
@@ -64,7 +64,7 @@
.columns {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
}
.columns .groupTitle {
color: var(--fg-subtle);
@@ -109,7 +109,7 @@
}
.actions {
display: flex;
gap: var(--space-1-5);
gap: 6px;
padding: 8px 12px 2px;
justify-content: flex-end;
}
@@ -133,7 +133,7 @@
display: flex;
align-items: center;
padding: 0 4px 4px 12px;
gap: var(--space-1-5);
gap: 6px;
}
.overlayTitle {
flex: 1;
+3 -3
Переглянути файл
@@ -4,12 +4,12 @@
.array {
display: flex;
flex-direction: column;
gap: var(--space-3);
gap: 12px;
min-width: 0;
}
.field {
gap: var(--space-1);
gap: 4px;
}
.group h3 {
@@ -44,7 +44,7 @@
.buttons {
display: flex;
gap: var(--space-1-5);
gap: 6px;
flex-wrap: wrap;
}
+18 -18
Переглянути файл
@@ -1,7 +1,7 @@
.page {
display: flex;
flex-direction: column;
gap: var(--space-2);
gap: 8px;
min-width: 0;
height: 100%;
min-height: 420px;
@@ -9,7 +9,7 @@
.topBar {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
}
.side {
display: flex;
@@ -61,7 +61,7 @@
.groupHeader {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: var(--h-row);
padding: 0 12px;
color: var(--fg-muted);
@@ -73,7 +73,7 @@
.groupToggle {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
height: 100%;
padding: 0;
@@ -94,7 +94,7 @@
.notice {
display: flex;
align-items: flex-start;
gap: var(--space-1-5);
gap: 6px;
margin: 0 8px 4px;
padding: 6px 8px;
border-radius: var(--radius-small);
@@ -150,7 +150,7 @@
.row {
display: flex;
align-items: center;
gap: var(--space-1);
gap: 4px;
padding-right: 8px;
}
.row:hover {
@@ -187,7 +187,7 @@
.rowMeta {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
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: var(--space-0-5);
gap: 2px;
min-width: 0;
}
.detailTabs {
@@ -242,7 +242,7 @@
display: flex;
align-items: center;
flex-wrap: wrap;
gap: var(--space-2);
gap: 8px;
}
/* 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: var(--space-1-5);
gap: 6px;
}
.description {
margin: 10px 0 0;
@@ -284,7 +284,7 @@
.facts {
display: grid;
grid-template-columns: max-content minmax(0, 1fr);
gap: var(--space-0-5) var(--space-4);
gap: 2px 16px;
margin: 12px 0 0;
}
.facts dt {
@@ -379,7 +379,7 @@
display: flex;
flex-wrap: wrap;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
margin: 6px 0 0 26px;
}
@@ -409,7 +409,7 @@
.consentNotice {
display: flex;
align-items: center;
gap: var(--space-3);
gap: 12px;
justify-content: space-between;
padding: 8px 10px;
border: 1px solid var(--border);
@@ -435,7 +435,7 @@
.rowTitle {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
min-width: 0;
}
.rowDescription {
@@ -449,7 +449,7 @@
display: inline-flex;
flex: none;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
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: var(--space-2);
gap: 8px;
padding: 8px 10px;
color: var(--fg-muted);
}
@@ -541,13 +541,13 @@
flex: 1;
flex-direction: column;
justify-content: center;
gap: var(--space-0-5);
gap: 2px;
min-width: 0;
}
.intellijPluginHead {
display: flex;
align-items: center;
gap: var(--space-2);
gap: 8px;
min-width: 0;
}
.intellijPluginThemes {
+1 -1
Переглянути файл
@@ -104,7 +104,7 @@
.layout {
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
}
.body {
flex: 1;
+3 -3
Переглянути файл
@@ -8,7 +8,7 @@
.toolbar {
display: flex;
align-items: center;
gap: var(--space-0-5);
gap: 2px;
padding: 2px 6px;
border-bottom: 1px solid var(--border);
}
@@ -68,7 +68,7 @@
.listItem {
display: flex;
align-items: center;
gap: var(--space-1-5);
gap: 6px;
height: 24px;
padding: 0 8px;
cursor: default;
@@ -104,7 +104,7 @@
.field {
display: flex;
flex-direction: column;
gap: var(--space-1);
gap: 4px;
}
.fieldLabel {
Loaded 100 of 223 files, more files were not shown because too many files have changed in this diff. Show more