When pinning a library, the sorting of all items in the library resets

Description

After selecting "pin library" in the right click context menu, the previous sort order of all items in the Library List (both in Footprint editor and Symbol editor) resets. I want to sort all items with pin items at the top. This order gets lost after adding a new pin.

Screenshot_2024-06-09_160243

Steps to reproduce

  • sort list by Item
  • Right click to open context menu when clicking item in library list
  • Select "pin library" in context menu
Application: KiCad Footprint Editor x64 on x64

Version: 8.0.3, release build

Libraries:
	wxWidgets 3.2.4
	FreeType 2.12.1
	HarfBuzz 8.3.0
	FontConfig 2.14.2

Platform: Windows 11 (build 22631), 64-bit edition, 64 bit, Little endian, wxMSW
OpenGL: NVIDIA Corporation, NVIDIA GeForce RTX 3090/PCIe/SSE2, 4.6.0 NVIDIA 555.85

	wxWidgets: 3.2.4 (wchar_t,wx containers)
	Boost: 1.83.0
	OCC: 7.8.1
	Curl: 8.5.0-DEV
	ngspice: 42
	Compiler: Visual C++ 1939 without C++ ABI

Build settings: