diff --git a/mobile/Heygo/Views/LinkDetailView.swift b/mobile/Heygo/Views/LinkDetailView.swift index 5262bb3..890e85a 100644 --- a/mobile/Heygo/Views/LinkDetailView.swift +++ b/mobile/Heygo/Views/LinkDetailView.swift @@ -107,13 +107,13 @@ struct LinkDetailView: View { VStack(alignment: .leading, spacing: 16) { headerSection tagsSection - analyticsSection customContentSection + analyticsSection changeHistorySection } .padding() } - .navigationTitle("link_details") + .navigationTitle("Link Details - \(link.alias)") .navigationBarTitleDisplayMode(.inline) .toolbar { ToolbarItem(placement: .navigationBarLeading) { @@ -170,8 +170,8 @@ struct LinkDetailView: View { .cornerRadius(6) } - // URL row (tappable if exists) - if let url = link.originalURL, !url.isEmpty { + // URL row (tappable if exists) - only show for non-custom links + if let url = link.originalURL, !url.isEmpty, link.linkTypeEnum != .custom { Button(action: { handlePrimaryOpen() }) { @@ -294,12 +294,12 @@ struct LinkDetailView: View { private var customContentSection: some View { Group { if link.linkTypeEnum == .custom, let text = link.text { - VStack(alignment: .leading) { + VStack(alignment: .leading, spacing: 6) { Text("content_preview") .font(.headline) MarkdownView(text: text) - .frame(maxHeight: 300) + .frame(maxWidth: .infinity, maxHeight: 300, alignment: .leading) .background(Color(.systemGray6)) .cornerRadius(8) } diff --git a/mobile/Heygo/Views/LinkListView.swift b/mobile/Heygo/Views/LinkListView.swift index 8485332..b1db1f7 100644 --- a/mobile/Heygo/Views/LinkListView.swift +++ b/mobile/Heygo/Views/LinkListView.swift @@ -17,7 +17,7 @@ struct LinkListView: View { NavigationView { VStack { // Search bar - SearchBar(text: $linkViewModel.searchText, + SearchBar(text: $linkViewModel.searchText, onCustomContentTap: { link in markdownLink = link showingMarkdownContent = true @@ -135,7 +135,7 @@ struct LinkListView: View { .sheet(isPresented: $showingFilterSheet) { FilterView().environmentObject(linkViewModel) } .sheet(item: $selectedLink) { link in LinkDetailView(link: link).environmentObject(linkViewModel) } .sheet(isPresented: $showingMarkdownContent) { if let markdownLink = markdownLink { MarkdownContentView(link: markdownLink) } } - .sheet(isPresented: $showingTemplateParameters) { + .sheet(isPresented: $showingTemplateParameters) { if let templateLink = templateLink { TemplateParameterView( link: templateLink, @@ -337,12 +337,15 @@ struct SearchBar: View { // Show markdown content for custom links linkViewModel.recordClick(for: first) onCustomContentTap(first) + text = "" // Clear search after navigation case .template: // Show template parameter input for template links onTemplateParameterInput(first) + text = "" // Clear search after navigation case .link: // Open URL directly for regular links linkViewModel.openLink(first) + text = "" // Clear search after navigation } } else if !text.isEmpty { // Attempt to open as raw URL alias? Optionally do nothing.