UI update

This commit is contained in:
2025-08-18 20:55:21 +10:00
parent 192c67cc16
commit 164b39498b
2 changed files with 11 additions and 8 deletions
+6 -6
View File
@@ -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)
}
+5 -2
View File
@@ -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.