style: align translation text and reduce explanation size

This commit is contained in:
2026-10-18 11:48:39 +02:00
parent 5e504d00f9
commit cd47828ddb
3 changed files with 8 additions and 4 deletions
+1 -1
View File
@@ -140,7 +140,7 @@ Search for **Conjure Translate**, identified by its centered 🌏 icon, and open
With **OpenAI · gpt-6-luna**, enter the text first, then press Return or **Add context**. The original text stays visible while the search bar becomes a second input for the situation: where you encountered it, who said it to whom, or the intended tone. Press Return or **Translate** to send both inputs. Context is optional; Return with blank context translates without it, rather than swapping languages. OpenAI returns the translation first, followed by a one- or two-sentence explanation in the target language. Context helps resolve meaning, tone, and register; if the text conflicts with the situation, the explanation flags the mismatch instead of silently changing the meaning. Nothing is sent when advancing to the context step. With **OpenAI · gpt-6-luna**, enter the text first, then press Return or **Add context**. The original text stays visible while the search bar becomes a second input for the situation: where you encountered it, who said it to whom, or the intended tone. Press Return or **Translate** to send both inputs. Context is optional; Return with blank context translates without it, rather than swapping languages. OpenAI returns the translation first, followed by a one- or two-sentence explanation in the target language. Context helps resolve meaning, tone, and register; if the text conflicts with the situation, the explanation flags the mismatch instead of silently changing the meaning. Nothing is sent when advancing to the context step.
The translation uses the primary text color; OpenAI's explanation below the blank line uses dimmed secondary text to distinguish it from the translation. The translation uses 20-point primary text; OpenAI's explanation below the blank line uses 14-point dimmed secondary text. The original-text preview, translation, and explanation share a left edge.
When the translation is available, the action changes to **Copy**: press Return or click it to copy the full output (including OpenAI's explanation) and close Conjure. Command-C still copies selected output. Editing the current input clears the result; editing context keeps the original text. The action is disabled while translating. When the translation is available, the action changes to **Copy**: press Return or click it to copy the full output (including OpenAI's explanation) and close Conjure. Command-C still copies selected output. Editing the current input clears the result; editing context keeps the original text. The action is disabled while translating.
+6 -2
View File
@@ -142,6 +142,8 @@ final class TranslationController: NSViewController {
output.drawsBackground = false output.drawsBackground = false
output.textColor = SunsetPalette.text output.textColor = SunsetPalette.text
output.font = .systemFont(ofSize: 20) output.font = .systemFont(ofSize: 20)
output.textContainerInset = .zero
output.textContainer?.lineFragmentPadding = 0
output.setAccessibilityLabel("\(languageName(targetLanguage)) translation") output.setAccessibilityLabel("\(languageName(targetLanguage)) translation")
let scroll = NSScrollView() let scroll = NSScrollView()
scroll.documentView = output scroll.documentView = output
@@ -385,8 +387,10 @@ final class TranslationController: NSViewController {
.foregroundColor: SunsetPalette.text, .foregroundColor: SunsetPalette.text,
]) ])
if !myMemory, let separator = translation.range(of: "\n\n") { if !myMemory, let separator = translation.range(of: "\n\n") {
rendered.addAttribute(.foregroundColor, value: SunsetPalette.secondaryText, rendered.addAttributes([
range: NSRange(separator.upperBound..<translation.endIndex, in: translation)) .foregroundColor: SunsetPalette.secondaryText,
.font: NSFont.systemFont(ofSize: 14),
], range: NSRange(separator.upperBound..<translation.endIndex, in: translation))
} }
self.output.textStorage?.setAttributedString(rendered) self.output.textStorage?.setAttributedString(rendered)
self.setStatus("") self.setStatus("")
+1 -1
View File
@@ -11,4 +11,4 @@
- highlight markdown syntax - highlight markdown syntax
- allow images - allow images
- [x] put the border already in use on some elements around the emoji containers in the emoji picker. - [x] put the border already in use on some elements around the emoji containers in the emoji picker.
- [ ] improve on the conjure translation command - [x] improve on the conjure translation command