First, the main thing I want is to sort by current class and base stat (ie. I want to see all gear my current class will probably be interested in using).

Second, a "best gear set" toggle could make a list of everything on my person and in retainers to give my current class BiS I currently own (would be nice but not as useful as better sorting).

Third, get away from the icon inventories. Give me a list with columns. I can click on columns to add sorting, click multiple columns to sort multiple values (shift-click to add secondary sorting) ie. first sort = class, second sort = iLevel, third sort = stat so all class items would be together. Then, for each class, everything is sorted by level and then by main stat. Or, add a settings window that would allow me to add cascading ascending/descending conditions.

The command line sorting is black magic; it's ridiculous. Hell, just add sorting by class and main stat and I'd probably be happy tbh...