Skip to content

Releases: AppifySheets/human-readable-calculation-steps

Release 1.4.0

Choose a tag to compare

@github-actions github-actions released this 14 May 12:24
v1.4.0 - Line endings, equality contract alignment, version bump

- FinalCalculationSteps now emits platform-stable CRLF line endings.
- Equals/GetHashCode are value-based only, agreeing with operator == and CompareTo.
- 21 new tests (equality contract + edge cases).

v1.3.3 - Fix NuGet Package Icon Visibility

Choose a tag to compare

@petre-c petre-c released this 30 Jun 21:49

What's Changed

NuGet Package Icon Fix

  • Fixed NuGet package icon visibility by placing icon in package root
  • Icon now properly displays in NuGet.org package listings
  • Improved package discoverability with visible branding

Previous Enhancements (from v1.3.2)

  • Enhanced multiline formatting for long expressions in FinalCalculationSteps
  • Fixed arithmetic expressions to use proper newline formatting
  • Repository cleanup and build configuration fixes

Technical Details

  • Corrected PackageIcon reference to point to package root (icon.png)
  • Updated PackagePath to place icon at package root level
  • Physical icon file remains in assets/icon.png in repository
  • All GitHub Actions workflows now pass successfully

Impact

  • Better package visibility on NuGet.org
  • Professional appearance with proper icon display
  • Improved user experience when discovering the package

Merged via PR: #41
Full Changelog: v1.3.2...v1.3.3

v1.3.2 - Enhanced Multiline Formatting and Arithmetic Expression Fixes

Choose a tag to compare

@petre-c petre-c released this 30 Jun 21:42

What's Changed

Enhanced Multiline Formatting

  • Added comprehensive multiline formatting for long expressions in FinalCalculationSteps
  • Improved readability of complex arithmetic expressions with proper line breaks and indentation

Arithmetic Expression Formatting Fixes

  • Fixed arithmetic expressions to use \n= result format instead of = result for better visual separation
  • Added pattern matching to detect simple arithmetic and complex expressions with parentheses
  • Fixed operator spacing when followed by parentheses
  • Removed all trailing spaces from formatted output lines

Repository Cleanup & Build Fixes

  • Removed remaining debug files and temporary test projects
  • Fixed NuGet package icon path configuration to resolve GitHub Actions build failures
  • Corrected PackageIcon reference to properly include assets/icon.png in published packages

Test Coverage

  • All 169 tests now pass
  • Added comprehensive test coverage for multiline formatting scenarios
  • Fixed test expectations to match improved formatting behavior

Technical Improvements

  • Enhanced expression parsing and formatting logic
  • Better handling of operator precedence in multiline displays
  • Improved pattern recognition for various expression types
  • Resolved NuGet packaging issues for successful automated publishing

Merged via PRs: #38, #39, #40
Full Changelog: v1.3.1...v1.3.2

v1.3.1: Fix Sum operations parentheses and wrapped value definitions

Choose a tag to compare

@petre-c petre-c released this 30 Jun 17:24

๐Ÿš€ What's New in v1.3.1

๐Ÿ”ง Bug Fixes

Sum Operations Parentheses

  • Fixed missing parentheses for Sum operations when used in multiplication/division contexts
  • Sum operations now properly wrapped with parentheses for mathematical clarity
  • Example: (Sum(items)) ร— multiplier instead of Sum(items) ร— multiplier

Wrapped Value Definitions in FinalCalculationSteps

  • Enhanced calculation step display to include wrapped value definitions when used in complex expressions
  • Intelligent complexity detection determines when to show multi-line format
  • Wrapped values now properly show their definitions in calculation steps

๐Ÿงช Test Results

  • Fixed 7 originally failing tests related to missing parentheses and definitions
  • Resolved 2 additional side-effect failures from over-aggressive formatting
  • All 168 tests now passing โœ…

๐Ÿ”ง Technical Changes

Core Improvements

  • FormatOperand method: Enhanced Sum operation detection and parentheses logic
  • FinalCalculationSteps property: Improved wrapped value definition inclusion
  • CountOperators helper: New method for expression complexity analysis

Code Examples

Sum Parentheses Detection:

// Only add parentheses for actual Sum operations, not multiplications containing sums
var isTopLevelSum = operand._caption.StartsWith("Sum(") || 
                   (operand._caption.Contains(" + ") && 
                    \!operand._caption.Contains(" ร— ") && 
                    \!operand._caption.Contains(" รท "));

Wrapped Value Multi-line Logic:

// Only show multi-line format for multiplication expressions with wrapped values
var operatorCount = CountOperators(_caption);
var isSimpleMultiplication = operatorCount == 1 && _caption.Contains(" ร— ") && 
                            _caption.Contains(wrappedName + "[");
shouldShowMultiLine = hasComplexDefinition && isSimpleMultiplication;

๐Ÿ“ Files Modified

  • HumanReadableCalculationSteps/ValueWithCaption.cs - Core formatting logic
  • Test files - Updated expectations for improved formatting behavior

๐Ÿ”— Related

๐Ÿค Contributors

