From 19639e01600d37c71d6597f8cf2a5fd9d894bdab Mon Sep 17 00:00:00 2001 From: Brittany Ellich Date: Mon, 1 Jun 2026 08:05:03 -0700 Subject: [PATCH] feat(connections): render current-event association checkbox Add CurrentEventURI, CurrentEventName, ConnRecordURI, and AssociatedWithCurrent fields to ProfileView, conditionally render a "met at " checkbox inside the .pv-notes-section when both fields are non-empty, and include connection-event.js. Co-Authored-By: Claude Opus 4.8 --- features/connections/pages/profile.templ | 18 ++++ features/connections/pages/profile_templ.go | 95 ++++++++++++++++----- 2 files changed, 94 insertions(+), 19 deletions(-) diff --git a/features/connections/pages/profile.templ b/features/connections/pages/profile.templ index 0b53e39..30bef0b 100644 --- a/features/connections/pages/profile.templ +++ b/features/connections/pages/profile.templ @@ -26,6 +26,12 @@ type ProfileView struct { EventName string // event where connection happened, if any Notes string // private notes from SQLite FollowUp bool // follow-up flag from SQLite + // Current-event association (only populated for ATProto viewers who are + // checked into an ongoing event AND have a PDS connection record here). + CurrentEventURI string // at-uri of the ongoing event, "" if not checked in + CurrentEventName string // display name for the checkbox label + ConnRecordURI string // at-uri (rkey) of the record to update, "" if none + AssociatedWithCurrent bool // initial checked state } // ProfileLink is a labeled URL from the target's quest.atmo.profile. @@ -166,6 +172,17 @@ templ ProfileViewPage(v ProfileView) { } ⚑ follow up after the conference + if v.CurrentEventURI != "" && v.ConnRecordURI != "" { + + } @@ -183,6 +200,7 @@ templ ProfileViewPage(v ProfileView) { @layouts.BottomNav("connections") + } } diff --git a/features/connections/pages/profile_templ.go b/features/connections/pages/profile_templ.go index 4ef482f..5a900c8 100644 --- a/features/connections/pages/profile_templ.go +++ b/features/connections/pages/profile_templ.go @@ -34,6 +34,12 @@ type ProfileView struct { EventName string // event where connection happened, if any Notes string // private notes from SQLite FollowUp bool // follow-up flag from SQLite + // Current-event association (only populated for ATProto viewers who are + // checked into an ongoing event AND have a PDS connection record here). + CurrentEventURI string // at-uri of the ongoing event, "" if not checked in + CurrentEventName string // display name for the checkbox label + ConnRecordURI string // at-uri (rkey) of the record to update, "" if none + AssociatedWithCurrent bool // initial checked state } // ProfileLink is a labeled URL from the target's quest.atmo.profile. @@ -90,7 +96,7 @@ func ProfileViewPage(v ProfileView) templ.Component { var templ_7745c5c3_Var3 string templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinStringErrs("@") if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 49, Col: 56} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 55, Col: 56} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3)) if templ_7745c5c3_Err != nil { @@ -103,7 +109,7 @@ func ProfileViewPage(v ProfileView) templ.Component { var templ_7745c5c3_Var4 string templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(shortDID(v.TargetDID)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 50, Col: 62} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 56, Col: 62} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4)) if templ_7745c5c3_Err != nil { @@ -121,7 +127,7 @@ func ProfileViewPage(v ProfileView) templ.Component { var templ_7745c5c3_Var5 string templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.ResolveAttributeValue(v.AvatarURL) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 57, Col: 48} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 63, Col: 48} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var5) if templ_7745c5c3_Err != nil { @@ -134,7 +140,7 @@ func ProfileViewPage(v ProfileView) templ.Component { var templ_7745c5c3_Var6 string templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.ResolveAttributeValue(avatarAlt(v.DisplayName)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 57, Col: 81} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 63, Col: 81} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var6) if templ_7745c5c3_Err != nil { @@ -162,7 +168,7 @@ func ProfileViewPage(v ProfileView) templ.Component { var templ_7745c5c3_Var7 string templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(v.DisplayName) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 64, Col: 43} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 70, Col: 43} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7)) if templ_7745c5c3_Err != nil { @@ -186,7 +192,7 @@ func ProfileViewPage(v ProfileView) templ.Component { var templ_7745c5c3_Var8 string templ_7745c5c3_Var8, templ_7745c5c3_Err = templ.JoinStringErrs("@" + v.Handle) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 69, Col: 62} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 75, Col: 62} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var8)) if templ_7745c5c3_Err != nil { @@ -204,7 +210,7 @@ func ProfileViewPage(v ProfileView) templ.Component { var templ_7745c5c3_Var9 string templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs(v.TargetDID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 71, Col: 59} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 77, Col: 59} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9)) if templ_7745c5c3_Err != nil { @@ -227,7 +233,7 @@ func ProfileViewPage(v ProfileView) templ.Component { var templ_7745c5c3_Var10 string templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs(v.ConnectedAt) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 80, Col: 75} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 86, Col: 75} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10)) if templ_7745c5c3_Err != nil { @@ -246,7 +252,7 @@ func ProfileViewPage(v ProfileView) templ.Component { var templ_7745c5c3_Var11 string templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs(v.EventName) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 84, Col: 58} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 90, Col: 58} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11)) if templ_7745c5c3_Err != nil { @@ -304,7 +310,7 @@ func ProfileViewPage(v ProfileView) templ.Component { var templ_7745c5c3_Var12 string templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(v.WorksAt) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 104, Col: 49} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 110, Col: 49} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12)) if templ_7745c5c3_Err != nil { @@ -323,7 +329,7 @@ func ProfileViewPage(v ProfileView) templ.Component { var templ_7745c5c3_Var13 string templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(v.Location) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 110, Col: 50} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 116, Col: 50} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13)) if templ_7745c5c3_Err != nil { @@ -342,7 +348,7 @@ func ProfileViewPage(v ProfileView) templ.Component { var templ_7745c5c3_Var14 string templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(v.ContactMethod) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 116, Col: 55} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 122, Col: 55} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14)) if templ_7745c5c3_Err != nil { @@ -371,7 +377,7 @@ func ProfileViewPage(v ProfileView) templ.Component { var templ_7745c5c3_Var15 templ.SafeURL templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(link.URL)) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 129, Col: 42} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 135, Col: 42} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15)) if templ_7745c5c3_Err != nil { @@ -384,7 +390,7 @@ func ProfileViewPage(v ProfileView) templ.Component { var templ_7745c5c3_Var16 string templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(link.Label) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 129, Col: 128} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 135, Col: 128} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16)) if templ_7745c5c3_Err != nil { @@ -413,7 +419,7 @@ func ProfileViewPage(v ProfileView) templ.Component { var templ_7745c5c3_Var17 string templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(interest) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 141, Col: 58} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 147, Col: 58} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17)) if templ_7745c5c3_Err != nil { @@ -436,7 +442,7 @@ func ProfileViewPage(v ProfileView) templ.Component { var templ_7745c5c3_Var18 string templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.ResolveAttributeValue(v.TargetDID) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 148, Col: 64} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 154, Col: 64} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ_7745c5c3_Var18) if templ_7745c5c3_Err != nil { @@ -449,7 +455,7 @@ func ProfileViewPage(v ProfileView) templ.Component { var templ_7745c5c3_Var19 string templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(v.Notes) if templ_7745c5c3_Err != nil { - return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 160, Col: 16} + return templ.Error{Err: templ_7745c5c3_Err, FileName: `features/connections/pages/profile.templ`, Line: 166, Col: 16} } _, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19)) if templ_7745c5c3_Err != nil { @@ -470,7 +476,58 @@ func ProfileViewPage(v ProfileView) templ.Component { return templ_7745c5c3_Err } } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "⚑ follow up after the conference") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 50, "⚑ follow up after the conference ") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + if v.CurrentEventURI != "" && v.ConnRecordURI != "" { + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, "") + if templ_7745c5c3_Err != nil { + return templ_7745c5c3_Err + } + } + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 57, "") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } @@ -478,7 +535,7 @@ func ProfileViewPage(v ProfileView) templ.Component { if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } - templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 51, " ") + templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 58, " ") if templ_7745c5c3_Err != nil { return templ_7745c5c3_Err } -- knotmirror 0.0.1