Skip to content

Commit 1bb3598

Browse files
Merge pull request #60 from TheEightBot/develop
2 parents 14f80df + fa6ae1a commit 1bb3598

File tree

7 files changed

+73
-80
lines changed

7 files changed

+73
-80
lines changed

.github/workflows/nuget-beta.yml

Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ jobs:
6262
6363
# Get commits between tags
6464
if [ "$PREVIOUS_TAG" != "" ] && git rev-parse --verify "$PREVIOUS_TAG" >/dev/null 2>&1; then
65-
COMMITS=$(git log --pretty=format:"%s|%h|%ae" "$PREVIOUS_TAG..$CURRENT_TAG")
65+
COMMITS=$(git log --pretty=format:"%s|%h" "$PREVIOUS_TAG..$CURRENT_TAG")
6666
else
67-
COMMITS=$(git log --pretty=format:"%s|%h|%ae")
67+
COMMITS=$(git log --pretty=format:"%s|%h")
6868
fi
6969
7070
# Filter out common git cruft messages
@@ -74,18 +74,8 @@ jobs:
7474
echo "### 🚀 New Features" >> release_notes.md
7575
FEATURES=$(echo "$COMMITS" | grep -i "^feat\|^add\|^new" || true)
7676
if [ -n "$FEATURES" ]; then
77-
echo "$FEATURES" | while IFS='|' read -r subject hash email; do
78-
# Get GitHub handle from email using GitHub API
79-
GITHUB_HANDLE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
80-
"https://api.github.com/search/users?q=${email}+in:email" | \
81-
jq -r '.items[0].login // empty' 2>/dev/null || echo "")
82-
83-
if [ -n "$GITHUB_HANDLE" ] && [ "$GITHUB_HANDLE" != "null" ]; then
84-
echo "- $subject (\`$hash\`) by @$GITHUB_HANDLE" >> release_notes.md
85-
else
86-
# Fallback to email if GitHub handle not found
87-
echo "- $subject (\`$hash\`) by $email" >> release_notes.md
88-
fi
77+
echo "$FEATURES" | while IFS='|' read -r subject hash; do
78+
echo "- $subject (\`$hash\`)" >> release_notes.md
8979
done
9080
else
9181
echo "- No new features in this release" >> release_notes.md
@@ -95,18 +85,8 @@ jobs:
9585
echo "### 🐛 Bug Fixes" >> release_notes.md
9686
FIXES=$(echo "$COMMITS" | grep -i "^fix\|^bug\|^patch" || true)
9787
if [ -n "$FIXES" ]; then
98-
echo "$FIXES" | while IFS='|' read -r subject hash email; do
99-
# Get GitHub handle from email using GitHub API
100-
GITHUB_HANDLE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
101-
"https://api.github.com/search/users?q=${email}+in:email" | \
102-
jq -r '.items[0].login // empty' 2>/dev/null || echo "")
103-
104-
if [ -n "$GITHUB_HANDLE" ] && [ "$GITHUB_HANDLE" != "null" ]; then
105-
echo "- $subject (\`$hash\`) by @$GITHUB_HANDLE" >> release_notes.md
106-
else
107-
# Fallback to email if GitHub handle not found
108-
echo "- $subject (\`$hash\`) by $email" >> release_notes.md
109-
fi
88+
echo "$FIXES" | while IFS='|' read -r subject hash; do
89+
echo "- $subject (\`$hash\`)" >> release_notes.md
11090
done
11191
else
11292
echo "- No bug fixes in this release" >> release_notes.md
@@ -116,18 +96,8 @@ jobs:
11696
echo "### 📝 Documentation & Other Changes" >> release_notes.md
11797
OTHER=$(echo "$COMMITS" | grep -iv "^feat\|^add\|^new\|^fix\|^bug\|^patch" || true)
11898
if [ -n "$OTHER" ]; then
119-
echo "$OTHER" | while IFS='|' read -r subject hash email; do
120-
# Get GitHub handle from email using GitHub API
121-
GITHUB_HANDLE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
122-
"https://api.github.com/search/users?q=${email}+in:email" | \
123-
jq -r '.items[0].login // empty' 2>/dev/null || echo "")
124-
125-
if [ -n "$GITHUB_HANDLE" ] && [ "$GITHUB_HANDLE" != "null" ]; then
126-
echo "- $subject (\`$hash\`) by @$GITHUB_HANDLE" >> release_notes.md
127-
else
128-
# Fallback to email if GitHub handle not found
129-
echo "- $subject (\`$hash\`) by $email" >> release_notes.md
130-
fi
99+
echo "$OTHER" | while IFS='|' read -r subject hash; do
100+
echo "- $subject (\`$hash\`)" >> release_notes.md
131101
done
132102
else
133103
echo "- No other changes in this release" >> release_notes.md

.github/workflows/nuget-prod.yml

Lines changed: 8 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,9 @@ jobs:
6262
6363
# Get commits between tags
6464
if [ "$PREVIOUS_TAG" != "" ] && git rev-parse --verify "$PREVIOUS_TAG" >/dev/null 2>&1; then
65-
COMMITS=$(git log --pretty=format:"%s|%h|%ae" "$PREVIOUS_TAG..$CURRENT_TAG")
65+
COMMITS=$(git log --pretty=format:"%s|%h" "$PREVIOUS_TAG..$CURRENT_TAG")
6666
else
67-
COMMITS=$(git log --pretty=format:"%s|%h|%ae")
67+
COMMITS=$(git log --pretty=format:"%s|%h")
6868
fi
6969
7070
# Filter out common git cruft messages
@@ -74,18 +74,8 @@ jobs:
7474
echo "### 🚀 New Features" >> release_notes.md
7575
FEATURES=$(echo "$COMMITS" | grep -i "^feat\|^add\|^new" || true)
7676
if [ -n "$FEATURES" ]; then
77-
echo "$FEATURES" | while IFS='|' read -r subject hash email; do
78-
# Get GitHub handle from email using GitHub API
79-
GITHUB_HANDLE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
80-
"https://api.github.com/search/users?q=${email}+in:email" | \
81-
jq -r '.items[0].login // empty' 2>/dev/null || echo "")
82-
83-
if [ -n "$GITHUB_HANDLE" ] && [ "$GITHUB_HANDLE" != "null" ]; then
84-
echo "- $subject (\`$hash\`) by @$GITHUB_HANDLE" >> release_notes.md
85-
else
86-
# Fallback to email if GitHub handle not found
87-
echo "- $subject (\`$hash\`) by $email" >> release_notes.md
88-
fi
77+
echo "$FEATURES" | while IFS='|' read -r subject hash; do
78+
echo "- $subject (\`$hash\`)" >> release_notes.md
8979
done
9080
else
9181
echo "- No new features in this release" >> release_notes.md
@@ -95,18 +85,8 @@ jobs:
9585
echo "### 🐛 Bug Fixes" >> release_notes.md
9686
FIXES=$(echo "$COMMITS" | grep -i "^fix\|^bug\|^patch" || true)
9787
if [ -n "$FIXES" ]; then
98-
echo "$FIXES" | while IFS='|' read -r subject hash email; do
99-
# Get GitHub handle from email using GitHub API
100-
GITHUB_HANDLE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
101-
"https://api.github.com/search/users?q=${email}+in:email" | \
102-
jq -r '.items[0].login // empty' 2>/dev/null || echo "")
103-
104-
if [ -n "$GITHUB_HANDLE" ] && [ "$GITHUB_HANDLE" != "null" ]; then
105-
echo "- $subject (\`$hash\`) by @$GITHUB_HANDLE" >> release_notes.md
106-
else
107-
# Fallback to email if GitHub handle not found
108-
echo "- $subject (\`$hash\`) by $email" >> release_notes.md
109-
fi
88+
echo "$FIXES" | while IFS='|' read -r subject hash; do
89+
echo "- $subject (\`$hash\`)" >> release_notes.md
11090
done
11191
else
11292
echo "- No bug fixes in this release" >> release_notes.md
@@ -116,18 +96,8 @@ jobs:
11696
echo "### 📝 Documentation & Other Changes" >> release_notes.md
11797
OTHER=$(echo "$COMMITS" | grep -iv "^feat\|^add\|^new\|^fix\|^bug\|^patch" || true)
11898
if [ -n "$OTHER" ]; then
119-
echo "$OTHER" | while IFS='|' read -r subject hash email; do
120-
# Get GitHub handle from email using GitHub API
121-
GITHUB_HANDLE=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
122-
"https://api.github.com/search/users?q=${email}+in:email" | \
123-
jq -r '.items[0].login // empty' 2>/dev/null || echo "")
124-
125-
if [ -n "$GITHUB_HANDLE" ] && [ "$GITHUB_HANDLE" != "null" ]; then
126-
echo "- $subject (\`$hash\`) by @$GITHUB_HANDLE" >> release_notes.md
127-
else
128-
# Fallback to email if GitHub handle not found
129-
echo "- $subject (\`$hash\`) by $email" >> release_notes.md
130-
fi
99+
echo "$OTHER" | while IFS='|' read -r subject hash; do
100+
echo "- $subject (\`$hash\`)" >> release_notes.md
131101
done
132102
else
133103
echo "- No other changes in this release" >> release_notes.md

AuroraControls.TestApp/ChipGroupPage.xaml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@
1919
<aurora:Chip
2020
Text="{Binding Name}"
2121
LeadingEmbeddedImageName="{Binding IconSource}"
22-
Value="{Binding Name}"/>
22+
Value="{Binding Name}"
23+
State="{Binding ChipState}"/>
2324
</DataTemplate>
2425
</ContentPage.Resources>
2526

@@ -158,7 +159,7 @@
158159
Grid.ColumnSpan="2"
159160
Text="{Binding SelectedChipsText}"
160161
LineBreakMode="WordWrap" />
161-
162+
162163
<Label
163164
Grid.Row="9"
164165
Grid.Column="0"
@@ -172,7 +173,7 @@
172173
Grid.ColumnSpan="2"
173174
Text="{Binding SelectedValuesText}"
174175
LineBreakMode="WordWrap" />
175-
176+
176177
<Button
177178
Grid.Row="11"
178179
Grid.Column="0"
@@ -201,7 +202,8 @@
201202
ItemsSource="{Binding ChipItems}"
202203
ItemTemplate="{StaticResource ChipTemplate}"
203204
SelectedValue="{Binding SelectedValue, Mode=TwoWay}"
204-
SelectionChanged="OnChipSelectionChanged" />
205+
SelectionChanged="OnChipSelectionChanged"
206+
ChipTapped="OnChipTapped" />
205207

206208
</Grid>
207209
</Frame>

AuroraControls.TestApp/ChipGroupPage.xaml.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,4 +204,12 @@ await DisplayAlert(
204204
"OK");
205205
}
206206
}
207+
208+
private void OnChipTapped(object sender, ChipTappedEventArgs e)
209+
{
210+
if (e.Chip?.State == ChipState.ReadOnly)
211+
{
212+
DisplayAlert("Chip Tapped", $"Chip: {e.Chip.Text}", "OK");
213+
}
214+
}
207215
}

AuroraControls.TestApp/ViewModels/ChipGroupViewModel.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ public void AddRandomChip()
9696
Value = name, // Set the Value property to match the Name for demonstration purposes
9797
IconSource = _icons[_random.Next(_icons.Length)],
9898
IsClosable = _random.Next(2) == 0,
99+
ChipState = (ChipState)_random.Next(0, 3), // Randomly select a ChipState
99100
BackgroundColor = _colors[_random.Next(_colors.Length)],
100101
};
101102

@@ -130,6 +131,9 @@ public partial class ChipItemViewModel : ObservableObject
130131
[ObservableProperty]
131132
private bool _isClosable;
132133

134+
[ObservableProperty]
135+
private ChipState _chipState;
136+
133137
[ObservableProperty]
134138
private string _backgroundColor;
135139

AuroraControlsMaui/ChipGroup.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@ public class ChipGroup : ContentView, IDisposable
2020
/// </summary>
2121
public event EventHandler<ChipSelectionChangedEventArgs>? SelectionChanged;
2222

23+
/// <summary>
24+
/// Event that fires when a chip in the group is tapped
25+
/// </summary>
26+
public event EventHandler<ChipTappedEventArgs>? ChipTapped;
27+
2328
/// <summary>
2429
/// Gets the collection of chips in this group.
2530
/// </summary>
@@ -672,6 +677,7 @@ private void AddChip(Chip chip)
672677
chip.Toggled += OnChipToggled;
673678
chip.Removed += OnChipRemoved;
674679
chip.SizeChanged += OnChipSizeChanged;
680+
chip.Tapped += OnChipTapped;
675681

676682
// Set initial spacing
677683
if (_chipContainer != null)
@@ -693,6 +699,7 @@ private void RemoveChip(Chip chip)
693699
chip.Toggled -= OnChipToggled;
694700
chip.Removed -= OnChipRemoved;
695701
chip.SizeChanged -= OnChipSizeChanged;
702+
chip.Tapped -= OnChipTapped;
696703

697704
// Remove from container
698705
_chipContainer?.Remove(chip);
@@ -808,6 +815,24 @@ private void OnChipSizeChanged(object? sender, EventArgs e)
808815
UpdateLayout();
809816
}
810817

818+
private void OnChipTapped(object? sender, EventArgs e)
819+
{
820+
if (sender is not Chip chip)
821+
{
822+
return;
823+
}
824+
825+
// Create event arguments with the chip and its index
826+
var args =
827+
new ChipTappedEventArgs
828+
{
829+
Chip = chip,
830+
};
831+
832+
// Raise the event
833+
ChipTapped?.Invoke(this, args);
834+
}
835+
811836
/// <summary>
812837
/// Updates the selection mode (IsSingleSelection) on all chips.
813838
/// </summary>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
using System;
2+
3+
namespace AuroraControls;
4+
5+
/// <summary>
6+
/// Event arguments for when a chip is tapped in a ChipGroup.
7+
/// </summary>
8+
public class ChipTappedEventArgs : EventArgs
9+
{
10+
/// <summary>
11+
/// Gets the chip that was tapped.
12+
/// </summary>
13+
public required Chip Chip { get; init; }
14+
}

0 commit comments

Comments
 (0)