fix: move session picker to composer
This commit is contained in:
@@ -619,16 +619,26 @@ fn advertised_config_options(
|
||||
.iter()
|
||||
.any(|option| matches!(option.category, Some(SessionConfigOptionCategory::Mode)));
|
||||
if let Some(models) = models.filter(|_| !has_model) {
|
||||
let choices = models
|
||||
let mut choices = models
|
||||
.available_models
|
||||
.iter()
|
||||
.map(|model| {
|
||||
let mut option =
|
||||
SessionConfigSelectOption::new(model.model_id.clone(), &model.name);
|
||||
if model.model_id == "default" {
|
||||
option.name = "Opus (default)".into();
|
||||
}
|
||||
option.description.clone_from(&model.description);
|
||||
option
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
if !models
|
||||
.available_models
|
||||
.iter()
|
||||
.any(|model| model.model_id == "fable")
|
||||
{
|
||||
choices.push(SessionConfigSelectOption::new("fable", "Fable"));
|
||||
}
|
||||
options.push(
|
||||
SessionConfigOption::select(
|
||||
LEGACY_MODEL_CONFIG_ID,
|
||||
|
||||
@@ -208,6 +208,17 @@ async fn advertised_settings_are_normalized_and_mutable() {
|
||||
assert!(initial
|
||||
.iter()
|
||||
.any(|option| option.id.0.as_ref() == "__maestro_legacy_mode"));
|
||||
let model = initial
|
||||
.iter()
|
||||
.find(|option| option.id.0.as_ref() == "__maestro_legacy_model")
|
||||
.expect("legacy model option");
|
||||
let model = serde_json::to_value(model).unwrap();
|
||||
assert_eq!(model["options"][0]["name"], "Opus");
|
||||
assert!(model["options"]
|
||||
.as_array()
|
||||
.unwrap()
|
||||
.iter()
|
||||
.any(|option| option["value"] == "fable"));
|
||||
|
||||
let changed = session
|
||||
.set_config(
|
||||
|
||||
@@ -72,11 +72,6 @@ export function createStructuredConnection(
|
||||
<header class="attach-header">
|
||||
<button type="button" class="btn btn-ghost btn-icon sessions-btn" aria-label="Show sessions" title="Show sessions">☰</button>
|
||||
<span class="attach-title" title="${paneTitleAttr(sessionId, info)}">${paneTitleHtml(sessionId, info)}</span>
|
||||
<div class="structured-config" hidden>
|
||||
<button type="button" class="structured-config-trigger" aria-haspopup="true"
|
||||
aria-expanded="false"><span class="structured-config-summary">Session settings</span><span class="structured-config-caret" aria-hidden="true"></span></button>
|
||||
<div class="structured-config-menu" role="group" aria-label="Session settings" hidden></div>
|
||||
</div>
|
||||
<span class="attach-state" data-state="connecting">connecting…</span>
|
||||
<button class="btn btn-ghost btn-icon disconnect" type="button" aria-label="Disconnect" title="Disconnect this session">⏻</button>
|
||||
</header>
|
||||
@@ -93,6 +88,11 @@ export function createStructuredConnection(
|
||||
autocomplete="off" aria-autocomplete="list" aria-expanded="false"
|
||||
aria-controls="structured-command-menu-${sessionId}"></textarea>
|
||||
</div>
|
||||
<div class="structured-config" hidden>
|
||||
<button type="button" class="structured-config-trigger" aria-haspopup="true"
|
||||
aria-expanded="false"><span class="structured-config-summary">Session settings</span><span class="structured-config-caret" aria-hidden="true"></span></button>
|
||||
<div class="structured-config-menu" role="group" aria-label="Session settings" hidden></div>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary structured-send">Send</button>
|
||||
<button type="button" class="btn structured-cancel" hidden>Cancel turn</button>
|
||||
</form>
|
||||
|
||||
+27
-4
@@ -2175,13 +2175,13 @@ input.leaf-rename:focus {
|
||||
|
||||
.structured-config {
|
||||
position: relative;
|
||||
flex: 0 1 300px;
|
||||
flex: 0 1 210px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.structured-config-trigger {
|
||||
width: 100%;
|
||||
height: 26px;
|
||||
height: var(--control-h);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: var(--sp-2);
|
||||
@@ -2231,7 +2231,7 @@ input.leaf-rename:focus {
|
||||
.structured-config-menu {
|
||||
position: absolute;
|
||||
z-index: 20;
|
||||
top: calc(100% + var(--sp-2));
|
||||
bottom: calc(100% + var(--sp-2));
|
||||
right: 0;
|
||||
width: min(320px, 86vw);
|
||||
padding: var(--sp-2);
|
||||
@@ -2286,6 +2286,20 @@ input.leaf-rename:focus {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.attach.structured,
|
||||
.attach.structured .attach-title,
|
||||
.structured-input {
|
||||
font-family: var(--font-sans);
|
||||
}
|
||||
|
||||
.st-row-agent code,
|
||||
.st-tool-text,
|
||||
.st-tool-detail pre,
|
||||
.st-diff,
|
||||
.st-approval-path {
|
||||
font-family: var(--font-mono);
|
||||
}
|
||||
|
||||
.structured-main {
|
||||
min-width: 0;
|
||||
min-height: 0;
|
||||
@@ -2788,10 +2802,19 @@ input.leaf-rename:focus {
|
||||
border-radius: var(--r-2);
|
||||
background: var(--bg);
|
||||
color: var(--ink);
|
||||
font-family: var(--font-mono);
|
||||
font-size: var(--fs-13);
|
||||
}
|
||||
|
||||
@media (max-width: 520px) {
|
||||
.structured-config {
|
||||
flex-basis: 132px;
|
||||
}
|
||||
|
||||
.structured-config-menu {
|
||||
right: calc(-1 * (var(--control-h) + var(--sp-3)));
|
||||
}
|
||||
}
|
||||
|
||||
.structured-command-menu {
|
||||
position: absolute;
|
||||
z-index: var(--z-sticky);
|
||||
|
||||
Reference in New Issue
Block a user