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
18 changes: 13 additions & 5 deletions Example/VoticeDemo/VoticeDemo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@
802F7E8B2E0F1A2500F1BDF6 /* HomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = "<group>"; };
802F7E8C2E0F1A2500F1BDF6 /* AppVoticeDemo.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppVoticeDemo.swift; sourceTree = "<group>"; };
8055AAC42EB0AB6300FF6DAE /* Localizable.xcstrings */ = {isa = PBXFileReference; lastKnownFileType = text.json.xcstrings; path = Localizable.xcstrings; sourceTree = "<group>"; };
805C23CB2E19684E00AB56D0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = Info.plist; sourceTree = "<group>"; };
805C23CB2E19684E00AB56D0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
805C23CC2E19685B00AB56D0 /* VoticeDemo-macOS-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "VoticeDemo-macOS-Info.plist"; sourceTree = SOURCE_ROOT; };
805C23CD2E19686400AB56D0 /* VoticeDemo-tvOS-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist; path = "VoticeDemo-tvOS-Info.plist"; sourceTree = SOURCE_ROOT; };
805C23CF2E1968CC00AB56D0 /* Poppins-Black.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; path = "Poppins-Black.ttf"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -194,8 +194,7 @@
802F7E8D2E0F1A2500F1BDF6 /* VoticeDemo */ = {
isa = PBXGroup;
children = (
802F7E8A2E0F1A2500F1BDF6 /* Assets.xcassets */,
805C23CB2E19684E00AB56D0 /* Info.plist */,
808BBED02EB7621800262E3E /* Resources */,
805C23CE2E1968BD00AB56D0 /* Shared */,
);
path = VoticeDemo;
Expand Down Expand Up @@ -258,6 +257,15 @@
path = App;
sourceTree = "<group>";
};
808BBED02EB7621800262E3E /* Resources */ = {
isa = PBXGroup;
children = (
802F7E8A2E0F1A2500F1BDF6 /* Assets.xcassets */,
805C23CB2E19684E00AB56D0 /* Info.plist */,
);
path = Resources;
sourceTree = "<group>";
};
/* End PBXGroup section */

/* Begin PBXNativeTarget section */
Expand Down Expand Up @@ -808,7 +816,7 @@
ENABLE_PREVIEWS = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = VoticeDemo/Info.plist;
INFOPLIST_FILE = VoticeDemo/Resources/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = VoticeDemo;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
Expand Down Expand Up @@ -842,7 +850,7 @@
ENABLE_PREVIEWS = YES;
ENABLE_USER_SCRIPT_SANDBOXING = NO;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_FILE = VoticeDemo/Info.plist;
INFOPLIST_FILE = VoticeDemo/Resources/Info.plist;
INFOPLIST_KEY_CFBundleDisplayName = VoticeDemo;
INFOPLIST_KEY_LSApplicationCategoryType = "public.app-category.developer-tools";
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ struct AppVoticeDemo: App {
WindowGroup {
HomeView()
#if os(macOS)
.frame(minWidth: 1200, minHeight: 720)
.frame(minWidth: 1280, minHeight: 720)
#endif
}
}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ The Votice management app for handling suggestions or issues and apps is availab
Add this line to your `Package.swift` dependencies:

```swift
.package(url: "https://github.com/artcc/votice-sdk", from: "1.0.16"),
.package(url: "https://github.com/artcc/votice-sdk", from: "1.0.17"),
```

Or via Xcode:
Expand Down
2 changes: 1 addition & 1 deletion Sources/Votice/Core/Extensions/View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ extension View {
#if !os(tvOS)
self.background {
Circle()
.fill(fillColor.opacity(0.75))
.fill(fillColor)
.glassEffect(
isInteractive ? .regular.interactive() : .regular,
in: .circle
Expand Down
24 changes: 23 additions & 1 deletion Sources/Votice/Core/Managers/ConfigurationManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,13 @@ final class ConfigurationManager: ConfigurationManagerProtocol, @unchecked Senda
private var _useLiquidGlass = true
private var _user = UserEntity(isPremium: false)
private var _optionalVisibleStatuses: Set<SuggestionStatusEntity> = [.accepted, .blocked, .rejected]
private var _width: CGFloat = 800
private var _height: CGFloat = 600

private let lock = NSLock()
private let _baseURL = "https://api.votice.app/api"
private let _configurationId = UUID().uuidString
private let _version = "1.0.16"
private let _version = "1.0.17"
private let _buildNumber = "1"

// MARK: - Public properties
Expand Down Expand Up @@ -120,6 +122,24 @@ final class ConfigurationManager: ConfigurationManagerProtocol, @unchecked Senda
}
}

var width: CGFloat {
get {
lock.withLock { _width }
}
set {
lock.withLock { _width = newValue }
}
}

var height: CGFloat {
get {
lock.withLock { _height }
}
set {
lock.withLock { _height = newValue }
}
}
Comment on lines +125 to +141

Copilot AI Nov 2, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The width and height properties are not declared in the ConfigurationManagerProtocol. These properties should be added to the protocol to maintain proper abstraction and ensure any implementations of this protocol include these properties.

Copilot uses AI. Check for mistakes.

var version: String {
_version
}
Expand Down Expand Up @@ -221,6 +241,8 @@ final class ConfigurationManager: ConfigurationManagerProtocol, @unchecked Senda
_showCompletedSeparately = false
_useLiquidGlass = false
_optionalVisibleStatuses = [.accepted, .blocked, .rejected]
_width = 800
_height = 600

LogManager.shared.devLog(.info, "ConfigurationManager: reset")
}
Expand Down
5 changes: 5 additions & 0 deletions Sources/Votice/Core/Models/SuggestionEntity.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public struct SuggestionEntity: Codable, Equatable, Identifiable, Sendable {
public let createdBy: String?
public let deviceId: String?
public let status: SuggestionStatusEntity?
public let progress: Int?
public let source: SuggestionSource?
public let voteCount: Int?
public let language: String?
Expand All @@ -47,6 +48,7 @@ public struct SuggestionEntity: Codable, Equatable, Identifiable, Sendable {
createdBy: String? = nil,
deviceId: String? = nil,
status: SuggestionStatusEntity? = nil,
progress: Int? = nil,
source: SuggestionSource? = nil,
commentCount: Int? = nil,
voteCount: Int? = nil,
Expand All @@ -67,6 +69,7 @@ public struct SuggestionEntity: Codable, Equatable, Identifiable, Sendable {
self.createdBy = createdBy
self.deviceId = deviceId
self.status = status
self.progress = progress
self.source = source
self.commentCount = commentCount
self.voteCount = voteCount
Expand Down Expand Up @@ -108,6 +111,7 @@ extension SuggestionEntity {
createdBy: String? = nil,
deviceId: String? = nil,
status: SuggestionStatusEntity? = nil,
progress: Int? = nil,
source: SuggestionSource? = nil,
commentCount: Int? = nil,
voteCount: Int? = nil,
Expand All @@ -129,6 +133,7 @@ extension SuggestionEntity {
createdBy: createdBy ?? self.createdBy,
deviceId: deviceId ?? self.deviceId,
status: status ?? self.status,
progress: progress ?? self.progress,
source: source ?? self.source,
commentCount: commentCount ?? self.commentCount,
voteCount: voteCount ?? self.voteCount,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ extension SuggestionDetailView {
.padding(.horizontal, 20)
Color.clear.focusable(true)
}
.frame(width: 1250)
.frame(width: ConfigurationManager.shared.width, height: ConfigurationManager.shared.height)
.background(
LinearGradient(
colors: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ extension SuggestionListView {
}
}
}
.frame(width: 1250)
.frame(width: ConfigurationManager.shared.width, height: ConfigurationManager.shared.height)
.task {
await viewModel.loadSuggestions()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ private extension SuggestionListView {
viewModel.addSuggestion(suggestion)
}
#if os(macOS)
.frame(minWidth: 800, minHeight: 600)
.frame(width: ConfigurationManager.shared.width, height: ConfigurationManager.shared.height)
#endif
}
}
Expand All @@ -113,7 +113,7 @@ private extension SuggestionListView {
}
}
#if os(macOS)
.frame(minWidth: 800, minHeight: 600)
.frame(width: ConfigurationManager.shared.width, height: ConfigurationManager.shared.height)
#endif
}
}
Expand Down
49 changes: 23 additions & 26 deletions Sources/Votice/Votice.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,6 @@
import Foundation
import SwiftUI

// swiftlint:disable line_length
#if os(tvOS)
#warning("Votice SDK is currently only supported on iOS, iPadOS and macOS. Support for tvOS will be available in future releases.")
#endif
// swiftlint:enable line_length

// MARK: - Configuration

public struct Votice {
Expand Down Expand Up @@ -118,35 +112,35 @@ extension Votice {
/// Present the Votice feedback interface
/// - Parameters:
/// - theme: Custom theme for the UI (optional)
/// - minWidth: Minimum width for macOS (default 800)
/// - minHeight: Minimum height for macOS (default 600)
/// - width: width for macOS (default 800)
/// - height: height for macOS (default 600)
Comment on lines +115 to +116

Copilot AI Nov 2, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation comments are incomplete. They should read 'Width for macOS and tvOS' and 'Height for macOS and tvOS' since the parameters now apply to both platforms, as evidenced by the #if os(macOS) || os(tvOS) condition at line 392.

Copilot uses AI. Check for mistakes.
/// - Returns: A SwiftUI View that can be presented modally or embedded
public static func feedbackNavigationView(
theme: VoticeTheme? = nil,
minWidth: CGFloat = 800,
minHeight: CGFloat = 600
width: CGFloat = 800,
height: CGFloat = 600
) -> some View {
open(isNavigation: true, theme: theme, minWidth: minWidth, minHeight: minHeight)
open(isNavigation: true, theme: theme, width: width, height: height)
}

/// Present the Votice feedback interface as a standalone view
/// - Parameters:
/// - theme: Custom theme for the UI (optional)
/// - minWidth: Minimum width for macOS (default 800)
/// - minHeight: Minimum height for macOS (default 600)
/// - width: width for macOS (default 800)
/// - height: height for macOS (default 600)
Comment on lines +129 to +130

Copilot AI Nov 2, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation comments are incomplete. They should read 'Width for macOS and tvOS' and 'Height for macOS and tvOS' since the parameters now apply to both platforms, as evidenced by the #if os(macOS) || os(tvOS) condition at line 392.

Copilot uses AI. Check for mistakes.
/// - Returns: A SwiftUI View that can be used in any context
/// - Note: This view is suitable for embedding in your app's UI or presenting as a full-screen cover
public static func feedbackView(
theme: VoticeTheme? = nil,
minWidth: CGFloat = 800,
minHeight: CGFloat = 600
width: CGFloat = 800,
height: CGFloat = 600
) -> some View {
#if os(iOS) || os(macOS)
NavigationStack {
open(isNavigation: false, theme: theme, minWidth: minWidth, minHeight: minHeight)
open(isNavigation: false, theme: theme, width: width, height: height)
}
#elseif os(tvOS)
open(isNavigation: false, theme: theme, minWidth: minWidth, minHeight: minHeight)
open(isNavigation: false, theme: theme, width: width, height: height)
#endif
}
}
Expand All @@ -165,11 +159,7 @@ extension Votice {
surfaceColor: Color? = nil
) -> VoticeTheme {
// Use smart defaults if no colors are provided
createAdvancedTheme(
primaryColor: primaryColor,
backgroundColor: backgroundColor,
surfaceColor: surfaceColor
)
createAdvancedTheme(primaryColor: primaryColor, backgroundColor: backgroundColor, surfaceColor: surfaceColor)
}

/// Get a system theme that automatically adapts to the user's appearance preference
Expand Down Expand Up @@ -387,13 +377,20 @@ private extension Votice {
static func open(
isNavigation: Bool,
theme: VoticeTheme? = nil,
minWidth: CGFloat = 800,
minHeight: CGFloat = 600
width: CGFloat = 800,
height: CGFloat = 600
) -> some View {
SuggestionListView(isNavigation: isNavigation)
let widthValue = max(width, 800)
let heightValue = max(height, 600)

return SuggestionListView(isNavigation: isNavigation)
.voticeTheme(theme ?? .default)
.task {
ConfigurationManager.shared.width = widthValue
ConfigurationManager.shared.height = heightValue
}
#if os(macOS) || os(tvOS)
.frame(minWidth: minWidth, minHeight: minHeight)
.frame(width: widthValue, height: heightValue)
#endif
}
}
6 changes: 3 additions & 3 deletions Tests/VoticeTests/Managers/ConfigurationManagerTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct ConfigurationManagerTests {
#expect(manager.showCompletedSeparately == false)
#expect(manager.user.isPremium == false)
#expect(manager.optionalVisibleStatuses == [.accepted, .blocked, .rejected])
#expect(manager.version == "1.0.16")
#expect(manager.version == "1.0.17")
#expect(manager.buildNumber == "1")
}

Expand Down Expand Up @@ -138,7 +138,7 @@ struct ConfigurationManagerTests {

// ConfigurationId, version, and buildNumber should remain unchanged
#expect(!manager.configurationId.isEmpty)
#expect(manager.version == "1.0.16")
#expect(manager.version == "1.0.17")
#expect(manager.buildNumber == "1")
}

Expand Down Expand Up @@ -325,7 +325,7 @@ struct ConfigurationManagerTests {

// Test immutable properties
#expect(manager.baseURL == "https://api.votice.app/api")
#expect(manager.version == "1.0.16")
#expect(manager.version == "1.0.17")
#expect(manager.buildNumber == "1")

// Configuration ID should be consistent for same instance
Expand Down