Skip to content

Commit

Permalink
Rename CommandPalleteView and CommandPalleteViewModel classes (CodeEd…
Browse files Browse the repository at this point in the history
…itApp#1655)

* Renamed the CommandPalleteView class to QuickActionsView to stay consistent with Xcode naming conventions

* Renamed the CommandPalleteViewModel class to QuickActionsViewModel to stay consistent with Xcode naming conventions

* Changed name of CommandPalette class to QuickActions in comment header

Co-authored-by: Austin Condiff <[email protected]>

---------

Co-authored-by: Austin Condiff <[email protected]>
  • Loading branch information
2 people authored and FastestMolasses committed Apr 11, 2024
1 parent d22d7c6 commit 6637776
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
16 changes: 8 additions & 8 deletions CodeEdit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -243,8 +243,8 @@
58F2EB0D292FB2B0004A9BDE /* ThemeSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58F2EAE0292FB2B0004A9BDE /* ThemeSettings.swift */; };
58F2EB0E292FB2B0004A9BDE /* SoftwareUpdater.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58F2EAE1292FB2B0004A9BDE /* SoftwareUpdater.swift */; };
58F2EB1E292FB954004A9BDE /* Sparkle in Frameworks */ = {isa = PBXBuildFile; productRef = 58F2EB1D292FB954004A9BDE /* Sparkle */; };
58FD7608291EA1CB0051D6E4 /* CommandPaletteViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58FD7605291EA1CB0051D6E4 /* CommandPaletteViewModel.swift */; };
58FD7609291EA1CB0051D6E4 /* CommandPaletteView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58FD7607291EA1CB0051D6E4 /* CommandPaletteView.swift */; };
58FD7608291EA1CB0051D6E4 /* QuickActionsViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58FD7605291EA1CB0051D6E4 /* QuickActionsViewModel.swift */; };
58FD7609291EA1CB0051D6E4 /* QuickActionsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 58FD7607291EA1CB0051D6E4 /* QuickActionsView.swift */; };
5B241BF32B6DDBFF0016E616 /* IgnorePatternListItemView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B241BF22B6DDBFF0016E616 /* IgnorePatternListItemView.swift */; };
5B698A0A2B262FA000DE9392 /* SearchSettingsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B698A092B262FA000DE9392 /* SearchSettingsView.swift */; };
5B698A0D2B26327800DE9392 /* SearchSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 5B698A0C2B26327800DE9392 /* SearchSettings.swift */; };
Expand Down Expand Up @@ -785,8 +785,8 @@
58F2EADD292FB2B0004A9BDE /* AccountsSettings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AccountsSettings.swift; sourceTree = "<group>"; };
58F2EAE0292FB2B0004A9BDE /* ThemeSettings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ThemeSettings.swift; sourceTree = "<group>"; };
58F2EAE1292FB2B0004A9BDE /* SoftwareUpdater.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SoftwareUpdater.swift; sourceTree = "<group>"; };
58FD7605291EA1CB0051D6E4 /* CommandPaletteViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommandPaletteViewModel.swift; sourceTree = "<group>"; };
58FD7607291EA1CB0051D6E4 /* CommandPaletteView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CommandPaletteView.swift; sourceTree = "<group>"; };
58FD7605291EA1CB0051D6E4 /* QuickActionsViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QuickActionsViewModel.swift; sourceTree = "<group>"; };
58FD7607291EA1CB0051D6E4 /* QuickActionsView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = QuickActionsView.swift; sourceTree = "<group>"; };
5B241BF22B6DDBFF0016E616 /* IgnorePatternListItemView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = IgnorePatternListItemView.swift; sourceTree = "<group>"; };
5B698A092B262FA000DE9392 /* SearchSettingsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchSettingsView.swift; sourceTree = "<group>"; };
5B698A0C2B26327800DE9392 /* SearchSettings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchSettings.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2205,15 +2205,15 @@
58FD7604291EA1CB0051D6E4 /* ViewModels */ = {
isa = PBXGroup;
children = (
58FD7605291EA1CB0051D6E4 /* CommandPaletteViewModel.swift */,
58FD7605291EA1CB0051D6E4 /* QuickActionsViewModel.swift */,
);
path = ViewModels;
sourceTree = "<group>";
};
58FD7606291EA1CB0051D6E4 /* Views */ = {
isa = PBXGroup;
children = (
58FD7607291EA1CB0051D6E4 /* CommandPaletteView.swift */,
58FD7607291EA1CB0051D6E4 /* QuickActionsView.swift */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -3248,7 +3248,7 @@
6C7256D729A3D7D000C2D3E0 /* SplitViewControllerView.swift in Sources */,
B6EA1FE529DA33DB001BF195 /* ThemeModel.swift in Sources */,
B6EA200029DB7966001BF195 /* SettingsColorPicker.swift in Sources */,
58FD7609291EA1CB0051D6E4 /* CommandPaletteView.swift in Sources */,
58FD7609291EA1CB0051D6E4 /* QuickActionsView.swift in Sources */,
58A2E40C29C3975D005CB615 /* CEWorkspaceFileIcon.swift in Sources */,
587B9E8F29301D8F00AC7927 /* BitBucketUserRouter.swift in Sources */,
B66A4E5129C917D5004573B4 /* AboutWindow.swift in Sources */,
Expand Down Expand Up @@ -3486,7 +3486,7 @@
2806E9022979588B000040F4 /* Contributor.swift in Sources */,
58D01C98293167DC00C5B6B4 /* String+RemoveOccurrences.swift in Sources */,
5878DAA8291AE76700DD95A3 /* QuickOpenItem.swift in Sources */,
58FD7608291EA1CB0051D6E4 /* CommandPaletteViewModel.swift in Sources */,
58FD7608291EA1CB0051D6E4 /* QuickActionsViewModel.swift in Sources */,
B65B11042B09DB1C002852CF /* GitClient+Fetch.swift in Sources */,
5878DA872918642F00DD95A3 /* AcknowledgementsViewModel.swift in Sources */,
B6E41C7929DE02800088F9F4 /* AccountSelectionView.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import Foundation

/// Simple state class for command palette view. Contains currently selected command,
/// query text and list of filtered commands
final class CommandPaletteViewModel: ObservableObject {
final class QuickActionsViewModel: ObservableObject {

@Published var commandQuery: String = ""

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@

import SwiftUI

/// Command palette view
struct CommandPaletteView: View {
/// Quick actions view
struct QuickActionsView: View {

@Environment(\.colorScheme)
private var colorScheme: ColorScheme

@ObservedObject private var state: CommandPaletteViewModel
@ObservedObject private var state: QuickActionsViewModel

@ObservedObject private var commandManager: CommandManager = .shared

Expand All @@ -23,7 +23,7 @@ struct CommandPaletteView: View {

private let closePalette: () -> Void

init(state: CommandPaletteViewModel, closePalette: @escaping () -> Void) {
init(state: QuickActionsViewModel, closePalette: @escaping () -> Void) {
self.state = state
self.closePalette = closePalette
state.filteredCommands = commandManager.commands
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ final class CodeEditWindowController: NSWindowController, NSToolbarDelegate, Obs
} else {
let panel = SearchPanel()
self.commandPalettePanel = panel
let contentView = CommandPaletteView(state: state, closePalette: panel.close)
let contentView = QuickActionsView(state: state, closePalette: panel.close)
panel.contentView = NSHostingView(rootView: SettingsInjector { contentView })
window?.addChildWindow(panel, ordered: .above)
panel.makeKeyAndOrderFront(self)
Expand Down
2 changes: 1 addition & 1 deletion CodeEdit/Features/Documents/WorkspaceDocument.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ final class WorkspaceDocument: NSDocument, ObservableObject, NSToolbarDelegate {
var utilityAreaModel = UtilityAreaViewModel()
var searchState: SearchState?
var quickOpenViewModel: QuickOpenViewModel?
var commandsPaletteState: CommandPaletteViewModel?
var commandsPaletteState: QuickActionsViewModel?
var listenerModel: WorkspaceNotificationModel = .init()
var sourceControlManager: SourceControlManager?

Expand Down

0 comments on commit 6637776

Please sign in to comment.