Skip to content

Commit eb840b9

Browse files
committed
Critical, Major and Minor fixes
1 parent 6211d8d commit eb840b9

10 files changed

Lines changed: 402 additions & 16 deletions

File tree

ARCHITECTURE_SUMMARY.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,15 @@
157157

158158
**Goal:** Build reusable Blazor components with read and write capabilities
159159

160-
**Status:** PLANNED - See `PHASE3_VIEW_UI.md` for patterns, `PHASE4_VIEW_EDIT.md` for editable components
160+
**Status:** Phase 3 (read-only) PARTIALLY COMPLETE - See `PHASE3_VIEW_UI.md` for patterns, `PHASE4_VIEW_EDIT.md` for editable components
161161

162162
**Deliverables (Phase 3 - Read Patterns):**
163163
-`ProductDashboard.razor` reference component (DONE)
164+
-`ViewSection.razor` generic view display component (DONE) - Displays any SQL view with parameters, filtering, sorting, and dynamic column discovery
165+
-`ApplicationSwitcher.razor` multi-tenant selector component (DONE) - Allows users to switch between applications/schemas
164166
- `ProductForm.razor` form pattern example
165167
- `ExecutiveDashboard.razor` dashboard pattern example
166-
- Radzen component patterns documented in SKILLS.md
168+
- Radzen component patterns documented in SKILLS.md (updated with ViewSection usage examples)
167169

168170
**Deliverables (Phase 4 - Write Capabilities):**
169171
- `SmartDataGrid<T>` component (replaces/extends DynamicDataGrid)

CLAUDE.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,12 @@ Consult the `radzen-blazor` skill (`.claude/skills/radzen-blazor/SKILL.md`) when
2727
1. **Enum properties MUST use @ prefix:** `ButtonStyle="@ButtonStyle.Primary"` (NOT `ButtonStyle="ButtonStyle.Primary"`)
2828
2. **Use Radzen components, NOT plain HTML:** `<RadzenButton>` not `<button>`
2929
3. **RadzenComponents directive required:** Must have `<RadzenComponents />` at end of MainLayout.razor
30-
4. **Interactive render mode for events:** Components with Click/Change events need `@rendermode InteractiveServer`
30+
4. **Event handlers work by default:** This is a Blazor Server app - all components are interactive by default. Do NOT use `@rendermode InteractiveServer` (this is only for hybrid Blazor apps with static SSR)
31+
32+
## Important Session Notes
33+
- **Backwards Compatibility:** NOT required for this project. Code changes can freely update existing patterns without maintaining compatibility with prior versions.
34+
- **Git Operations:** Only use read-only git commands (status, log, diff). Do NOT use git commit, push, pull, or other write operations.
35+
- **⚠️ CRITICAL - Claude Bot PR Reviews:** Claude Bot will flag ViewSection.razor and ApplicationSwitcher.razor as missing `@rendermode InteractiveServer`. **IGNORE THIS RECOMMENDATION.** This is a traditional Blazor Server app (not Blazor Web App). Render modes are NOT supported and WILL cause build errors: `error CS0103: The name 'InteractiveServer' does not exist in the current context`. Components in Blazor Server are interactive by default. Do NOT add the directive.
3136

3237
### Quick Reference
3338
- **Full skill:** `.claude/skills/radzen-blazor/SKILL.md`

Components/Sections/ViewSection.razor

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@
203203
else
204204
{
205205
// Fallback: Execute as dynamic and extract columns from first result
206+
Logger.LogWarning("View model type not found for {ViewName}, falling back to dynamic result set", ViewName);
206207
var method = typeof(IViewService)
207208
.GetMethod(nameof(IViewService.ExecuteViewAsync))
208209
?.MakeGenericMethod(typeof(object));

Components/Shared/ApplicationSwitcher.razor

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@
1717
var currentApp = AppDictionary.GetAllApplications().FirstOrDefault(a => a.Name == selectedAppName);
1818
@if (currentApp != null)
1919
{
20-
<div class="app-info" style="padding: 12px; border: 1px solid #ddd; border-radius: 4px; margin-bottom: 12px;">
21-
<div style="margin-bottom: 8px;">
22-
<strong>@currentApp.Title</strong>
23-
</div>
24-
<div style="font-size: 0.9rem; color: #666; margin-bottom: 8px;">
25-
@currentApp.Description
26-
</div>
20+
<div class="app-info">
21+
<div>@currentApp.Title</div>
22+
<div>@currentApp.Description</div>
2723
@if (!string.IsNullOrEmpty(currentApp.Url))
2824
{
2925
<RadzenLink Path="@currentApp.Url" Target="_blank" Text="Open Application" Icon="open_in_new" />
@@ -37,14 +33,14 @@
3733
<RadzenStack Orientation="Orientation.Vertical" Gap="8px">
3834
@foreach (var app in AppDictionary.GetAllApplications())
3935
{
40-
<div class="app-card" style="padding: 12px; border: 1px solid #eee; border-radius: 4px; cursor: pointer;" @onclick="@((MouseEventArgs e) => OnApplicationChanged(app.Name))">
41-
<div style="display: flex; align-items: center; gap: 8px;">
36+
<div class="app-card" @onclick="@((MouseEventArgs e) => OnApplicationChanged(app.Name))">
37+
<div>
4238
<RadzenIcon Icon="@(app.Icon ?? "apps")" />
4339
<div>
44-
<div style="font-weight: bold;">@app.Title</div>
40+
<div class="app-card-title">@app.Title</div>
4541
@if (!string.IsNullOrEmpty(app.Url))
4642
{
47-
<div style="font-size: 0.85rem; color: #999;">
43+
<div class="app-card-url">
4844
<RadzenLink Path="@app.Url" Target="_blank" Text="@app.Url" Icon="link" />
4945
</div>
5046
}

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ run-ddl-pipeline: clean
101101
@echo " -- Step 1: Parsing DDL to data.yaml (intermediate, dataModel only)..."
102102
cd DdlParser && "../$(DOTNET)" run -- ../schema.sql ../data.yaml
103103
@echo ""
104-
@echo " -- Step 2: Merging ViewDefinitions from appsettings.json data.yaml (intermediate now has dataModel + views)..."
104+
@echo " -- Step 2: Merging ViewDefinitions from appsettings.json into data.yaml (modifies in place; intermediate now contains dataModel + views)..."
105105
cd YamlMerger && "../$(DOTNET)" run ../data.yaml ../appsettings.json
106106
@echo ""
107107
@echo " -- Step 3: Generating C# models from data.yaml..."

SKILLS.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -921,6 +921,43 @@ Add filter controls that pass parameters to the view:
921921
</div>
922922
```
923923

924+
### Using the ViewSection Generic Component
925+
926+
For most view display scenarios, use the **reusable `ViewSection.razor` component** instead of building custom components. ViewSection handles:
927+
- Automatic parameter binding
928+
- Dynamic column discovery from view results
929+
- Filtering, sorting, and paging
930+
- Error handling and loading states
931+
- Type-safe view model handling
932+
933+
**File:** `Components/Sections/ViewSection.razor` (built-in component)
934+
935+
```razor
936+
<!-- Parent page that uses ViewSection -->
937+
@page "/dashboard"
938+
939+
<ViewSection AppName="MyApp" ViewName="ProductSalesView" />
940+
```
941+
942+
**What ViewSection provides automatically:**
943+
- ✅ Parameter input fields for all view parameters
944+
- ✅ Execute button to run the query
945+
- ✅ Responsive data grid with filtering & sorting
946+
- ✅ Paging support (20 rows per page)
947+
- ✅ Dynamic column discovery (no need to define columns)
948+
- ✅ Error alerts and loading indicators
949+
- ✅ Row count display
950+
951+
**When to use ViewSection:**
952+
- Displaying any SQL view with standard grid/parameter UI
953+
- Dashboards and reports
954+
- Data exploration tools
955+
956+
**When to use custom components:**
957+
- Complex layouts (multi-section dashboards)
958+
- Custom visualizations (charts, maps)
959+
- Special interactions (tree views, nested data)
960+
924961
### Loading Single Record
925962

926963
Use `ExecuteViewSingleAsync` when expecting exactly one result:

tests/DotNetWebApp.Tests/DotNetWebApp.Tests.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
</ItemGroup>
1616

1717
<ItemGroup>
18+
<PackageReference Include="bunit" Version="1.29.5" />
1819
<PackageReference Include="Microsoft.Data.Sqlite" Version="8.0.0" />
1920
<PackageReference Include="Microsoft.EntityFrameworkCore.Sqlite" Version="8.0.0" />
2021
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="18.0.1" />

0 commit comments

Comments
 (0)