Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions crates/tui/src/commands/groups/core/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -480,7 +480,7 @@ pub fn deepseek_links(app: &mut App) -> CommandResult {
if let Some(key_url) = links.key_url {
let _ = writeln!(
message,
"{} {}",
"{} `{}`",
tr(locale, MessageId::LinksDashboard),
key_url
);
Expand All @@ -494,7 +494,7 @@ pub fn deepseek_links(app: &mut App) -> CommandResult {
}
let _ = writeln!(
message,
"{} {}",
"{} `{}`",
tr(locale, MessageId::LinksDocs),
links.docs_url
);
Expand Down Expand Up @@ -1300,6 +1300,30 @@ mod tests {
assert!(result.action.is_none());
}

#[test]
fn provider_links_emit_urls_as_inline_code_for_narrow_transcripts() {
let mut app = create_test_app();
let result = deepseek_links(&mut app);
let msg = result.message.expect("links should return a message");

assert!(msg.contains("`https://platform.openai.com/api-keys`"));
assert!(
msg.contains(
"`https://platform.minimax.io/user-center/basic-information/interface-key`"
)
);

for line in msg.lines().filter(|line| line.contains("http")) {
let Some(url_start) = line.find("http") else {
continue;
};
assert!(
line[..url_start].ends_with('`') && line[url_start..].contains('`'),
"provider URL should be inline-code wrapped so narrow TUI renders do not emit oversized OSC8 link payloads: {line}"
);
}
}

#[test]
fn provider_link_fallback_uses_current_codewhale_docs() {
let links = provider_link_info("unknown-provider");
Expand Down
Loading