format and fix

This commit is contained in:
2026-02-24 23:01:11 +01:00
parent 1bb9241116
commit 81a6daaa75
17 changed files with 133 additions and 59 deletions

View File

@@ -1,12 +1,12 @@
import { relations, sql } from "drizzle-orm";
import {
boolean,
index,
jsonb,
pgTable,
text,
timestamp,
boolean,
uuid,
jsonb,
index,
} from "drizzle-orm/pg-core";
export const user = pgTable("user", {
@@ -43,7 +43,7 @@ export const session = pgTable(
.notNull()
.references(() => user.id, { onDelete: "cascade" }),
},
(table) => [index("session_userId_idx").on(table.userId)],
(table) => [index("session_userId_idx").on(table.userId)]
);
export const account = pgTable(
@@ -69,7 +69,7 @@ export const account = pgTable(
.$onUpdate(() => /* @__PURE__ */ new Date())
.notNull(),
},
(table) => [index("account_userId_idx").on(table.userId)],
(table) => [index("account_userId_idx").on(table.userId)]
);
export const verification = pgTable(
@@ -87,7 +87,7 @@ export const verification = pgTable(
.$onUpdate(() => /* @__PURE__ */ new Date())
.notNull(),
},
(table) => [index("verification_identifier_idx").on(table.identifier)],
(table) => [index("verification_identifier_idx").on(table.identifier)]
);
export const jwks = pgTable("jwks", {
@@ -240,7 +240,7 @@ export const oauthRefreshTokenRelations = relations(
references: [user.id],
}),
oauthAccessTokens: many(oauthAccessToken),
}),
})
);
export const oauthAccessTokenRelations = relations(
@@ -262,7 +262,7 @@ export const oauthAccessTokenRelations = relations(
fields: [oauthAccessToken.refreshId],
references: [oauthRefreshToken.id],
}),
}),
})
);
export const oauthConsentRelations = relations(oauthConsent, ({ one }) => ({

View File

@@ -59,6 +59,8 @@ class _MainAppState extends State<MainApp> {
end: domain.end,
);
});
_emitContentHeight();
}
List<TimelineGroup> _convertGroups(List<TimelineGroupData> groups) {
@@ -168,6 +170,25 @@ class _MainAppState extends State<MainApp> {
e,
];
});
_emitContentHeight();
}
void _emitContentHeight() {
var totalHeight = 0.0;
for (final group in _groups) {
totalHeight += ZTimelineConstants.groupHeaderHeight;
final groupEntries = _entries.where((e) => e.groupId == group.id);
var maxLane = 0;
for (final e in groupEntries) {
if (e.lane > maxLane) maxLane = e.lane;
}
final lanesCount = maxLane.clamp(0, 1000);
totalHeight += lanesCount * ZTimelineConstants.laneHeight
+ (lanesCount > 0 ? (lanesCount - 1) * ZTimelineConstants.laneVerticalSpacing : 0)
+ ZTimelineConstants.verticalOuterPadding * 2;
}
emitEvent('content_height', {'height': totalHeight});
}
String _labelForEntry(TimelineEntry entry) {

View File

@@ -75,6 +75,8 @@ class ZTimelineView extends StatelessWidget {
: ZTimelineConstants.minContentWidth;
return ListView.builder(
physics: const NeverScrollableScrollPhysics(),
shrinkWrap: true,
itemCount: groups.length,
itemBuilder: (context, index) {
final group = groups[index];
@@ -128,6 +130,7 @@ class _GroupHeader extends StatelessWidget {
final scheme = Theme.of(context).colorScheme;
return Container(
height: height,
padding: const EdgeInsets.only(left: 16.0),
alignment: Alignment.centerLeft,
decoration: BoxDecoration(
color: scheme.surfaceContainerHighest,