Skip to content

Stabilize substitutions row alignment and dynamic sizing on class switch#5

Draft
Luuuuuis with Copilot wants to merge 1 commit into
mainfrom
copilot/fix-latest-release-issue
Draft

Stabilize substitutions row alignment and dynamic sizing on class switch#5
Luuuuuis with Copilot wants to merge 1 commit into
mainfrom
copilot/fix-latest-release-issue

Conversation

Copilot AI commented Jul 20, 2026

Copy link
Copy Markdown

In 4.1, substitution rows started rendering with inconsistent indentation (notably first rows) and the substitutions container could keep stale sizing after switching classes. This change normalizes row layout constraints and class-label visibility logic so row geometry remains stable across data and class-context changes.

  • Row layout normalization

    • Restore a fixed leading width for the period column to prevent horizontal drift between rows.
    • Use explicit leading alignment on the row container to avoid implicit centering effects.
  • Width and sizing stability

    • Make each substitution row claim full available width (maxWidth: .infinity) so list cell sizing is recomputed consistently.
    • Keep horizontal distribution stable even when the class badge is conditionally hidden.
  • Class-context correctness

    • Compare against primaryClass (active class) instead of klasses.first when deciding whether to render the trailing class badge.
HStack(alignment: .center) {
    Text("\(substitution.period).")
        .font(.title2)
        .fontWeight(.bold)
        .frame(width: 40, alignment: .leading)

    VStack(alignment: .leading, spacing: 2) { ... }

    Spacer(minLength: 0)
    if substitution.klassName != session.user?.primaryClass {
        Text(substitution.klassName).font(.callout)
    }
}
.frame(maxWidth: .infinity, alignment: .leading)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants