Skip to content
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

Scorecard Day Playing #592

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft

Conversation

mattleibow
Copy link
Member

@mattleibow mattleibow commented Mar 4, 2025

Description

My goal here was to try and get the AI to convert a TableView into a non-TableView format.

In my mind, the table view is more a vertical stack in a scroll.

Visual Studio

The default VS copilot chat with the models were really bad. It refused to give me what I asked and then also started to get angry and gave me invalid code. It got worse and worse, even after resetting the chat. It was like spite.

VSCode

I switched to use the agent mode in VSCode and right out the box it was better. I still had to add a copilot-instructions.md to give it some basic guidance on what things were obsolete. But I assume that most of this was because the types were not marked as obsolete. For example, it tried Frame and then saw it was obsolete and switched.

The AI loved to replace things with an advanced CollectionView with all sorts of templating. But, when I wrote this file it stopped and used the VSL. The default copilot chat just got angry and returned invalid XAML for the CollectionView that would not even compile.

My prompt: Can you fix the issues in this file?

This was my instructions file:

# TableView

TableView is deprecated and should not be used in new apps. It is going
to be removed in a future release of .NET MAUI.

TableView is not virtualized and it isn't designed to support binding to
a collection of items. Replace with a `VerticalStackLayout`.

When replacing the items in the TableView, the section headings and
groupings should be preserved.

Cells should not be replaced with `Button`, use a tap gesture recognizer
on the view or layout that represents the cell.

Summary

Overall, the agent mode was nothing short of replacing me. The VS GitHub Chat (non agent) got angry and started being spiteful. Not making mistakes, but I am sure it got angry. The things that it was happy to do before it just ignored me and gave me wrong results. Only way to fix it was to restart VS.

Playing with the agent mode gives me some ideas on how better to annotate the maui codebase so it can make better changes.

Questions

  • Why did the AI get angry and start going beserk?
  • Is there a way to add some additional attributes, XML comments, or something to the types to give AI more help? Like I see that marking a type as [Obsolete] will make it try something else, but what if we want more than that?

@mattleibow mattleibow marked this pull request as draft March 4, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant