Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions ora/App/OraApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class AppState: ObservableObject {
@Published var showFinderIn: UUID?
@Published var isFloatingTabSwitchVisible: Bool = false
@Published var isFullscreen: Bool = false
@Published var isURLBarEditing: Bool = false
}

@main
Expand Down
2 changes: 1 addition & 1 deletion ora/App/OraCommands.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ struct OraCommands: Commands {
@AppStorage("ui.sidebar.hidden") private var isSidebarHidden: Bool = false
@AppStorage("ui.sidebar.position") private var sidebarPosition: SidebarPosition = .primary
@AppStorage("ui.toolbar.hidden") private var isToolbarHidden: Bool = false
@AppStorage("ui.toolbar.showfullurl") private var showFullURL: Bool = true
@AppStorage("ui.toolbar.showfullurl") private var showFullURL: Bool = false
@Environment(\.openWindow) private var openWindow

var body: some Commands {
Expand Down
34 changes: 34 additions & 0 deletions ora/Core/Utilities/URLDisplayUtils.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import Foundation

struct URLDisplayParts {
let host: String
let title: String?
}

enum URLDisplayUtils {
static func displayString(url: URL, title: String, showFull: Bool) -> String {
let parts = displayParts(url: url, title: title, showFull: showFull)
if let title = parts.title {
return "\(parts.host) / \(title)"
}
return parts.host
}

static func displayParts(url: URL, title: String, showFull: Bool) -> URLDisplayParts {
if showFull {
return URLDisplayParts(host: url.absoluteString, title: nil)
}

var host = url.host ?? url.absoluteString
if host.hasPrefix("www.") {
host = String(host.dropFirst(4))
}

let trimmedTitle = title.trimmingCharacters(in: .whitespaces)
if trimmedTitle.isEmpty {
return URLDisplayParts(host: host, title: nil)
}

return URLDisplayParts(host: host, title: trimmedTitle)
}
}
1 change: 0 additions & 1 deletion ora/Features/Browser/Components/CopiedURLOverlay.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ struct CopiedURLOverlay: View {

var body: some View {
HStack {
Image(systemName: "link")
Text("Copied Current URL")
}
.font(.system(size: 14))
Expand Down
Loading
Loading