Skip to content

feat(demo-app): deliver catalog shell milestone#35

Merged
luckydizzier merged 1 commit intomainfrom
codex/2025-10-01_20-23-51_implement-m1-from-tasks.md
Oct 1, 2025
Merged

feat(demo-app): deliver catalog shell milestone#35
luckydizzier merged 1 commit intomainfrom
codex/2025-10-01_20-23-51_implement-m1-from-tasks.md

Conversation

@luckydizzier
Copy link
Owner

@luckydizzier luckydizzier commented Oct 1, 2025

Summary

  • add data templates and reactive view models to represent catalog tables, indexes, and paging placeholders
  • wire the shell view for folder browsing, telemetry capture, and table preview commands through the host
  • introduce an integration smoke test project that exercises catalog discovery end-to-end

Testing

  • dotnet format xBase.sln
  • dotnet build xBase.sln -c Release
  • dotnet test xBase.sln --configuration Release

https://chatgpt.com/codex/tasks/task_e_68dd8a80a5bc8322b8e66d698de6b151

Summary by CodeRabbit

  • New Features

    • Enhanced main window with toolbar, status banner, and larger default size.
    • Added Open Catalog…, Reload actions and folder picker interaction.
    • Introduced tables list with selection and details panel showing indexes.
    • Added telemetry events panel and a table preview with paging summary.
    • New data templates for tables, indexes, and diagnostic events.
    • Busy indicator via progress bar and improved status display.
  • Tests

    • Added test project and scenarios validating catalog loading, selection, indexes, telemetry, and default paging.
  • Chores

    • Updated milestone tasks to completed.

Copilot AI review requested due to automatic review settings October 1, 2025 20:24
@coderabbitai
Copy link

coderabbitai bot commented Oct 1, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

Introduces 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

Cohort / File(s) Summary
App templates
src/demo/XBase.Demo.App/App.axaml
Adds vm and diag namespace mappings; defines DataTemplates for TableListItemViewModel, IndexListItemViewModel, and DemoTelemetryEvent.
View models
src/demo/XBase.Demo.App/ViewModels/IndexListItemViewModel.cs, .../TableListItemViewModel.cs, .../TablePageViewModel.cs, .../ShellViewModel.cs
Adds IndexListItemViewModel and TableListItemViewModel; adds TablePageViewModel with paging and summary; expands ShellViewModel with public collections, interactions, and commands (open/browse/refresh/load table) and new load/telemetry flow.
Views
src/demo/XBase.Demo.App/Views/MainWindow.axaml, .../MainWindow.axaml.cs
Reworks layout: toolbar, status, tables list, indexes, telemetry, table preview; binds to new properties/commands; implements folder-pick interaction via WhenActivated.
Tests and infra
tests/XBase.Demo.App.Tests/ShellViewModelTests.cs, tests/XBase.Demo.App.Tests/XBase.Demo.App.Tests.csproj, xBase.sln
Adds test validating OpenCatalogCommand flow and defaults; introduces test project with dependencies; adds project to solution.
Docs
src/demo/tasks.md
Marks Milestone M1 tasks as completed.

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
Loading
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
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Poem

I hopped through grids and lists so bright,
With indexes stacked just right tonight.
A catalog opened—paths in tow,
Telemetry twinkled with a glow.
Pages turn, summaries sing—
Test bells chime: ding-ding-ding!
Carrot-approve this springy thing. 🥕✨

✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch codex/2025-10-01_20-23-51_implement-m1-from-tasks.md

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 8551c94 and 240b407.

📒 Files selected for processing (11)
  • src/demo/XBase.Demo.App/App.axaml (1 hunks)
  • src/demo/XBase.Demo.App/ViewModels/IndexListItemViewModel.cs (1 hunks)
  • src/demo/XBase.Demo.App/ViewModels/ShellViewModel.cs (5 hunks)
  • src/demo/XBase.Demo.App/ViewModels/TableListItemViewModel.cs (1 hunks)
  • src/demo/XBase.Demo.App/ViewModels/TablePageViewModel.cs (1 hunks)
  • src/demo/XBase.Demo.App/Views/MainWindow.axaml (1 hunks)
  • src/demo/XBase.Demo.App/Views/MainWindow.axaml.cs (2 hunks)
  • src/demo/tasks.md (1 hunks)
  • tests/XBase.Demo.App.Tests/ShellViewModelTests.cs (1 hunks)
  • tests/XBase.Demo.App.Tests/XBase.Demo.App.Tests.csproj (1 hunks)
  • xBase.sln (3 hunks)

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@luckydizzier luckydizzier merged commit 44579b0 into main Oct 1, 2025
1 check was pending
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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

Comment on lines +193 to +208
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
};

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants