Default JSON log-line viewer nodes to collapsed
A log line whose text parses as JSON was rendering every nested node fully expanded, dumping large payloads into the timeline instead of a collapsed summary the user opts into expanding. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TeyhRfMYjMditek6geDRoQ
This commit is contained in:
co-authored by
Claude Sonnet 5
parent
49bfd6b020
commit
2cc8ac8138
+7
-7
@@ -22,28 +22,28 @@ struct Args {
|
||||
#[command(subcommand)]
|
||||
command: Option<Command>,
|
||||
|
||||
#[arg(long, default_value_t = 0)]
|
||||
#[arg(short, long, default_value_t = 0)]
|
||||
port: u16,
|
||||
|
||||
#[arg(long, help = SETTINGS_PATH_HELP.as_str())]
|
||||
#[arg(short, long, help = SETTINGS_PATH_HELP.as_str())]
|
||||
settings_path: Option<PathBuf>,
|
||||
|
||||
#[arg(long)]
|
||||
#[arg(short, long)]
|
||||
file: Option<PathBuf>,
|
||||
|
||||
#[arg(long)]
|
||||
#[arg(short, long)]
|
||||
metrics_url: Option<String>,
|
||||
|
||||
#[arg(long)]
|
||||
#[arg(short, long)]
|
||||
name: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Subcommand, Debug)]
|
||||
enum Command {
|
||||
Mcp {
|
||||
#[arg(long)]
|
||||
#[arg(short, long)]
|
||||
session: Option<String>,
|
||||
#[arg(long)]
|
||||
#[arg(short, long)]
|
||||
port: Option<u16>,
|
||||
},
|
||||
Sessions,
|
||||
|
||||
+14
-14
@@ -100,31 +100,31 @@ impl EngineHandle {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn spawn(settings: SettingsHandle, channel_capacity: usize) -> EngineHandle {
|
||||
/// Builds the handle/receiver/writer triple shared by `spawn` and, in tests, by callers that
|
||||
/// want the raw receiver without an actor loop draining it.
|
||||
fn new_channel_and_handle(
|
||||
channel_capacity: usize,
|
||||
) -> (EngineHandle, mpsc::Receiver<EngineMessage>, IndexWriter) {
|
||||
let (tx, rx) = mpsc::channel(channel_capacity);
|
||||
let (write, read) = left_right::new::<EngineSnapshot, EngineOp>();
|
||||
let reader = IndexReader {
|
||||
factory: read.factory(),
|
||||
};
|
||||
tokio::spawn(run(rx, settings, IndexWriter { handle: write }));
|
||||
EngineHandle { tx, reader }
|
||||
(EngineHandle { tx, reader }, rx, IndexWriter { handle: write })
|
||||
}
|
||||
|
||||
pub fn spawn(settings: SettingsHandle, channel_capacity: usize) -> EngineHandle {
|
||||
let (handle, rx, write) = new_channel_and_handle(channel_capacity);
|
||||
tokio::spawn(run(rx, settings, write));
|
||||
handle
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
pub(crate) fn test_handle(
|
||||
channel_capacity: usize,
|
||||
) -> (EngineHandle, mpsc::Receiver<EngineMessage>) {
|
||||
let (tx, rx) = mpsc::channel(channel_capacity);
|
||||
let (_write, read) = left_right::new::<EngineSnapshot, EngineOp>();
|
||||
(
|
||||
EngineHandle {
|
||||
tx,
|
||||
reader: IndexReader {
|
||||
factory: read.factory(),
|
||||
},
|
||||
},
|
||||
rx,
|
||||
)
|
||||
let (handle, rx, _write) = new_channel_and_handle(channel_capacity);
|
||||
(handle, rx)
|
||||
}
|
||||
|
||||
async fn run(
|
||||
|
||||
Reference in New Issue
Block a user