fix(翻译优化):优化点击预览
deploy-hxtesting / build-and-deploy (push) Successful in 1m14s

This commit is contained in:
runny committed 2026-12-01 00:53:46 +08:00
1 parent 2048251eff
commit 8c3d0ee31c
3 files changed
+14 -4

No files matched your search

+8 -2
View File
@@ -206,12 +206,18 @@ func (t *XlsxTranslateTool) Execute(ctx context.Context, args json.RawMessage) (
logger.Infof(ctx, "[Tool][XlsxTranslate] session=%s file=%s -> %s units=%d residual=%d llm_calls=%d",
sessionID, source, deliverable, report.TranslatedUnits, report.ResidualCJKCount, report.LLMCalls)
// The file name is written as a Markdown link whose destination is the
// canonical sandbox:<name> spelling. The stream handler rebinds that
// destination to the artifact's stable reference (resource:// handle, or
// sandbox:<name> without a catalog), so the file name inside the answer
// itself renders clickable — clicking opens the translated workbook.
fileLink := "[" + outName + "](sandbox:" + outName + ")"
var b strings.Builder
switch {
case len(outputLinks) > 0:
b.WriteString("Translation finished. The English workbook **" + outName + "** is saved in the output directory (available as a downloadable artifact).\n\n")
b.WriteString("Translation finished. The English workbook " + fileLink + " is saved in the output directory (available as a downloadable artifact).\n\n")
case attached:
b.WriteString("Translation finished. The English workbook **" + outName + "** is attached to this reply as a file card — open it to see details and download.\n\n")
b.WriteString("Translation finished. The English workbook " + fileLink + " is attached to this reply — click the file name or the file card to view details and download.\n\n")
default:
b.WriteString("Translation finished. Download the English workbook **" + outName + "** here: " + deliverable + "\n\n")
}