File tree Expand file tree Collapse file tree
SnipLink.Blazor/Components/Pages Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- # # ── Claude Code / Anthropic AI tooling ──────────────────────────────────────
2- .claude /
3- CLAUDE.md
4- .claudeignore
5- claude.json
6-
71# # ── .NET ─────────────────────────────────────────────────────────────────────
82# Build results
93[Dd ]ebug /
Original file line number Diff line number Diff line change @@ -10,10 +10,10 @@ public sealed class SlugGenerator : ISlugGenerator
1010 // Bytes >= 252 are rejected to eliminate modulo bias.
1111 private const int MaxUnbiased = 252 ;
1212
13- // Pre-compiled: lowercase alphanumeric + hyphens, 3 -50 chars,
13+ // Pre-compiled: lowercase alphanumeric + hyphens, 2 -50 chars,
1414 // no leading/trailing hyphen, no consecutive hyphens.
1515 private static readonly Regex ValidSlugRegex =
16- new ( @"^[a-z0-9]([a-z0-9\-]{1 ,48}[a-z0-9]|[a-z0-9]?)$" ,
16+ new ( @"^[a-z0-9]([a-z0-9\-]{0 ,48}[a-z0-9]|[a-z0-9]?)$" ,
1717 RegexOptions . Compiled ) ;
1818
1919 public string Generate ( int length = 7 )
@@ -41,7 +41,7 @@ public string Generate(int length = 7)
4141 public bool IsValid ( string slug )
4242 {
4343 if ( string . IsNullOrEmpty ( slug ) ) return false ;
44- if ( slug . Length < 3 || slug . Length > 50 ) return false ;
44+ if ( slug . Length < 2 || slug . Length > 50 ) return false ;
4545 return ValidSlugRegex . IsMatch ( slug ) ;
4646 }
4747}
Original file line number Diff line number Diff line change 101101 Nav .NavigateTo (" /login" );
102102 }
103103
104+ protected override async Task OnAfterRenderAsync (bool firstRender )
105+ {
106+ if (firstRender && grid is not null )
107+ await grid .Reload ();
108+ }
109+
104110 private async Task LoadData (LoadDataArgs args )
105111 {
106112 isLoading = true ;
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ public void Generate_ProducesUniqueSlugs()
2626 }
2727
2828 [ Theory ]
29+ [ InlineData ( "ab" ) ]
30+ [ InlineData ( "me" ) ]
2931 [ InlineData ( "abc" ) ]
3032 [ InlineData ( "my-link" ) ]
3133 [ InlineData ( "a1b2c3" ) ]
@@ -35,7 +37,7 @@ public void IsValid_AcceptsValidSlugs(string slug)
3537 }
3638
3739 [ Theory ]
38- [ InlineData ( "ab " ) ] // too short
40+ [ InlineData ( "a " ) ] // too short
3941 [ InlineData ( "" ) ] // empty
4042 [ InlineData ( "-abc" ) ] // starts with hyphen
4143 [ InlineData ( "abc-" ) ] // ends with hyphen
You can’t perform that action at this time.
0 commit comments