-
Notifications
You must be signed in to change notification settings - Fork 0
feat(demo-app): deliver catalog shell milestone #35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
luckydizzier
merged 1 commit into
main
from
codex/2025-10-01_20-23-51_implement-m1-from-tasks.md
Oct 1, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,34 @@ | ||
| <?xml version="1.0" encoding="utf-8"?> | ||
| <Application xmlns="https://github.com/avaloniaui" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
| xmlns:diag="clr-namespace:XBase.Demo.Domain.Diagnostics;assembly=XBase.Demo.Domain" | ||
| xmlns:vm="clr-namespace:XBase.Demo.App.ViewModels" | ||
| x:Class="XBase.Demo.App.App"> | ||
| <Application.DataTemplates> | ||
| <DataTemplate x:DataType="vm:TableListItemViewModel"> | ||
| <StackPanel Margin="4" Spacing="2"> | ||
| <TextBlock Text="{Binding Name}" FontWeight="Medium" /> | ||
| <TextBlock Text="{Binding Path}" FontSize="11" Foreground="#FF617C9A" TextTrimming="CharacterEllipsis" /> | ||
| </StackPanel> | ||
| </DataTemplate> | ||
| <DataTemplate x:DataType="vm:IndexListItemViewModel"> | ||
| <StackPanel Margin="4" Spacing="2"> | ||
| <TextBlock Text="{Binding Name}" FontWeight="SemiBold" /> | ||
| <TextBlock Text="{Binding Expression}" FontSize="11" Foreground="#FF617C9A" TextTrimming="CharacterEllipsis" /> | ||
| </StackPanel> | ||
| </DataTemplate> | ||
| <DataTemplate x:DataType="diag:DemoTelemetryEvent"> | ||
| <StackPanel Margin="4" Spacing="2"> | ||
| <TextBlock Text="{Binding Name}" FontWeight="SemiBold" /> | ||
| <TextBlock Text="{Binding Timestamp, StringFormat='{}{0:HH:mm:ss}'}" FontSize="11" /> | ||
| <ItemsControl ItemsSource="{Binding Payload}"> | ||
| <ItemsControl.ItemTemplate> | ||
| <DataTemplate> | ||
| <TextBlock FontSize="11" Text="{Binding}" /> | ||
| </DataTemplate> | ||
| </ItemsControl.ItemTemplate> | ||
| </ItemsControl> | ||
| </StackPanel> | ||
| </DataTemplate> | ||
| </Application.DataTemplates> | ||
| </Application> |
26 changes: 26 additions & 0 deletions
26
src/demo/XBase.Demo.App/ViewModels/IndexListItemViewModel.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| using System; | ||
| using XBase.Demo.Domain.Catalog; | ||
|
|
||
| namespace XBase.Demo.App.ViewModels; | ||
|
|
||
| /// <summary> | ||
| /// Represents an index entry for the selected table. | ||
| /// </summary> | ||
| public sealed class IndexListItemViewModel | ||
| { | ||
| public IndexListItemViewModel(IndexModel model) | ||
| { | ||
| Model = model ?? throw new ArgumentNullException(nameof(model)); | ||
| Name = model.Name; | ||
| Expression = model.Expression; | ||
| Order = model.Order; | ||
| } | ||
|
|
||
| public IndexModel Model { get; } | ||
|
|
||
| public string Name { get; } | ||
|
|
||
| public string Expression { get; } | ||
|
|
||
| public int Order { get; } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
src/demo/XBase.Demo.App/ViewModels/TableListItemViewModel.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
| using XBase.Demo.Domain.Catalog; | ||
|
|
||
| namespace XBase.Demo.App.ViewModels; | ||
|
|
||
| /// <summary> | ||
| /// Represents a single table entry displayed in the catalog browser. | ||
| /// </summary> | ||
| public sealed class TableListItemViewModel | ||
| { | ||
| public TableListItemViewModel(TableModel model) | ||
| { | ||
| Model = model ?? throw new ArgumentNullException(nameof(model)); | ||
| Name = model.Name; | ||
| Path = model.Path; | ||
| Indexes = model.Indexes | ||
| .OrderBy(index => index.Order) | ||
| .ThenBy(index => index.Name, StringComparer.OrdinalIgnoreCase) | ||
| .Select(index => new IndexListItemViewModel(index)) | ||
| .ToArray(); | ||
| } | ||
|
|
||
| public TableModel Model { get; } | ||
|
|
||
| public string Name { get; } | ||
|
|
||
| public string Path { get; } | ||
|
|
||
| public IReadOnlyList<IndexListItemViewModel> Indexes { get; } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The body of
ExecuteLoadTableAsyncruns on the task pool becauseLoadTableCommandis created withReactiveCommand.CreateFromTaskand no scheduler override. Inside the method we mutateTablePage,CatalogStatusand_telemetryEvents(TablePage.Apply,CatalogStatus = …,RecordTelemetry) which are all bound to the UI. When a user selects a table, this command executes off the UI thread and Avalonia will throw cross-thread collection/property update exceptions. Dispatch the mutations toRxApp.MainThreadScheduleror return a result and update the observable collections in a subscription on the main thread.Useful? React with 👍 / 👎.