This release includes improvements to mathematical notation accuracy and calculation step visibility, ensuring better user experience when working with complex expressions.


Full Changelog: v1.3.0...v1.3.1

v1.3.0 - Enhanced Caption Formatting

Choose a tag to compare

@petre-c petre-c released this 30 Jun 10:27

๐Ÿš€ What's New in v1.3.0

Enhanced Caption Formatting

  • Enhanced Caption property now uses superior FinalCalculationSteps formatting logic for named values
  • Detailed multi-line formatting for complex calculations showing complete calculation chains
  • Maintained backward compatibility - simple formatting preserved for non-named values

Example Output Format

The enhanced formatting now produces detailed calculation steps like:

DiscountedPrice = แƒกแƒแƒ‘แƒแƒ–แƒ แƒคแƒแƒกแƒ˜[100] - แƒคแƒแƒกแƒ“แƒแƒ™แƒšแƒ”แƒ‘แƒ[15] = 85

SomeValueResult = DiscountedPrice[85] ร— SomeValue[55.23] = 4,694.8

TaxValue = แƒกแƒแƒ‘แƒแƒ–แƒ แƒคแƒแƒกแƒ˜[100] ร— แƒ“แƒฆแƒ’[0.18] = 18

FinalValue =
  SomeValueResult[4,694.8] 
ร— 
  (  DiscountedPrice[85] 
   + TaxValue[18]
  )
ร— แƒแƒกแƒแƒชแƒ˜[120]
= 58,027,789.8

โœ… What's Improved

  • Better formatted calculation display for complex expressions
  • Enhanced readability for multi-step calculations
  • Proper handling of nested operations and parentheses
  • Support for Georgian language variable names in formatting

๐Ÿ”„ Backward Compatibility

  • All existing FinalCalculationSteps usage continues to work unchanged
  • Simple Caption behavior preserved for non-named values
  • No breaking changes to public API
  • All 168 tests passing โœ…

๐Ÿ”— Related

  • Pull Request: #33
  • Issue: #32

Built with .NET 8.0 < /dev/null | All tests passing โœ…

What's Changed

  • Enhance ValueWithCaption.Caption with FinalCalculationSteps formatting logic by @petre-c in #33

Full Changelog: v1.2.1...v1.3.0

Release 1.2.1

Choose a tag to compare

@github-actions github-actions released this 30 Jun 09:36
Bump version to 1.2.1 for workflow testing

Testing the improved CI/CD workflow that only runs on main branch tags.

๐Ÿค– Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>

v1.2.0 - IComparable Support

Choose a tag to compare

@github-actions github-actions released this 30 Jun 09:17

๐Ÿ”„ v1.2.0 - IComparable Support

๐Ÿ†• New Features

IComparable Implementation

  • โœ… Sorting Support: ValueWithCaption now implements IComparable and IComparable<ValueWithCaption>
  • โœ… LINQ Integration: Full support for OrderBy, OrderByDescending, Min, Max operations
  • โœ… Collection Sorting: Works with Array.Sort, List.Sort, and other .NET sorting APIs
  • โœ… Type-Safe Comparisons: Comparison based on underlying decimal Value property

๐Ÿ“‹ What's Included

Core Functionality

  • IComparable Interface: Compare ValueWithCaption objects based on their decimal values
  • Null-Safe Handling: Proper null comparison behavior (null < any value)
  • Type Safety: ArgumentException for incompatible types in non-generic CompareTo
  • Immutability: Enhanced field immutability with readonly modifiers

Usage Examples

var values = new[]
{
    30m.As("thirty"),
    10m.As("ten"), 
    20m.As("twenty")
};

// Sorting
Array.Sort(values); // Now works\!
values.OrderBy(v => v).ToArray(); // LINQ ordering works\!

// Min/Max operations
var min = values.Min(); // Returns ValueWithCaption with value 10
var max = values.Max(); // Returns ValueWithCaption with value 30

// Direct comparison
var a = 15m.As("a");
var b = 25m.As("b");
Console.WriteLine(a.CompareTo(b)); // Returns -1 (a < b)

๐Ÿงช Test Coverage

  • 168 Total Tests (including 12 new ComparableTests)
  • 100% Pass Rate โœ…
  • Comprehensive Coverage: Basic comparisons, null handling, LINQ operations, edge cases

๐Ÿ”„ Backwards Compatibility

โœ… Fully backwards compatible - no breaking changes to existing APIs or behavior.

๐Ÿ“ฆ NuGet Package

This release is available on NuGet as Appify.HumanReadableCalculationSteps v1.2.0

๐Ÿ”— Related

  • Resolves: #28
  • Pull Request: #26

๐Ÿค– Generated with Claude Code

Release 1.1.1

Choose a tag to compare

@petre-c petre-c released this 29 Jun 12:31

Release 1.1.1 - LINQ Sum() Support

๐Ÿš€ New Features

LINQ Sum() Extension Methods

  • Lambda Expression Support: Enable res.Sum(r => r.V1.AdvanceInSalary) syntax for ValueWithCaption collections
  • Direct Collection Support: Support values.Sum() for IEnumerable
  • Smart Caption Formatting:
    • โ‰ค3 items: A[10] + B[20] + C[30] (expanded format)
    • 3 items: Sum(ItemName, count(N))[total] (compact format)

