Avoid repeated flatten+sort for comment aggregates
packages/app/src/context/comments.tsx derives all by flattening all file comment arrays and sorting on every change. This is simple but can become expensive with many comments. We will maintain an indexed aggregate structure incrementally.
comments.list(file) behavior unchangedcomments.all() retrieval near O(1) for readsThis spec owns:
packages/app/src/context/comments.tsxThis spec should not modify:
packages/app/src/pages/session.tsxpackages/ui/src/components/line-comment.tsxcommentsByFile (existing) plus an allComments array in chronological order.add: append new comment to file list and aggregate list.remove: remove from file list and aggregate list by id/file.clear: reset both structures and focus/active state.list(file) reads file list directly.all() returns pre-indexed aggregate list without per-read flatten+sort.comments.all() no longer flattens and sorts every reactive run.time.add/remove/clear/focus/active semantics remain unchanged.file + id pair.