xtablo-source/go-backend/internal/web/views/discussion_view.go
Arthur Belleville dd1133d7cc
test(17-01): add failing test + view model + message bubble CSS (RED)
- Append .message-row/.message-own/.message-other/.message-bubble/.message-meta CSS classes to app.css
- Create discussion_view.go with DiscussionMessageView, DiscussionTabData, NewDiscussionTabData
- Create discussion_view_test.go with TestChatMainContentRendersBubbleClasses (RED: compile error expected)
2026-05-17 09:38:10 +02:00

47 lines
1.2 KiB
Go

package views
// DiscussionMessageView holds the data for a single chat message row.
type DiscussionMessageView struct {
Author string
Timestamp string
Body string
IsOwn bool
}
// DiscussionTabData holds the full data set for the discussion tab.
type DiscussionTabData struct {
Messages []DiscussionMessageView
}
// NewDiscussionTabData returns a DiscussionTabData populated with hardcoded demo
// messages that alternate IsOwn values for visual verification of bubble styles.
func NewDiscussionTabData() DiscussionTabData {
return DiscussionTabData{
Messages: []DiscussionMessageView{
{
Author: "you@xtablo.com",
Timestamp: "09:14",
Body: "Hey, any update on the design review?",
IsOwn: true,
},
{
Author: "other@xtablo.com",
Timestamp: "09:17",
Body: "Just finished — sharing the file in the tablo now.",
IsOwn: false,
},
{
Author: "you@xtablo.com",
Timestamp: "09:19",
Body: "Perfect, I'll take a look this afternoon.",
IsOwn: true,
},
{
Author: "other@xtablo.com",
Timestamp: "09:22",
Body: "Sounds good. Let me know if you need changes.",
IsOwn: false,
},
},
}
}