Integration Features

  • Operator Precedence: Sum results integrate seamlessly with +, -, ร—, รท operators
  • Calculation Steps Preservation: All calculation steps from summed values are preserved and combined
  • Real-World Scenarios: Support complex business calculations like employee advance summations

๐Ÿ› Bug Fixes

  • Fixed Double Parentheses: Resolved issue where Sum() expressions showed unnecessary double parentheses when combined with higher precedence operators
  • Operator Precedence: Improved parentheses handling in mixed arithmetic expressions

๐Ÿ“Š Test Coverage

  • 21 New Tests: Comprehensive test coverage for all Sum() scenarios
  • Integration Tests: Verification of Sum() combined with all arithmetic operators
  • 154 Total Tests: All existing functionality continues to work correctly

๐Ÿ’ก Usage Examples

// Basic lambda expression support
var totalAdvance = employees.Sum(e => e.V1.AdvanceInSalary);

// Direct collection summation
var values = new[] { 100m.As("A"), 200m.As("B"), 150m.As("C") };
var total = values.Sum(); // Result: "A[100] + B[200] + C[150]"

// Integration with operators
var basePrices = new[] { 100m.As("Base1"), 150m.As("Base2"), 200m.As("Base3") };
var totalWithTax = basePrices.Sum() * 1.2m.As("TaxRate");
// Result: "(Base1[100] + Base2[150] + Base3[200]) ร— TaxRate[1.2]"

๐Ÿ”„ Breaking Changes

None - this release is fully backward compatible.


๐Ÿค– Generated with Claude Code

v1.1.0 - Expression-based ValueWithCaption Creation

Choose a tag to compare

@petre-c petre-c released this 29 Jun 09:48

๐ŸŽ‰ Release v1.1.0: Expression-based ValueWithCaption Creation

๐Ÿ†• New Features

Expression-based ValueWithCaption Creation

A major new feature that allows automatic caption generation from lambda expressions, making it easier and more intuitive to create ValueWithCaption objects.

// ๐Ÿ†• New: Automatic caption from expressions
var price = ValueWithCaption.From(() => 100m);         // Caption: "100"
var namedPrice = ValueWithCaption.From(() => basePrice); // Caption: "basePrice"

// ๐Ÿ†• DisplayName attribute support
public class Product 
{
    [DisplayName("Product Price")]
    public decimal Price { get; set; }
}
var productPrice = ValueWithCaption.From(() => product.Price); // Caption: "Product Price"

// ๐Ÿ†• Full integration with existing operations
var tax = price * ValueWithCaption.From(() => 0.18m);   // Works seamlessly

โœจ Key Benefits

  • ๐ŸŽฏ Automatic Caption Generation: No more string duplication or typos
  • ๐Ÿท๏ธ DisplayName Support: Built-in localization through DisplayName attributes
  • ๐Ÿ”ง Type Safety: Compile-time safety for variable references
  • ๐Ÿงฎ Full Integration: Works with all existing arithmetic operations
  • โœ… Zero Breaking Changes: All existing functionality preserved

๐Ÿ“‹ API Reference

New Static Factory Methods

  • ValueWithCaption.From(Expression<Func<decimal>>)
  • ValueWithCaption.From(Expression<Func<int>>)
  • ValueWithCaption.From(Expression<Func<double>>)
  • ValueWithCaption.From(Expression<Func<float>>)

Supported Expression Types

  • Literals: () => 100m โ†’ Caption: "100"
  • Variables: () => variable โ†’ Caption: "variable"
  • Properties: () => obj.Property โ†’ Caption: "Property" or DisplayName value
  • Fields: () => obj.field โ†’ Caption: "field" or DisplayName value

๐Ÿงช Quality Assurance

  • โœ… 133 total tests passing (16 new + 117 existing)
  • โœ… Comprehensive test coverage for all scenarios
  • โœ… No breaking changes to existing functionality
  • โœ… Full backward compatibility maintained

๐Ÿ“š Documentation

See Issue #20 and PR #21 for detailed implementation information.


Installation: dotnet add package Appify.HumanReadableCalculationSteps --version 1.1.0

Release v1.0.4

Choose a tag to compare

@petre-c petre-c released this 29 Jun 08:54

What's Changed

๐Ÿš€ Publishing Enhancement

  • Add GitHub Packages publishing alongside NuGet.org
  • Package will now appear in GitHub's 'Packages' section
  • Dual publishing for better discoverability

๐Ÿ”ง Workflow Improvements

  • Configure GitHub Packages NuGet source automatically
  • Use GITHUB_TOKEN for authentication
  • Maintain existing NuGet.org publishing

Installation

From NuGet.org (recommended)

dotnet add package Appify.HumanReadableCalculationSteps --version 1.0.4

From GitHub Packages

dotnet nuget add source https://nuget.pkg.github.com/AppifySheets/index.json -n github
dotnet add package Appify.HumanReadableCalculationSteps --version 1.0.4 --source github

Full Changelog: v1.0.3...v1.0.4