From d420bfc4b7c1699b7df8a1eb6d295b1835a26108 Mon Sep 17 00:00:00 2001
From: Matthias Nott <mnott@mnsoft.org>
Date: Mon, 06 Apr 2026 15:36:25 +0200
Subject: [PATCH] fix: markdown links open in browser/app instead of copying to clipboard

---
 lib/widgets/message_bubble.dart |   12 +++++-------
 1 files changed, 5 insertions(+), 7 deletions(-)

diff --git a/lib/widgets/message_bubble.dart b/lib/widgets/message_bubble.dart
index 7a24e76..da6238a 100644
--- a/lib/widgets/message_bubble.dart
+++ b/lib/widgets/message_bubble.dart
@@ -5,6 +5,7 @@
 import 'package:flutter/material.dart';
 import 'package:flutter/services.dart';
 import 'package:flutter_markdown/flutter_markdown.dart';
+import 'package:url_launcher/url_launcher.dart';
 import 'package:intl/intl.dart';
 
 import '../models/message.dart';
@@ -165,13 +166,10 @@
       ),
       onTapLink: (text, href, title) {
         if (href != null) {
-          Clipboard.setData(ClipboardData(text: href));
-          ScaffoldMessenger.of(context).showSnackBar(
-            SnackBar(
-              content: Text('Link copied: $href'),
-              duration: const Duration(seconds: 2),
-            ),
-          );
+          final uri = Uri.tryParse(href);
+          if (uri != null) {
+            launchUrl(uri, mode: LaunchMode.externalApplication);
+          }
         }
       },
     );

--
Gitblit v1.3.1