feat(demo-app): deliver catalog shell milestone#35
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughIntroduces new view models and data templates, expands ShellViewModel with public collections/commands and updated control flow for catalog and table loading, adds UI bindings and interactions in MainWindow, implements folder-pick interaction, updates tasks, adds a new test project with tests, and registers it in the solution. Changes
Sequence Diagram(s)sequenceDiagram
autonumber
actor User
participant View as MainWindow
participant VM as ShellViewModel
participant IO as StorageProvider
participant Catalog as CatalogLoader
participant Telemetry as RecordTelemetry
rect rgba(230,240,255,0.6)
User->>View: Click "Open Catalog…"
View->>VM: Invoke BrowseCatalogCommand
VM->>View: SelectCatalogFolderInteraction.Handle()
View->>IO: OpenFolderPickerAsync()
IO-->>View: Selected folder path | null
View-->>VM: Return path
end
alt Path provided
VM->>VM: OpenCatalogCommand.Execute(path)
VM->>Catalog: LoadCatalog(path)
Catalog-->>VM: CatalogModel
VM->>VM: OnCatalogLoaded(model)\n- Populate Tables\n- Set SelectedTable\n- Update CatalogStatus
VM->>Telemetry: Record CatalogLoaded
opt SelectedTable set
VM->>VM: LoadTableCommand.Execute(SelectedTable)
VM->>Catalog: LoadTablePreview(table)
Catalog-->>VM: TablePage
VM->>VM: TablePage.Apply(page)
VM->>Telemetry: Record TablePreviewLoaded
end
else Error
VM->>Telemetry: Record error event
VM->>VM: Reset state
end
sequenceDiagram
autonumber
actor User
participant VM as ShellViewModel
participant Catalog as CatalogLoader
participant TP as TablePageViewModel
participant Telemetry as RecordTelemetry
User->>VM: LoadTableCommand.Execute(table VM)
VM->>Telemetry: Record TableLoadStarted
VM->>Catalog: LoadTablePreview(table.Model)
Catalog-->>VM: TablePage
VM->>TP: Apply(page)
VM->>Telemetry: Record TablePreviewLoaded
Note over TP: Summary, Rows, Counts updated
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes Poem
✨ Finishing touches
🧪 Generate unit tests
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (11)
Comment |
There was a problem hiding this comment.
Pull Request Overview
This PR implements the catalog shell milestone for the demo application, delivering a complete UI for browsing xBase database catalogs with table and index listing functionality.
- Adds reactive view models for catalog browsing, table listing, and paging functionality
- Implements folder browsing, telemetry capture, and table preview commands through the shell
- Introduces integration smoke tests to validate end-to-end catalog discovery
Reviewed Changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| xBase.sln | Adds new test project to solution structure |
| tests/XBase.Demo.App.Tests/XBase.Demo.App.Tests.csproj | Creates test project with xUnit and ReactiveUI dependencies |
| tests/XBase.Demo.App.Tests/ShellViewModelTests.cs | Implements integration smoke test for catalog loading workflow |
| src/demo/tasks.md | Updates milestone tracking to mark M1 tasks as completed |
| src/demo/XBase.Demo.App/Views/MainWindow.axaml.cs | Adds folder picker interaction handling for catalog browsing |
| src/demo/XBase.Demo.App/Views/MainWindow.axaml | Enhances UI with tables, indexes, telemetry panels and navigation |
| src/demo/XBase.Demo.App/ViewModels/TablePageViewModel.cs | Creates paging view model for table data preview |
| src/demo/XBase.Demo.App/ViewModels/TableListItemViewModel.cs | Implements table list item with index collection |
| src/demo/XBase.Demo.App/ViewModels/ShellViewModel.cs | Expands shell with catalog commands, reactive collections, and telemetry |
| src/demo/XBase.Demo.App/ViewModels/IndexListItemViewModel.cs | Creates index view model for table metadata display |
| src/demo/XBase.Demo.App/App.axaml | Adds data templates for view model rendering |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting
| private async Task ExecuteLoadTableAsync(TableListItemViewModel table) | ||
| { | ||
| var request = new TablePageRequest(0, 25); | ||
| var page = await _pageService.LoadPageAsync(table.Model, request); | ||
| TablePage.Apply(page); | ||
|
|
||
| CatalogStatus = _tables.Count > 0 | ||
| ? $"{_tables.Count} tables available. Showing {table.Name}." | ||
| : CatalogStatus; | ||
|
|
||
| var payload = new Dictionary<string, object?> | ||
| { | ||
| ["table"] = table.Name, | ||
| ["indexes"] = table.Indexes.Count, | ||
| ["rows"] = page.Rows.Count | ||
| }; |
There was a problem hiding this comment.
Update UI state from ReactiveCommand background thread
The body of ExecuteLoadTableAsync runs on the task pool because LoadTableCommand is created with ReactiveCommand.CreateFromTask and no scheduler override. Inside the method we mutate TablePage, CatalogStatus and _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 to RxApp.MainThreadScheduler or return a result and update the observable collections in a subscription on the main thread.
Useful? React with 👍 / 👎.
Summary
Testing
https://chatgpt.com/codex/tasks/task_e_68dd8a80a5bc8322b8e66d698de6b151
Summary by CodeRabbit
New Features
Tests
Chores