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
11 changes: 9 additions & 2 deletions .github/ISSUE_TEMPLATE/bug_report.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ body:
label: Describe the bug..
description: Also tell us, what did you expect to happen?
placeholder: Tell us what you see!
value: "A bug happened!"
validations:
required: true
- type: textarea
Expand Down Expand Up @@ -44,10 +43,18 @@ body:
- label: visionOS
validations:
required: true
- type: input
id: version
attributes:
label: Which ProgressUI version are you using?
description: The release tag, or the commit SHA if building from a branch.
placeholder: "1.2.0"
validations:
required: true
- type: input
id: xcode
attributes:
label: What Xcode version do you use?
placeholder: "16.0"
placeholder: "26.0"
validations:
required: true
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@ _Select all that apply:_
- [ ] Other: ___

**Test Configuration**
- OS: `iOS 18`
- OS: `iOS 26`
- Device: `iPhone 16`
- Environment: `Simulator, Xcode 15`
- Environment: `Simulator, Xcode 26`
- Additional notes: `e.g. Dark mode, background refresh, etc.`
- ---

---

## πŸ“Ž Checklist
Please confirm the following before requesting review:
Expand Down
57 changes: 51 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,64 @@ name: Build & Test

on:
pull_request:
branches: [main, develop]
# `develop` is only ever reached via PR (already tested above), so build on
# push for `main` only β€” release merges/tags. Avoids double runs per merge.
push:
branches: [main]

# Least-privilege GITHUB_TOKEN β€” these jobs only check out and build.
permissions:
contents: read

# Cancel superseded runs for the same ref (e.g. rapid pushes to an open PR).
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
test:
name: SwiftPM build & test
runs-on: macos-latest

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Show Xcode version
- name: Show toolchain versions
run: |
xcodebuild -version
swift --version

- name: Build Swift Package
run: swift build --build-tests
- name: Build
run: swift build

- name: Test
run: swift test

platforms:
name: Build (${{ matrix.name }})
runs-on: macos-latest
strategy:
fail-fast: false
matrix:
include:
- name: iOS
destination: 'generic/platform=iOS Simulator'
- name: macOS
destination: 'platform=macOS'
- name: macCatalyst
destination: 'platform=macOS,variant=Mac Catalyst'
- name: watchOS
destination: 'generic/platform=watchOS Simulator'
- name: tvOS
destination: 'generic/platform=tvOS Simulator'
- name: visionOS
destination: 'generic/platform=visionOS Simulator'
steps:
- uses: actions/checkout@v4

- name: Build ProgressUI for ${{ matrix.name }}
run: |
set -o pipefail
xcodebuild build \
-scheme ProgressUI \
-destination '${{ matrix.destination }}'
49 changes: 49 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Documentation

on:
push:
branches: [main]
workflow_dispatch:

# Allow the workflow to publish to GitHub Pages.
permissions:
contents: read
pages: write
id-token: write

# Only one Pages deployment at a time; cancel superseded runs.
concurrency:
group: pages
cancel-in-progress: true

jobs:
build:
name: Build DocC
runs-on: macos-latest
steps:
- uses: actions/checkout@v4

- name: Generate documentation
run: |
swift package --allow-writing-to-directory ./docs \
generate-documentation \
--target ProgressUI \
--disable-indexing \
--transform-for-static-hosting \
--hosting-base-path ProgressUI \
--output-path ./docs

- uses: actions/upload-pages-artifact@v3
with:
path: ./docs

