Skip to content

chore(release): prepare 1.0.0#1

Merged
augarte merged 7 commits intomainfrom
codex/release-1.0.0
Feb 18, 2026
Merged

chore(release): prepare 1.0.0#1
augarte merged 7 commits intomainfrom
codex/release-1.0.0

Conversation

@augarte
Copy link
Copy Markdown
Owner

@augarte augarte commented Feb 18, 2026

What

  • Prepare SimpleLineChart for the 1.0.0 public release
  • Improve API robustness, docs, and release metadata

Why

  • Ensure the public package is stable and consistent for CocoaPods/SPM users

How

  • Fix API typo, make model properties public and immutable, and improve empty-state handling
  • Update README, podspec metadata, and add test coverage (non-UI)

Testing

  • Unit tests added/updated: Not run (per user)
  • Manual testing steps: Not run (per user)

Checklist

  • Code builds and runs locally (not run)
  • Tests added or updated (added)
  • No unnecessary files or debug code
  • Follows project architecture and style
  • PR is focused (no unrelated changes)

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request prepares SimpleLineChart for its 1.0.0 public release by improving API robustness, fixing bugs, and enhancing documentation.

Changes:

  • Fixed API typo (filterGraphPints → filterGraphPoints) and made model properties public and immutable
  • Improved empty state handling by creating a persistent view instead of recreating it on each draw
  • Enhanced period button layout by moving corner radius calculation to layoutSubviews and fixing a memory leak
  • Updated package metadata (license, Swift version, screenshots URLs) and improved README documentation
  • Added comprehensive unit tests for model classes and basic functionality

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 11 comments.

Show a summary per file
File Description
Tests/SimpleLineChartTests/SimpleLineChartTests.swift Added unit tests for data models, filtering, styling, and color utilities
Sources/SimpleLineChart/View/SimpleLineChart.swift Refactored empty state handling, period button layout, fixed typo in filterGraphPoints call, and improved initialization
Sources/SimpleLineChart/View/SLCPeriodButton.swift Fixed memory leak with weak self capture and moved corner radius to layoutSubviews
Sources/SimpleLineChart/Model/SLCPeriod.swift Made properties public and immutable (let)
Sources/SimpleLineChart/Model/SLCLineStyle.swift Made all properties public and immutable (let)
Sources/SimpleLineChart/Model/SLCDataSet.swift Made properties public, fixed typo in method name, used private(set) for mutable properties
Sources/SimpleLineChart/Model/SLCData.swift Made properties public and immutable (let)
Sources/SimpleLineChart/Model/SLCChartStyle.swift Made all properties public and immutable (let)
SimpleLineChart.podspec Updated license to MIT, changed Swift version to 5.1, updated screenshot URLs to absolute paths
README.md Improved formatting, added features/requirements sections, clarified usage examples, updated installation instructions
Package.swift Changed swift-tools-version from 5.7 to 5.1 for broader compatibility

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.


