Implement crude new codeflow page, create mock data for it#5992
Implement crude new codeflow page, create mock data for it#5992dkurepa wants to merge 4 commits intodotnet:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a new (work-in-progress) Codeflows page to the BarViz UI that renders a richer “codeflow row” view using locally-defined mock data, enabling iteration on layout/fields before wiring it to PCS.
Changes:
- Introduces a new routable Razor page (
/codeflows1) that displays codeflow subscription rows with backflow/forward-flow details. - Adds a mock-data generator (
MockCodeflowData) to populate the new page. - Extends BarViz model types to represent the new page’s row/subscription/PR shapes.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 8 comments.
| File | Description |
|---|---|
| src/ProductConstructionService/ProductConstructionService.BarViz/Pages/Codeflows1.razor | New “Codeflows1” page rendering a Fluent UI data grid for codeflow rows (currently using mock data). |
| src/ProductConstructionService/ProductConstructionService.BarViz/Model/MockCodeflowData.cs | New helper to generate mock CodeflowPage/subscription/build/PR data for the new page. |
| src/ProductConstructionService/ProductConstructionService.BarViz/Model/CodeflowSubscription.cs | Adds new record types (CodeflowPage, CodeflowSubscriptionPageEntry, etc.) to support the new page model. |
| <!--<Header> | ||
| <FluentSelect TOption="DefaultChannel" | ||
| Items="@DefaultChannels" | ||
| OptionValue="@(channel => channel.Branch)" | ||
| OptionSelected="@(c => c.Id == DefaultChannel?.Id)" |
There was a problem hiding this comment.
The <Header> section is commented out with an HTML comment (<!-- ... -->), but Razor still parses @... expressions inside HTML comments. Since DefaultChannels/DefaultChannel/OnDefaultChannelSelected aren’t defined in this component, this will fail to compile. Use a Razor comment (@* ... *@) or remove the block.
|
|
||
| <PageTitle>Codeflows – Maestro++</PageTitle> | ||
|
|
||
| <GridViewTemplate Title="Codeflows1234" ShowSkeleton="CodeFlows == null"> |
There was a problem hiding this comment.
GridViewTemplate title is set to "Codeflows1234", which looks like placeholder/test text and will show up in the UI header. Rename it to the intended user-facing title (e.g., "Codeflows") to avoid shipping debug wording.
| <GridViewTemplate Title="Codeflows1234" ShowSkeleton="CodeFlows == null"> | |
| <GridViewTemplate Title="Codeflows" ShowSkeleton="CodeFlows == null"> |
There was a problem hiding this comment.
ActivePr.CreatedDate is modeled as DateTime (no offset/kind), but the UI computes age using DateTime.UtcNow - pr.CreatedDate. This can produce incorrect ages if the value is local/unspecified. Prefer DateTimeOffset (or at least ensure UTC kind) for timestamps coming from APIs and for time-difference calculations.
There was a problem hiding this comment.
CodeflowPage exposes List<...> via a singularly-named property CodeflowRow, but it actually contains multiple rows/entries. Renaming to a plural (e.g., CodeflowRows/Rows) would make the API clearer and align with the data shape.
| Channel = new Channel(id: Random.Shared.Next(100, 999), channelName, "none"), | ||
| LastAppliedBuild = new Build( | ||
| id: Random.Shared.Next(10000, 99999), | ||
| dateProduced: DateTimeOffset.UtcNow.AddMinutes(-Random.Shared.Next(1, 14 * 24 * 60)), |
There was a problem hiding this comment.
CreateSubscription takes a parameter named lastAppliedBuildDaysAgo, but it’s only used for Build.staleness while dateProduced is randomized independently. Either derive dateProduced from this parameter (e.g., UtcNow.AddDays(-lastAppliedBuildDaysAgo)) or rename the parameter to reflect what it actually controls so the mock data stays consistent/understandable.
| dateProduced: DateTimeOffset.UtcNow.AddMinutes(-Random.Shared.Next(1, 14 * 24 * 60)), | |
| dateProduced: DateTimeOffset.UtcNow.AddDays(-lastAppliedBuildDaysAgo), |
| ActivePullRequest: new ActivePullRequest( | ||
| CreatedDate: new DateTime(2026, 2, 18, 14, 0, 0), | ||
| Url: "https://github.com/dotnet/runtime/pull/112345")), | ||
| BackflowSubscription: new SubscriptionDetail( |
There was a problem hiding this comment.
These mock PR timestamps are created as new DateTime(...) (kind = Unspecified). Since the UI compares against DateTime.UtcNow, set the kind to UTC (or switch the model to DateTimeOffset) to avoid incorrect age calculations.
| ActivePullRequest: new ActivePullRequest( | ||
| CreatedDate: new DateTime(2026, 2, 17, 9, 15, 0), | ||
| Url: "https://github.com/dotnet/dotnet/pull/54321"))), |
There was a problem hiding this comment.
This mock PR timestamp is created as new DateTime(...) (kind = Unspecified). Since the UI compares against DateTime.UtcNow, set the kind to UTC (or switch the model to DateTimeOffset) to avoid incorrect age calculations.
| protected override void OnInitialized() | ||
| { | ||
| var mockData = MockCodeflowData.GetMockCodeflowPage(); | ||
| CodeFlows = mockData.Entries |
There was a problem hiding this comment.
This is a routable page (@page "/codeflows1") but it always renders mock data (MockCodeflowData.GetMockCodeflowPage()). If BarViz is deployed, this can mislead users. Consider gating it to development-only (or adding a clear “mock data” banner / feature flag) until it’s wired to real PCS data.
The page currently looks like this

it's a crude look but it displays all info we want it to (except a link to the newest applicable build)
All further improvements will be made as a part of a different issue