deploy:
name: Deploy to Pages
needs: build
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v4
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,13 @@ DerivedData/
.swiftpm/configuration/registries.json
.swiftpm/xcode/package.xcworkspace/contents.xcworkspacedata
.netrc
# Resolved versions β€” library does not pin a lockfile for consumers.
Package.resolved
# Generated DocC site (built and deployed by the Documentation workflow).
/docs
# Claude Code local state.
.claude/scheduled_tasks.lock
# Personal/local files (e.g. CLAUDE.local.md, *.local.json) β€” not shared.
*.local.*
# Tech-debt MCP report output (generated, not part of the project).
/td
67 changes: 67 additions & 0 deletions .swiftpm/xcode/xcshareddata/xcschemes/ProgressUI.xcscheme
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1640"
version = "1.7">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
buildArchitectures = "Automatic">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
buildForRunning = "YES"
buildForProfiling = "YES"
buildForArchiving = "YES"
buildForAnalyzing = "YES">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "ProgressUI"
BuildableName = "ProgressUI"
BlueprintName = "ProgressUI"
ReferencedContainer = "container:">
</BuildableReference>
</BuildActionEntry>
</BuildActionEntries>
</BuildAction>
<TestAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES"
shouldAutocreateTestPlan = "YES">
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
launchStyle = "0"
useCustomWorkingDirectory = "NO"
ignoresPersistentStateOnLaunch = "NO"
debugDocumentVersioning = "YES"
debugServiceExtension = "internal"
allowLocationSimulation = "YES">
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
shouldUseLaunchSchemeArgsEnv = "YES"
savedToolIdentifier = ""
useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES">
<MacroExpansion>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "ProgressUI"
BuildableName = "ProgressUI"
BlueprintName = "ProgressUI"
ReferencedContainer = "container:">
</BuildableReference>
</MacroExpansion>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>
40 changes: 40 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Changelog

All notable changes to this project are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [1.1.0] - 2026-05-31

### Added
- Public memberwise initializer for `Options`, allowing consumers to construct
a configuration directly (e.g. `Options(progressColor: .blue)`) instead of
only through the `set…` modifiers.
- Unit test target (`ProgressUITests`) covering `Options` defaults, the new
initializer, `Progressable.calculate(from:)` bucketing, and `GrowDirection`
alignment mapping.
- DocC catalog with a landing page and curated topics.
- DocC documentation published to GitHub Pages via a Documentation workflow
(using `swift-docc-plugin`).
- Contribution guide, issue/PR templates, and a `CHANGELOG`.

### Changed
- CI now runs the test suite and builds across every supported platform
(iOS, macOS, macCatalyst, watchOS, tvOS, visionOS), and avoids redundant
runs (push builds `main` only; superseded runs are cancelled).

### Fixed
- Corrected the README "Dynamic Colors" and "Customization Options" examples,
which previously did not compile.
- Resolved DocC symbol-link warnings in the `Options.size`/`setSize(_:)` size
tables and the `GrowDirection.end` default links; DocC now builds cleanly.

### Security
- Set a least-privilege `GITHUB_TOKEN` (`contents: read`) on the Build & Test
workflow, resolving the CodeQL `actions/missing-workflow-permissions` alerts.

[Unreleased]: https://github.com/PierreJanineh-com/ProgressUI/compare/1.1.0...HEAD
[1.1.0]: https://github.com/PierreJanineh-com/ProgressUI/compare/1.0.4...1.1.0
48 changes: 48 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# ProgressUI

SwiftUI library providing a customizable circular/linear progress indicator. Distributed as a Swift Package (SPM).

## Build & verify

```bash
swift build # build the library
swift test # run the ProgressUITests suite
swift build -c release # release build
xcodebuild -scheme ProgressUI -destination 'generic/platform=iOS Simulator' build
```

Unit tests live in `Tests/ProgressUITests/` (XCTest). To exercise UI changes interactively, open `Example/Example.xcodeproj` (iOS/macOS/watchOS targets) and run the `Example` scheme.

> If a bare `swift build`/`swift test` fails with an SDK/compiler mismatch (e.g. "failed to build module 'Darwin'… SDK is built with a different Swift version"), the `swift` on `PATH` is an older standalone toolchain (e.g. swiftly) that doesn't match the Xcode SDK. Run via Xcode's toolchain instead: `xcrun swift build` / `xcrun swift test`.

## Layout

