0.2.37: live funds above exited ones in the investor portal

A fully-exited fund/SPV card sinks to the bottom of the LP's stack
instead of sitting between active funds (stable sort, shared by the
LP portal and the admin Investor View).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Jonathan Kirkwood
2026-07-03 12:07:05 -05:00
co-authored by Claude Opus 4.8
parent 1deb6586b0
commit 053bfeab23
6 changed files with 28 additions and 6 deletions
+9 -1
View File
@@ -35,6 +35,14 @@ export default function InvestorPortalView({
accounts.filter((a) => a.exited_on).map((a) => `${a.entity_id}:${a.investor_user_id}`),
).size;
// Live funds first; a fund where every position is exited sinks to the bottom so closed
// positions never sit between active ones. Stable sort keeps the original order otherwise.
const isClosed = (e: Entity) => {
const own = accounts.filter((a) => a.entity_id === e.id);
return own.length > 0 && own.every((a) => a.exited_on);
};
const ordered = [...entities].sort((a, b) => Number(isClosed(a)) - Number(isClosed(b)));
return (
<div className="space-y-8">
{activeEntityCount > 1 && (
@@ -44,7 +52,7 @@ export default function InvestorPortalView({
exitedCount={exitedPositions}
/>
)}
{entities.map((e) => (
{ordered.map((e) => (
<FundSection
key={e.id}
entity={e}
+1 -1
View File
@@ -1,4 +1,4 @@
// Bumped each release so the running build is visible in the UI.
// If the number shown in the app doesn't match the installed s9pk version,
// the new frontend isn't actually being served.
export const APP_VERSION = "0.2.36";
export const APP_VERSION = "0.2.37";