ec457debb3
The unfiled list has filtered archived chats since archiving existed (api/pages.py). The folder branch went through the ORM relationship, which filters nothing, so an archived chat kept appearing as long as it was filed -- and the "Empty" check read the same unfiltered list, so a folder holding only archived chats would have claimed to be empty while listing them. Fixed on the model rather than in the template, as `Folder.visible_chats`. The loop and the empty check now cannot disagree, because there is one list and the template binds it once. Ordering matches the unfiled list: pinned first, then most recently touched. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>