Skip to content

Commit

Permalink
Renamed PathBar to JumpBar (#1957)
Browse files Browse the repository at this point in the history
* Renamed PathBar to JumpBar

* Renamed variables from pathBar to jumpBar
  • Loading branch information
austincondiff authored Jan 5, 2025
1 parent 8448cfa commit e760191
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 54 deletions.
30 changes: 15 additions & 15 deletions CodeEdit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -132,9 +132,9 @@
5878DAA6291AE76700DD95A3 /* OpenQuicklyPreviewView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5878DAA2291AE76700DD95A3 /* OpenQuicklyPreviewView.swift */; };
5878DAA7291AE76700DD95A3 /* OpenQuicklyViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5878DAA3291AE76700DD95A3 /* OpenQuicklyViewModel.swift */; };
5878DAA8291AE76700DD95A3 /* OpenQuicklyListItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5878DAA4291AE76700DD95A3 /* OpenQuicklyListItemView.swift */; };
5878DAB0291D627C00DD95A3 /* EditorPathBarMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5878DAAD291D627C00DD95A3 /* EditorPathBarMenu.swift */; };
5878DAB1291D627C00DD95A3 /* EditorPathBarComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5878DAAE291D627C00DD95A3 /* EditorPathBarComponent.swift */; };
5878DAB2291D627C00DD95A3 /* EditorPathBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5878DAAF291D627C00DD95A3 /* EditorPathBarView.swift */; };
5878DAB0291D627C00DD95A3 /* EditorJumpBarMenu.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5878DAAD291D627C00DD95A3 /* EditorJumpBarMenu.swift */; };
5878DAB1291D627C00DD95A3 /* EditorJumpBarComponent.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5878DAAE291D627C00DD95A3 /* EditorJumpBarComponent.swift */; };
5878DAB2291D627C00DD95A3 /* EditorJumpBarView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5878DAAF291D627C00DD95A3 /* EditorJumpBarView.swift */; };
58798218292D92370085B254 /* String+SafeOffset.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58798213292D92370085B254 /* String+SafeOffset.swift */; };
58798219292D92370085B254 /* SearchModeModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58798215292D92370085B254 /* SearchModeModel.swift */; };
5879821A292D92370085B254 /* SearchResultModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58798216292D92370085B254 /* SearchResultModel.swift */; };
Expand Down Expand Up @@ -827,9 +827,9 @@
5878DAA2291AE76700DD95A3 /* OpenQuicklyPreviewView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenQuicklyPreviewView.swift; sourceTree = "<group>"; };
5878DAA3291AE76700DD95A3 /* OpenQuicklyViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenQuicklyViewModel.swift; sourceTree = "<group>"; };
5878DAA4291AE76700DD95A3 /* OpenQuicklyListItemView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = OpenQuicklyListItemView.swift; sourceTree = "<group>"; };
5878DAAD291D627C00DD95A3 /* EditorPathBarMenu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EditorPathBarMenu.swift; sourceTree = "<group>"; };
5878DAAE291D627C00DD95A3 /* EditorPathBarComponent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EditorPathBarComponent.swift; sourceTree = "<group>"; };
5878DAAF291D627C00DD95A3 /* EditorPathBarView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EditorPathBarView.swift; sourceTree = "<group>"; };
5878DAAD291D627C00DD95A3 /* EditorJumpBarMenu.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EditorJumpBarMenu.swift; sourceTree = "<group>"; };
5878DAAE291D627C00DD95A3 /* EditorJumpBarComponent.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EditorJumpBarComponent.swift; sourceTree = "<group>"; };
5878DAAF291D627C00DD95A3 /* EditorJumpBarView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = EditorJumpBarView.swift; sourceTree = "<group>"; };
58798213292D92370085B254 /* String+SafeOffset.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "String+SafeOffset.swift"; sourceTree = "<group>"; };
58798215292D92370085B254 /* SearchModeModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchModeModel.swift; sourceTree = "<group>"; };
58798216292D92370085B254 /* SearchResultModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SearchResultModel.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1933,20 +1933,20 @@
path = ViewModels;
sourceTree = "<group>";
};
5878DAAB291D627C00DD95A3 /* PathBar */ = {
5878DAAB291D627C00DD95A3 /* JumpBar */ = {
isa = PBXGroup;
children = (
5878DAAC291D627C00DD95A3 /* Views */,
);
path = PathBar;
path = JumpBar;
sourceTree = "<group>";
};
5878DAAC291D627C00DD95A3 /* Views */ = {
isa = PBXGroup;
children = (
5878DAAD291D627C00DD95A3 /* EditorPathBarMenu.swift */,
5878DAAE291D627C00DD95A3 /* EditorPathBarComponent.swift */,
5878DAAF291D627C00DD95A3 /* EditorPathBarView.swift */,
5878DAAD291D627C00DD95A3 /* EditorJumpBarMenu.swift */,
5878DAAE291D627C00DD95A3 /* EditorJumpBarComponent.swift */,
5878DAAF291D627C00DD95A3 /* EditorJumpBarView.swift */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -2864,7 +2864,7 @@
6C147C3C29A328020089B630 /* Editor */ = {
isa = PBXGroup;
children = (
5878DAAB291D627C00DD95A3 /* PathBar */,
5878DAAB291D627C00DD95A3 /* JumpBar */,
287776EB27E350BA00D46668 /* TabBar */,
B67660642AA970ED00CD56B0 /* Models */,
B67660632AA970E300CD56B0 /* Views */,
Expand Down Expand Up @@ -4109,7 +4109,7 @@
58D01C9B293167DC00C5B6B4 /* CodeEditKeychainConstants.swift in Sources */,
B640A99E29E2184700715F20 /* SettingsForm.swift in Sources */,
B62AEDD12A27B264009A9F52 /* View+paneToolbar.swift in Sources */,
5878DAB1291D627C00DD95A3 /* EditorPathBarComponent.swift in Sources */,
5878DAB1291D627C00DD95A3 /* EditorJumpBarComponent.swift in Sources */,
B628B7B72B223BAD00F9775A /* FindModePicker.swift in Sources */,
587B9E6E29301D8F00AC7927 /* GitLabProject.swift in Sources */,
58798234292E30B90085B254 /* FeedbackIssueArea.swift in Sources */,
Expand Down Expand Up @@ -4476,7 +4476,7 @@
58D01C99293167DC00C5B6B4 /* String+MD5.swift in Sources */,
20EBB505280C329800F3A5DA /* CommitListItemView.swift in Sources */,
669A50512C380C1800304CD8 /* String+escapedWhiteSpaces.swift in Sources */,
5878DAB2291D627C00DD95A3 /* EditorPathBarView.swift in Sources */,
5878DAB2291D627C00DD95A3 /* EditorJumpBarView.swift in Sources */,
664935422C35A5BC00461C35 /* NSTableViewWrapper.swift in Sources */,
04BC1CDE2AD9B4B000A83EA5 /* EditorFileTabCloseButton.swift in Sources */,
6C6BD70129CD172700235D17 /* ExtensionsListView.swift in Sources */,
Expand All @@ -4501,7 +4501,7 @@
587B9E7229301D8F00AC7927 /* GitJSONPostRouter.swift in Sources */,
6C6362D42C3E321A0025570D /* Editor+History.swift in Sources */,
6C85BB412C21061A00EB5DEF /* GitHubComment.swift in Sources */,
5878DAB0291D627C00DD95A3 /* EditorPathBarMenu.swift in Sources */,
5878DAB0291D627C00DD95A3 /* EditorJumpBarMenu.swift in Sources */,
04BA7C242AE2E7CD00584E1C /* SourceControlNavigatorSyncView.swift in Sources */,
587B9DA529300ABD00AC7927 /* PressActionsModifier.swift in Sources */,
6C147C4029A328BC0089B630 /* SplitViewData.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//
// PathBar.swift
// CodeEditModules/PathBar
// EditorJumpBar.swift
// CodeEdit
//
// Created by Lukas Pistrol on 18.03.22.
//
Expand All @@ -9,7 +9,7 @@ import SwiftUI
import Combine
import CodeEditSymbols

struct EditorPathBarComponent: View {
struct EditorJumpBarComponent: View {
private let fileItem: CEWorkspaceFile
private let tappedOpenFile: (CEWorkspaceFile) -> Void
private let isLastItem: Bool
Expand Down Expand Up @@ -54,7 +54,7 @@ struct EditorPathBarComponent: View {
NSPopUpButtonView(selection: $selection) {
guard let fileManager = workspace.workspaceFileManager else { return NSPopUpButton() }

button.menu = EditorPathBarMenu(
button.menu = EditorJumpBarMenu(
fileItems: siblings,
fileManager: fileManager,
tappedOpenFile: tappedOpenFile
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//
// EditorPathBarMenu.swift
// CodeEditModules/PathBar
// EditorJumpBarMenu.swift
// CodeEdit
//
// Created by Ziyuan Zhao on 2022/3/29.
//

import AppKit

final class EditorPathBarMenu: NSMenu, NSMenuDelegate {
final class EditorJumpBarMenu: NSMenu, NSMenuDelegate {
private let fileItems: [CEWorkspaceFile]
private weak var fileManager: CEWorkspaceFileManager?
private let tappedOpenFile: (CEWorkspaceFile) -> Void
Expand All @@ -23,7 +23,7 @@ final class EditorPathBarMenu: NSMenu, NSMenuDelegate {
super.init(title: "")
delegate = self
fileItems.forEach { item in
let menuItem = PathBarMenuItem(fileItem: item, tappedOpenFile: tappedOpenFile)
let menuItem = JumpBarMenuItem(fileItem: item, tappedOpenFile: tappedOpenFile)
menuItem.onStateImage = nil
self.addItem(menuItem)
}
Expand All @@ -44,10 +44,10 @@ final class EditorPathBarMenu: NSMenu, NSMenuDelegate {
}
}

private func generateSubmenu(_ fileItem: CEWorkspaceFile) -> EditorPathBarMenu? {
private func generateSubmenu(_ fileItem: CEWorkspaceFile) -> EditorJumpBarMenu? {
if let fileManager = fileManager,
let children = fileManager.childrenOfFile(fileItem) {
let menu = EditorPathBarMenu(
let menu = EditorJumpBarMenu(
fileItems: children,
fileManager: fileManager,
tappedOpenFile: tappedOpenFile
Expand All @@ -58,7 +58,7 @@ final class EditorPathBarMenu: NSMenu, NSMenuDelegate {
}
}

final class PathBarMenuItem: NSMenuItem {
final class JumpBarMenuItem: NSMenuItem {
private let fileItem: CEWorkspaceFile
private let tappedOpenFile: (CEWorkspaceFile) -> Void
private let generalSettings = Settings.shared.preferences.general
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
//
// EditorPathBarView.swift
// CodeEditModules/PathBar
// EditorJumpBarView.swift
// CodeEdit
//
// Created by Lukas Pistrol on 17.03.22.
//

import SwiftUI

struct EditorPathBarView: View {
struct EditorJumpBarView: View {
private let file: CEWorkspaceFile?
private let shouldShowTabBar: Bool
private let tappedOpenFile: (CEWorkspaceFile) -> Void
Expand Down Expand Up @@ -58,7 +58,7 @@ struct EditorPathBarView: View {
)
} else {
ForEach(fileItems, id: \.self) { fileItem in
EditorPathBarComponent(
EditorJumpBarComponent(
fileItem: fileItem,
tappedOpenFile: tappedOpenFile,
isLastItem: fileItems.last == fileItem
Expand Down
12 changes: 6 additions & 6 deletions CodeEdit/Features/Editor/Views/EditorAreaView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import SwiftUI
import CodeEditTextView

struct EditorAreaView: View {
@AppSettings(\.general.showEditorPathBar)
var showEditorPathBar
@AppSettings(\.general.showEditorJumpBar)
var showEditorJumpBar

@AppSettings(\.navigation.navigationStyle)
var navigationStyle
Expand Down Expand Up @@ -43,8 +43,8 @@ struct EditorAreaView: View {

var editorInsetAmount: Double {
let tabBarHeight = shouldShowTabBar ? (EditorTabBarView.height + 1) : 0
let pathBarHeight = showEditorPathBar ? (EditorPathBarView.height + 1) : 0
return tabBarHeight + pathBarHeight
let jumpBarHeight = showEditorJumpBar ? (EditorJumpBarView.height + 1) : 0
return tabBarHeight + jumpBarHeight
}

VStack {
Expand Down Expand Up @@ -89,8 +89,8 @@ struct EditorAreaView: View {
.environmentObject(editor)
Divider()
}
if showEditorPathBar {
EditorPathBarView(
if showEditorJumpBar {
EditorJumpBarView(
file: editor.selectedTab?.file,
shouldShowTabBar: shouldShowTabBar
) { [weak editor] newFile in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import SwiftUI

struct InspectorAreaView: View {
@EnvironmentObject private var workspace: WorkspaceDocument

@ObservedObject private var extensionManager = ExtensionManager.shared
@ObservedObject public var viewModel: InspectorAreaViewModel

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct GeneralSettingsView: View {
Section {
appearance
fileIconStyle
showEditorPathBar
showEditorJumpBar
dimEditorsWithoutFocus
navigatorTabBarPosition
inspectorTabBarPosition
Expand Down Expand Up @@ -105,8 +105,8 @@ private extension GeneralSettingsView {
Toggle("Show Live Issues", isOn: $settings.showLiveIssues)
}

var showEditorPathBar: some View {
Toggle("Show Path Bar", isOn: $settings.showEditorPathBar)
var showEditorJumpBar: some View {
Toggle("Show Jump Bar", isOn: $settings.showEditorJumpBar)
}

var dimEditorsWithoutFocus: some View {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ extension SettingsData {
"Appearance",
"File Icon Style",
"Tab Bar Style",
"Show Path Bar",
"Show Jump Bar",
"Dim editors without focus",
"Navigator Tab Bar Position",
"Inspector Tab Bar Position",
Expand All @@ -51,8 +51,8 @@ extension SettingsData {
.map { NSLocalizedString($0, comment: "") }
}

/// Show editor path bar
var showEditorPathBar: Bool = true
/// Show editor jump bar
var showEditorJumpBar: Bool = true

/// Dims editors without focus
var dimEditorsWithoutFocus: Bool = false
Expand Down Expand Up @@ -115,9 +115,9 @@ extension SettingsData {
Bool.self,
forKey: .showLiveIssues
) ?? true
self.showEditorPathBar = try container.decodeIfPresent(
self.showEditorJumpBar = try container.decodeIfPresent(
Bool.self,
forKey: .showEditorPathBar
forKey: .showEditorJumpBar
) ?? true
self.dimEditorsWithoutFocus = try container.decodeIfPresent(
Bool.self,
Expand Down
8 changes: 4 additions & 4 deletions CodeEdit/Features/WindowCommands/ViewCommands.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ struct ViewCommands: Commands {
var editorFontSize
@AppSettings(\.terminal.font.size)
var terminalFontSize
@AppSettings(\.general.showEditorPathBar)
var showEditorPathBar
@AppSettings(\.general.showEditorJumpBar)
var showEditorJumpBar
@AppSettings(\.general.dimEditorsWithoutFocus)
var dimEditorsWithoutFocus

Expand Down Expand Up @@ -75,8 +75,8 @@ struct ViewCommands: Commands {

Divider()

Button("\(showEditorPathBar ? "Hide" : "Show") Path Bar") {
showEditorPathBar.toggle()
Button("\(showEditorJumpBar ? "Hide" : "Show") Jump Bar") {
showEditorJumpBar.toggle()
}

Toggle("Dim editors without focus", isOn: $dimEditorsWithoutFocus)
Expand Down
10 changes: 5 additions & 5 deletions Documentation.docc/App Window/App Window.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@ A collection of all the views that make up the main app window.
- ``ImageFileView``
- ``PDFFileView``

### PathBar
### JumpBar

- ``PathBarView``
- ``PathBarComponent``
- ``PathBarMenu``
- ``PathBarMenuItem``
- ``JumpBarView``
- ``JumpBarComponent``
- ``JumpBarMenu``
- ``JumpBarMenuItem``

### Navigator Sidebar

Expand Down

0 comments on commit e760191

Please sign in to comment.