- `Package.swift` β€” single library target `ProgressUI`. Supports iOS 14+, macOS 11+, macCatalyst 14+, watchOS 7+, tvOS 15+, visionOS 1+. Any new API must be available on all of these.
- `Sources/ProgressUI/`
- `Components/ProgressUI/` β€” public entry point.
- `ProgressUI.swift` β€” the `ProgressUI` SwiftUI `View`.
- `ProgressUI+Modifiers.swift` β€” fluent `.option(...)` style modifiers.
- `ProgressUI+ViewModel.swift` β€” internal observable state.
- `Components/BaseProgress.swift` β€” shared shape/animation scaffolding.
- `Components/CircularProgress.swift`, `LinearProgress.swift` β€” the two `Shape` implementations selected via `Options.shape`.
- `Options.swift` β€” the single configuration struct passed into `ProgressUI`.
- `Progressable.swift` β€” protocol consumers implement to drive dynamic coloring (`color`, optional `innerColor`, `calculate(from:)`).
- `Shape.swift`, `GrowDirection.swift`, `ProgressSize.swift` β€” small enums used by `Options`.
- `Example/` β€” multi-platform sample app demonstrating usage.

## Conventions

- Public API surface is `ProgressUI`, `Options`, `Progressable`, `Shape`, `GrowDirection`, `ProgressSize`. Treat changes to these as semver-relevant.
- Configuration flows through `Options` β€” prefer adding a field there over adding new initializers on `ProgressUI`.
- State-driven coloring is opt-in via the generic `statusType:` parameter taking a `Progressable.Type`.
- Keep view-extension files (`ProgressUI+*.swift`) split by concern rather than collapsing into the main view file.

## Branching & releases (Git Flow)

- `main` β€” stable, release-only. Every commit on `main` corresponds to a tagged release; never commit feature work directly here.
- `develop` β€” the integration branch. All day-to-day work merges here first.
- `feature/*` β€” branch off `develop`, merge back into `develop` via PR. CI (build + test across all platforms) must be green before merge.
- `release/*` β€” cut from `develop` when preparing a version: bump the version, finalize `CHANGELOG.md`, then merge into both `main` (tagged) and `develop`.
- `hotfix/*` β€” branch off `main` for urgent fixes, merge into both `main` (tagged) and `develop`.
- Tag releases with semantic versions (`MAJOR.MINOR.PATCH`); public-API changes to the types above drive the version bump. Update `CHANGELOG.md` under `[Unreleased]` as you go.
- Open PRs against `develop` (not `main`).
46 changes: 46 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Contributing to ProgressUI

Thanks for your interest in improving ProgressUI! This document covers the
essentials for contributing.

## Getting started

1. Fork the repository and create a feature branch off `develop`:
```bash
git checkout -b feature/my-feature develop
```
2. Make your change.
3. Build and test:
```bash
swift build
swift test
```
4. For UI changes, run the sample app in `Example/Example.xcodeproj` (iOS,
macOS, and watchOS targets are available) to verify behavior interactively.

## Project layout

- `Sources/ProgressUI/` β€” the library. Public API surface is `ProgressUI`,
`Options`, `Progressable`, `Shape`, `GrowDirection`, and `ProgressSize`.
- `Tests/ProgressUITests/` β€” XCTest unit tests.
- `Example/` β€” multi-platform sample app.

## Guidelines

- **Platform availability.** The package supports iOS 14+, macOS 11+,
macCatalyst 14+, watchOS 7+, tvOS 15+, and visionOS 1+. Any new API must be
available on all of these.
- **Configuration flows through `Options`.** Prefer adding a field to `Options`
(and a matching `set…` modifier) over adding new initializers to `ProgressUI`.
- **Public API is semver-relevant.** Treat changes to the public types above as
breaking unless they are purely additive.
- **Document public API** with `///` or `/** */` doc comments, and update the
DocC landing page (`Sources/ProgressUI/ProgressUI.docc/ProgressUI.md`) when
adding new public symbols.
- **Add tests** for new logic where practical.
- **Update `CHANGELOG.md`** under `[Unreleased]`.

## Pull requests

Open pull requests against `develop`. CI builds and tests across all supported
platforms; please make sure it is green before requesting review.
Loading
Loading