Skip to content

AdminPanel: Filter skill dropdown by character class when adding learned skills#714

Draft
Copilot wants to merge 3 commits intomasterfrom
copilot/adminpanel-filter-skills-by-class
Draft

AdminPanel: Filter skill dropdown by character class when adding learned skills#714
Copilot wants to merge 3 commits intomasterfrom
copilot/adminpanel-filter-skills-by-class

Conversation

Copy link
Contributor

Copilot AI commented Mar 20, 2026

  • Create SkillEntryCreationForm.razor component that filters skills by character class
  • Modify ItemTable.razor.cs to extract parent owner from ValueExpression and pass to ModalCreateNew
  • Modify ModalCreateNew.razor to accept an Owner parameter and use SkillEntryCreationForm when creating SkillEntry with a Character owner
  • Fix crash: Skill.Name is LocalizedString (not IComparable); use GetName() extension to sort alphabetically
Original prompt

This section details on the original issue you should resolve

<issue_title>AdminPanel: When adding skills, only show options that are allowed for the class</issue_title>
<issue_description>Is your feature request related to a problem? Please describe.
When editing a character's skills, the drop down shows skills of all character class.
It's hard to know which skill is allowed for that class.
User also needs to know the skill names when using the search text box.
(There is also that 'Level' field which I'm not sure what for)

Describe the solution you'd like
When adding skills, only show options that are allowed for the class.
(This is probably a subset of things to do in #561)

Describe alternatives you've considered
Alternatively, list all skills with checkbox markers whether it is learned or not

Additional context
Image
</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Update skill options to show allowed skills for class AdminPanel: Filter skill dropdown by character class when adding learned skills Mar 20, 2026
Copilot AI requested a review from sven-n March 20, 2026 22:32
@sven-n
Copy link
Member

sven-n commented Mar 20, 2026

@copilot When clicking the create button, the following error appears:

[2026-03-20T22:44:26.778Z] Error: System.InvalidOperationException: Failed to compare two elements in the array.
 ---> System.ArgumentException: At least one object must implement IComparable.
   at System.Collections.Comparer.Compare(Object a, Object b)
   at System.Collections.Generic.ObjectComparer`1.Compare(T x, T y)
   at System.Linq.Enumerable.EnumerableSorter`2.CompareAnyKeys_DefaultComparer_NoNext_Ascending(Int32 index1, Int32 index2)
   at System.Collections.Generic.ArraySortHelper`1.PickPivotAndPartition(Span`1 keys, Comparison`1 comparer)
   at System.Collections.Generic.ArraySortHelper`1.IntroSort(Span`1 keys, Int32 depthLimit, Comparison`1 comparer)
   at System.Collections.Generic.ArraySortHelper`1.Sort(Span`1 keys, Comparison`1 comparer)
   --- End of inner exception stack trace ---
   at System.Collections.Generic.ArraySortHelper`1.Sort(Span`1 keys, Comparison`1 comparer)
   at System.Linq.Enumerable.EnumerableSorter`2.QuickSort(Int32[] keys, Int32 lo, Int32 hi)
   at System.Linq.Enumerable.EnumerableSorter`1.Sort(TElement[] elements, Int32 count)
   at System.Linq.Enumerable.OrderedIterator`1.Fill(TElement[] buffer, Span`1 destination)
   at System.Linq.Enumerable.OrderedIterator`1.ToList()
   at MUnique.OpenMU.Web.Shared.Components.Form.SkillEntryCreationForm.OnParametersSet() in C:\Users\Sven\Documents\GitHub\OpenMU\src\Web\Shared\Components\Form\SkillEntryCreationForm.razor:line 79
   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync() blazor.web.ax6tuj8tun.js:1:42438
    log http://localhost/_framework/blazor.web.ax6tuj8tun.js:1
    unhandledError http://localhost/_framework/blazor.web.ax6tuj8tun.js:1
    startConnection http://localhost/_framework/blazor.web.ax6tuj8tun.js:1
    _invokeClientMethod http://localhost/_framework/blazor.web.ax6tuj8tun.js:1
    _processIncomingData http://localhost/_framework/blazor.web.ax6tuj8tun.js:1
    onreceive http://localhost/_framework/blazor.web.ax6tuj8tun.js:1
    onmessage http://localhost/_framework/blazor.web.ax6tuj8tun.js:1

…n SkillEntryCreationForm

Co-authored-by: sven-n <5238610+sven-n@users.noreply.github.com>
Agent-Logs-Url: https://github.com/MUnique/OpenMU/sessions/429c7ad2-eea4-4f25-9449-a18b3641ace5
Copy link
Contributor Author

Copilot AI commented Mar 20, 2026

@copilot When clicking the create button, the following error appears:

[2026-03-20T22:44:26.778Z] Error: System.InvalidOperationException: Failed to compare two elements in the...

Fixed in bef8f9d. Skill.Name is a LocalizedString which doesn't implement IComparable, so OrderBy(s => s.Name) failed at sort time. Changed to OrderBy(s => s.GetName()) which uses the ObjectExtensions.GetName() method returning a plain string.

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.

AdminPanel: When adding skills, only show options that are allowed for the class

2 participants