Currently, you can "work around" this but it requires many steps* to pull off. If you want to look at an existing implementation that people like, try out Kami or Ender. People keep begging Nightdawg to add it to Hurricane but unlike on the user-side, on the back-end the whole thing is a monstrosity. It's ahrd to explain exactly why if you're not a programmer (I personally don't quite get it either, I mainly trust Nightdawg when he says that is why he won't just copy-paste it in his client like dozen people have asked him to.)
(*) step-by-step guide, assuming you use default client:
1. put the stuff you want to sort in a stockpile
2. turn off stacking
3. take back the stuff
4. alt+click it into an empty Cupboard so it's sorted by quality
5. sort/filter
6. put everything into a stockpile
7. turn on stacking
8. take back the stuff