The build's one warning: CS8604 on the calendar day cell's conditional @onclick #120
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Grandiras/Ponente#120
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
dotnet build Ponente.slnis clean except for one warning, and it has been there long enough to read as background noise:The line is
@onclick="@(cards.Count > 0 ? () => OpenDay(day) : null)"— an empty day cell deliberately gets no handler, which is the behaviour described in the comment right above it, and the framework does the right thing with a null delegate (HasDelegateis false). So the warning is not a bug; it is an unexpressed intent.Worth resolving one way or the other so the build has zero warnings and the next real one is visible: either hand it
EventCallback<MouseEventArgs>.Emptyfor the no-op branch, or keep the null and pin it with an explicit suppression plus one line saying why.Filed by Claude while working on #117 (run).
🤖 On it — follow along in the action run; the reply will link the full session transcript.
📜 Live transcript — updating every ~5 minutes while the task runs.
Pushed
claude/issue-120.What I did
Took the second of the issue's two options — and it turned out to be the only correct one.
src/Ponente.Kanban/Components/Pages/Calendar.razor:287is now:The null-forgiving operator emits no code, so the rendered output is byte-for-byte what it was; what changed is that the null now reads as a decision instead of an oversight, and the comment above it — which already explained why an empty cell gets no handler — says so.
Why not
EventCallback<MouseEventArgs>.EmptyThe issue's first suggestion looks like the tidier spelling of the same thing and is the opposite of it. I checked against the framework rather than assuming, driving a
RenderTreeBuilderthe way the generated component code does:EventCallback<T>.Emptyholds a no-op delegate, soHasDelegateis true,AddAttributewrites theonclickattribute, and a listener gets registered on every dateless cell in the month — each click spending a server round trip to run nothing. It would have silently traded one compiler warning for a behaviour change that no test could catch: the e2e assertion that already pins this (calendar.spec.js:502clicks a.calendar-day:not(.calendar-day-open)and expects no sheet) passes just as happily with a handler that does nothing.A null delegate is the framework's own way of saying there is no handler, and it drops the attribute outright. (
default(EventCallback<MouseEventArgs>)is the genuinely-equivalent typed spelling, but it costs three lines of markup to say whatnull!says in five characters.)That reasoning is recorded in the comment on the cell and in the day-cell paragraph of
docs/calendar.md, so the tidier-looking spelling isn't tried again by the next person to read that line.Verified
dotnet build Ponente.sln— 0 warnings, 0 errors (was 1 warning).dotnet test Ponente.sln— 380 passed, 0 failed.podman/docker, and the stack needs the PDS container. It isn't a gap for this change, though —null!andnullcompile to identical code, so there is no runtime difference for e2e to find.No changelog entry: nothing a member would notice. No new issues filed.
⏱ 4m 24s · 21 turns · tokens: 45.9k in / 16.3k out (+799.4k cache-read)
📜 Full session transcript
→ Opened PR: #133