refactor: Clean up tag management UI and update project version
- Remove duplicate search functionality from BookmarkLabelsView - Update TagManagementView font sizes for better readability - Bump URLShare extension version to 13
This commit is contained in:
parent
4915a773d6
commit
f3f94f1cfe
@ -435,7 +435,7 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
CODE_SIGN_ENTITLEMENTS = URLShare/URLShare.entitlements;
|
CODE_SIGN_ENTITLEMENTS = URLShare/URLShare.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 13;
|
||||||
DEVELOPMENT_TEAM = 8J69P655GN;
|
DEVELOPMENT_TEAM = 8J69P655GN;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
INFOPLIST_FILE = URLShare/Info.plist;
|
INFOPLIST_FILE = URLShare/Info.plist;
|
||||||
@ -468,7 +468,7 @@
|
|||||||
buildSettings = {
|
buildSettings = {
|
||||||
CODE_SIGN_ENTITLEMENTS = URLShare/URLShare.entitlements;
|
CODE_SIGN_ENTITLEMENTS = URLShare/URLShare.entitlements;
|
||||||
CODE_SIGN_STYLE = Automatic;
|
CODE_SIGN_STYLE = Automatic;
|
||||||
CURRENT_PROJECT_VERSION = 1;
|
CURRENT_PROJECT_VERSION = 13;
|
||||||
DEVELOPMENT_TEAM = 8J69P655GN;
|
DEVELOPMENT_TEAM = 8J69P655GN;
|
||||||
GENERATE_INFOPLIST_FILE = YES;
|
GENERATE_INFOPLIST_FILE = YES;
|
||||||
INFOPLIST_FILE = URLShare/Info.plist;
|
INFOPLIST_FILE = URLShare/Info.plist;
|
||||||
|
|||||||
@ -16,7 +16,6 @@ struct BookmarkLabelsView: View {
|
|||||||
var body: some View {
|
var body: some View {
|
||||||
NavigationView {
|
NavigationView {
|
||||||
VStack(spacing: 12) {
|
VStack(spacing: 12) {
|
||||||
searchSection
|
|
||||||
availableLabelsSection
|
availableLabelsSection
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
@ -53,59 +52,7 @@ struct BookmarkLabelsView: View {
|
|||||||
|
|
||||||
// MARK: - View Components
|
// MARK: - View Components
|
||||||
|
|
||||||
@ViewBuilder
|
|
||||||
private var searchSection: some View {
|
|
||||||
VStack(spacing: 8) {
|
|
||||||
searchField
|
|
||||||
customTagSuggestion
|
|
||||||
}
|
|
||||||
.padding(.horizontal)
|
|
||||||
}
|
|
||||||
|
|
||||||
@ViewBuilder
|
|
||||||
private var searchField: some View {
|
|
||||||
TextField("Search or add new tag...", text: $viewModel.searchText)
|
|
||||||
.textFieldStyle(RoundedBorderTextFieldStyle())
|
|
||||||
.onSubmit {
|
|
||||||
Task {
|
|
||||||
await viewModel.addLabel(to: bookmarkId, label: viewModel.searchText)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ViewBuilder
|
|
||||||
private var customTagSuggestion: some View {
|
|
||||||
if !viewModel.searchText.isEmpty &&
|
|
||||||
!viewModel.filteredLabels.contains(where: { $0.name.lowercased() == viewModel.searchText.lowercased() }) {
|
|
||||||
HStack {
|
|
||||||
Text("Add new tag:")
|
|
||||||
.font(.caption)
|
|
||||||
.foregroundColor(.secondary)
|
|
||||||
Text(viewModel.searchText)
|
|
||||||
.font(.caption)
|
|
||||||
.fontWeight(.medium)
|
|
||||||
Spacer()
|
|
||||||
Button(action: {
|
|
||||||
Task {
|
|
||||||
await viewModel.addLabel(to: bookmarkId, label: viewModel.searchText)
|
|
||||||
}
|
|
||||||
}) {
|
|
||||||
HStack(spacing: 6) {
|
|
||||||
Image(systemName: "plus.circle.fill")
|
|
||||||
.font(.caption)
|
|
||||||
Text("Add")
|
|
||||||
.font(.caption)
|
|
||||||
.fontWeight(.medium)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
.foregroundColor(.accentColor)
|
|
||||||
}
|
|
||||||
.padding(.horizontal, 12)
|
|
||||||
.padding(.vertical, 12)
|
|
||||||
.background(Color.accentColor.opacity(0.1))
|
|
||||||
.cornerRadius(10)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@ViewBuilder
|
@ViewBuilder
|
||||||
private var availableLabelsSection: some View {
|
private var availableLabelsSection: some View {
|
||||||
@ -132,6 +79,7 @@ struct BookmarkLabelsView: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
.padding(.horizontal)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -93,18 +93,18 @@ struct TagManagementView: View {
|
|||||||
!selectedLabelsSet.contains(searchText.wrappedValue) {
|
!selectedLabelsSet.contains(searchText.wrappedValue) {
|
||||||
HStack {
|
HStack {
|
||||||
Text("Add new tag:")
|
Text("Add new tag:")
|
||||||
.font(.caption)
|
.font(.subheadline)
|
||||||
.foregroundColor(.secondary)
|
.foregroundColor(.secondary)
|
||||||
Text(searchText.wrappedValue)
|
Text(searchText.wrappedValue)
|
||||||
.font(.caption)
|
.font(.subheadline)
|
||||||
.fontWeight(.medium)
|
.fontWeight(.medium)
|
||||||
Spacer()
|
Spacer()
|
||||||
Button(action: onAddCustomTag) {
|
Button(action: onAddCustomTag) {
|
||||||
HStack(spacing: 6) {
|
HStack(spacing: 6) {
|
||||||
Image(systemName: "plus.circle.fill")
|
Image(systemName: "plus.circle.fill")
|
||||||
.font(.caption)
|
.font(.subheadline)
|
||||||
Text("Add")
|
Text("Add")
|
||||||
.font(.caption)
|
.font(.subheadline)
|
||||||
.fontWeight(.medium)
|
.fontWeight(.medium)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user