惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

G
Google Developers Blog
宝玉的分享
宝玉的分享
月光博客
月光博客
B
Blog
云风的 BLOG
云风的 BLOG
Google DeepMind News
Google DeepMind News
Engineering at Meta
Engineering at Meta
aimingoo的专栏
aimingoo的专栏
N
Netflix TechBlog - Medium
博客园_首页
GbyAI
GbyAI
人人都是产品经理
人人都是产品经理
A
About on SuperTechFans
Y
Y Combinator Blog
L
LangChain Blog
有赞技术团队
有赞技术团队
D
Docker
爱范儿
爱范儿
博客园 - 司徒正美
H
Hackread – Cybersecurity News, Data Breaches, AI and More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
酷 壳 – CoolShell
酷 壳 – CoolShell
Microsoft Security Blog
Microsoft Security Blog
D
DataBreaches.Net

Recent Commits to openclaw:main

test: merge chat side-result checks · openclaw/openclaw@ddd2c2a test: merge cron history checks · openclaw/openclaw@f7eb746 test: merge responsive navigation shell checks · openclaw/openclaw@c2e4b47 docs(changelog): add codex oauth fixes · openclaw/openclaw@628e6cd test: merge navigation routing cases · openclaw/openclaw@5d8cecb Tests: mock channel registry bundled fallback · openclaw/openclaw@2b08233 Secrets: avoid broad web search discovery for single plugin config · openclaw/openclaw@a464f59 test: merge config view browser checks · openclaw/openclaw@20cf511 fix(status): align oauth health with runtime · openclaw/openclaw@eed7116 test: merge chat context notice checks · openclaw/openclaw@5c2f4af feat: add macOS screen snapshots for monitor preview (#67954) thanks … · openclaw/openclaw@f377db1 fix: report shared auth scopes in hello-ok (#67810) thanks @BunsDev · openclaw/openclaw@0b6c39b Auto-reply: avoid eager bundled route fallback · openclaw/openclaw@3ea1bf4 Tests: narrow session binding contract setup · openclaw/openclaw@54e4e16 Tests: speed up channel setup promotion · openclaw/openclaw@82b529a Docs: refresh agent instructions · openclaw/openclaw@5775fe2 fix(auth): serialize OAuth refresh across agents to fix #26322 (#67876) · openclaw/openclaw@8e79080 test: allow ollama public surface boundary test · openclaw/openclaw@7d4f1a6 Docs: add test performance guardrails · openclaw/openclaw@89706d3 Tests: restore context-engine usage proof · openclaw/openclaw@e4c4f95 Tests: slim context engine runtime coverage · openclaw/openclaw@74c198f ci: retry failed custom checkouts · openclaw/openclaw@0ee5baf test: trim duplicate provider auth onboarding cases · openclaw/openclaw@1ffc02e matrix: fix sessions_spawn --thread subagent session spawning (#67643) · openclaw/openclaw@1ce2596 test: reduce auth choice fixture churn · openclaw/openclaw@857b9cd test: mock health status config boundaries · openclaw/openclaw@9d5ab4a test: mock onboard config io boundary · openclaw/openclaw@299694d test: mock legacy state plugin boundaries · openclaw/openclaw@2713089 test: mock channel install boundaries · openclaw/openclaw@b945248 test: mock doctor preview channel boundaries · openclaw/openclaw@b1a3ad4
fix(macOS): enable undo/redo in webchat composer text inp...
tylerbittner · 2026-04-17 · via Recent Commits to openclaw:main

@@ -444,34 +444,18 @@ private struct ChatComposerTextView: NSViewRepresentable {

444444

func makeCoordinator() -> Coordinator { Coordinator(self) }

445445446446

func makeNSView(context: Context) -> NSScrollView {

447-

let textView = ChatComposerNSTextView()

448-

textView.delegate = context.coordinator

449-

textView.drawsBackground = false

450-

textView.isRichText = false

451-

textView.isAutomaticQuoteSubstitutionEnabled = false

452-

textView.isAutomaticTextReplacementEnabled = false

453-

textView.isAutomaticDashSubstitutionEnabled = false

454-

textView.isAutomaticSpellingCorrectionEnabled = false

455-

textView.font = .systemFont(ofSize: 14, weight: .regular)

456-

textView.textContainer?.lineBreakMode = .byWordWrapping

457-

textView.textContainer?.lineFragmentPadding = 0

458-

textView.textContainerInset = NSSize(width: 2, height: 4)

459-

textView.focusRingType = .none

460-461-

textView.minSize = .zero

462-

textView.maxSize = NSSize(width: CGFloat.greatestFiniteMagnitude, height: CGFloat.greatestFiniteMagnitude)

463-

textView.isHorizontallyResizable = false

464-

textView.isVerticallyResizable = true

465-

textView.autoresizingMask = [.width]

466-

textView.textContainer?.containerSize = NSSize(width: 0, height: CGFloat.greatestFiniteMagnitude)

467-

textView.textContainer?.widthTracksTextView = true

447+

let textView = ChatComposerTextViewFactory.makeConfiguredTextView()

448+

guard let composerTextView = textView as? ChatComposerNSTextView else {

449+

preconditionFailure("ChatComposerTextViewFactory must return ChatComposerNSTextView")

450+

}

451+

composerTextView.delegate = context.coordinator

468452469-

textView.string = self.text

470-

textView.onSend = { [weak textView] in

471-

textView?.window?.makeFirstResponder(nil)

453+

composerTextView.string = self.text

454+

composerTextView.onSend = { [weak composerTextView] in

455+

composerTextView?.window?.makeFirstResponder(nil)

472456

self.onSend()

473457

}

474-

textView.onPasteImageAttachment = self.onPasteImageAttachment

458+

composerTextView.onPasteImageAttachment = self.onPasteImageAttachment

475459476460

let scroll = NSScrollView()

477461

scroll.drawsBackground = false

@@ -522,6 +506,34 @@ private struct ChatComposerTextView: NSViewRepresentable {

522506

}

523507

}

524508509+

enum ChatComposerTextViewFactory {

510+

// Internal for @testable import coverage of composer text view defaults.

511+

@MainActor

512+

static func makeConfiguredTextView() -> NSTextView {

513+

let textView = ChatComposerNSTextView()

514+

textView.drawsBackground = false

515+

textView.isRichText = false

516+

textView.isAutomaticQuoteSubstitutionEnabled = false

517+

textView.isAutomaticTextReplacementEnabled = false

518+

textView.isAutomaticDashSubstitutionEnabled = false

519+

textView.isAutomaticSpellingCorrectionEnabled = false

520+

textView.font = .systemFont(ofSize: 14, weight: .regular)

521+

textView.textContainer?.lineBreakMode = .byWordWrapping

522+

textView.textContainer?.lineFragmentPadding = 0

523+

textView.textContainerInset = NSSize(width: 2, height: 4)

524+

textView.focusRingType = .none

525+

textView.allowsUndo = true

526+

textView.minSize = .zero

527+

textView.maxSize = NSSize(width: CGFloat.greatestFiniteMagnitude, height: CGFloat.greatestFiniteMagnitude)

528+

textView.isHorizontallyResizable = false

529+

textView.isVerticallyResizable = true

530+

textView.autoresizingMask = [.width]

531+

textView.textContainer?.containerSize = NSSize(width: 0, height: CGFloat.greatestFiniteMagnitude)

532+

textView.textContainer?.widthTracksTextView = true

533+

return textView

534+

}

535+

}

536+525537

private final class ChatComposerNSTextView: NSTextView {

526538

var onSend: (() -> Void)?

527539

var onPasteImageAttachment: ((_ data: Data, _ fileName: String, _ mimeType: String) -> Void)?