pod 'SimpleLineChart'
```ruby
pod 'SimpleLineChart', '1.0.0'
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

The CocoaPods installation specifies an exact version '1.0.0'. While this is acceptable, the standard practice is to allow semantic versioning (e.g., '~> 1.0' for compatible versions). This would allow users to automatically receive patch updates. However, if version pinning is intentional for stability, consider adding a comment explaining this choice.

Copilot uses AI. Check for mistakes.
var lineStyle: SLCLineStyle = SLCLineStyle()
public let graphPoints: [SLCData]
public private(set) var filteredGraphPoints: [SLCData] = []
public private(set) var lineStyle: SLCLineStyle = SLCLineStyle()
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

The lineStyle property is now public private(set), but it can still be reassigned via setLineStyle(). This creates an inconsistency where the property appears immutable from outside but can be changed through a method. Since SLCLineStyle properties are now immutable (all let), consider whether lineStyle should also be truly immutable (set only in init) or if the current design of allowing style changes is intentional. If mutable styling is required, the current approach is acceptable, but document this behavior clearly.

Copilot uses AI. Check for mistakes.
Comment on lines +6 to +83
func testSLCDataStoresValues() {
let data = SLCData(x: 10, y: 42.5)
XCTAssertEqual(data.x, 10)
XCTAssertEqual(data.y, 42.5)
}

func testSLCPeriodStoresValues() {
let period = SLCPeriod("Week", 604800)
XCTAssertEqual(period.name, "Week")
XCTAssertEqual(period.value, 604800)
}

func testDataSetInitializesFilteredPoints() {
let points = [SLCData(x: 1, y: 1.0), SLCData(x: 2, y: 2.0)]
let dataSet = SLCDataSet(graphPoints: points)
XCTAssertEqual(dataSet.filteredGraphPoints.count, points.count)
XCTAssertTrue(dataSet.filteredGraphPoints[0] === points[0])
XCTAssertTrue(dataSet.filteredGraphPoints[1] === points[1])
}

func testFilterGraphPointsKeepsRecentPoints() {
let now = Int(Date().timeIntervalSince1970)
let recent = SLCData(x: now - 60, y: 1.0)
let old = SLCData(x: now - 10_000, y: 2.0)
let dataSet = SLCDataSet(graphPoints: [old, recent])

dataSet.filterGraphPoints(period: SLCPeriod("1 Hour", 3600))

XCTAssertTrue(dataSet.filteredGraphPoints.contains { $0 === recent })
XCTAssertFalse(dataSet.filteredGraphPoints.contains { $0 === old })
}

func testFilterGraphPointsCanReturnEmpty() {
let now = Int(Date().timeIntervalSince1970)
let old = SLCData(x: now - 10, y: 2.0)
let dataSet = SLCDataSet(graphPoints: [old])

dataSet.filterGraphPoints(period: SLCPeriod("1 Second", 1))

XCTAssertTrue(dataSet.filteredGraphPoints.isEmpty)
}

func testSetLineStyleUpdatesStyle() {
let dataSet = SLCDataSet(graphPoints: [SLCData(x: 1, y: 1.0)])
let style = SLCLineStyle(lineColor: .black, lineStroke: 2.0, circleDiameter: 4.0)
dataSet.setLineStyle(style)
XCTAssertTrue(dataSet.lineStyle === style)
}

func testChartStyleDefaults() {
let style = SLCChartStyle()
XCTAssertTrue(style.backgroundGradient)
XCTAssertFalse(style.addPeriodButtons)
assertColor(style.solidBackgroundColor, red: component(0xFD), green: component(0x43), blue: component(0x45))
assertColor(style.gradientStartColor, red: component(0xFE), green: component(0xB7), blue: component(0x75))
assertColor(style.gradientEndColor, red: component(0xFD), green: component(0x43), blue: component(0x45))
}

func testLineStyleDefaults() {
let style = SLCLineStyle()
XCTAssertEqual(style.lineStroke, 5.0)
XCTAssertEqual(style.circleDiameter, 0.0)
XCTAssertTrue(style.lineShadow)
assertColor(style.lineColor, equals: .white)
assertColor(style.lineShadowgradientStart, red: component(0xFE), green: component(0xB7), blue: component(0x75))
assertColor(style.lineShadowgradientEnd, red: component(0xFD), green: component(0x43), blue: component(0x45))
}

func testHexStringToUIColorParsesValidHex() {
let color = UIColor.hexStringToUIColor(hex: "#FFFFFF")
assertColor(color, red: 1.0, green: 1.0, blue: 1.0)
}

func testHexStringToUIColorInvalidReturnsGray() {
let color = UIColor.hexStringToUIColor(hex: "INVALID")
assertColor(color, equals: .gray)
}
}
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

The test coverage focuses on model classes and basic functionality but lacks coverage for the main view logic including empty state handling, period button interactions, drawing logic, and layout behavior. Consider adding tests for: 1) updateEmptyStateVisibility behavior, 2) updatePeriodButtonsIfNeeded logic, 3) empty vs non-empty data set scenarios, and 4) the interaction between loadPoints/setChartStyle and view updates.

Copilot uses AI. Check for mistakes.
```swift
dependencies: [
.package(url: "https://github.com/augarte/SimpleLineChart.git", .upToNextMajor(from: "1.0.0"))
.package(url: "https://github.com/augarte/SimpleLineChart.git", .exact("1.0.0"))
Copy link

Copilot AI Feb 18, 2026

Choose a reason for hiding this comment

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

The documentation states to use .exact("1.0.0") for SPM dependencies. While this ensures version stability, it's uncommon and restrictive. Most Swift packages use semantic versioning with .upToNextMajor or .upToNextMinor to allow bug fixes and improvements. Consider documenting why exact versions are recommended, or use standard semantic versioning like .upToNextMajor(from: "1.0.0") instead.

Suggested change
.package(url: "https://github.com/augarte/SimpleLineChart.git", .exact("1.0.0"))
.package(url: "https://github.com/augarte/SimpleLineChart.git", .upToNextMajor(from: "1.0.0"))

Copilot uses AI. Check for mistakes.
@augarte augarte merged commit 2747ce1 into main Feb 18, 2026
@augarte augarte deleted the codex/release-1.0.0 branch February 18, 2026 17:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants