Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ require (
charm.land/glamour/v2 v2.0.1
charm.land/lipgloss/v2 v2.0.6
github.com/basecamp/actioncable-go v0.0.0-20260824145920-822e6cf08655
github.com/basecamp/hey-sdk/go v0.25.0
github.com/basecamp/hey-sdk/go v0.27.0
github.com/charmbracelet/x/ansi v0.11.8
github.com/fsnotify/fsnotify v1.10.1
github.com/gofrs/flock v0.13.0
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuP
github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
github.com/basecamp/actioncable-go v0.0.0-20260824145920-822e6cf08655 h1:zz0WUSEmjURj0T+soXuTtgX291nYouqa+UoyYY3Xxk8=
github.com/basecamp/actioncable-go v0.0.0-20260824145920-822e6cf08655/go.mod h1:ezaV5z1GXQAsqyejqTs6wCFl2D8Wj+COLQkHc/kwoRs=
github.com/basecamp/hey-sdk/go v0.25.0 h1:d1dHUXzMimExHeGqAp10/BsbK0j9b99m8D0WO3kbVkA=
github.com/basecamp/hey-sdk/go v0.25.0/go.mod h1:k6sO2XhMkU3UY8lD2ozp0735Ic3q8xoMQt7YUT3TlYk=
github.com/basecamp/hey-sdk/go v0.27.0 h1:LAX80V/WqV3hz9c3xqXcm6/2f0Qd2n5YxBIJ/qK6fF0=
github.com/basecamp/hey-sdk/go v0.27.0/go.mod h1:k6sO2XhMkU3UY8lD2ozp0735Ic3q8xoMQt7YUT3TlYk=
github.com/blang/semver v3.5.1+incompatible h1:cQNTCjp13qL8KC3Nbxr/y2Bqb63oX6wdnnjpJbkM4JQ=
github.com/blang/semver v3.5.1+incompatible/go.mod h1:kRBLl5iJ+tD4TcOOxsy/0fnwebNt5EWlYSAyrTnjyyk=
github.com/bmatcuk/doublestar v1.1.1/go.mod h1:UD6OnuiIn0yFxxA2le/rnRU1G4RaI4UvFv1sNto9p6w=
Expand Down
18 changes: 11 additions & 7 deletions internal/mail/posting.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,16 @@ type Posting struct {
Summary string
AlternativeSenderName string
Seen bool
BubbledUp bool
Muted bool
VisibleEntryCount int32
Creator Contact
Extenzions []Extenzion
Folders []Folder
Collections []Collection
// IsBundle marks a row that is a bundle of one contact's unseen threads. It comes
// from the posting's kind — HEY's `bundled` flag means filed *inside* a bundle.
IsBundle bool
BubbledUp bool
Muted bool
VisibleEntryCount int32
Creator Contact
Extenzions []Extenzion
Folders []Folder
Collections []Collection
}

// Contact is who a posting came from.
Expand Down Expand Up @@ -76,6 +79,7 @@ func NewPosting(posting generated.Posting) Posting {
Summary: terminal.SanitizeLine(posting.Summary),
AlternativeSenderName: terminal.SanitizeLine(posting.AlternativeSenderName),
Seen: posting.Seen,
IsBundle: posting.Kind == "bundle",
BubbledUp: posting.BubbledUp,
Muted: posting.Muted,
VisibleEntryCount: posting.VisibleEntryCount,
Expand Down
11 changes: 9 additions & 2 deletions internal/mail/posting_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func TestNewPostingKeepsWhatARowShows(t *testing.T) {
Summary: "Here is the revised quote for the cabinets",
AlternativeSenderName: "Ryan at Fine Woodwork",
Seen: true,
Bundled: true,
BubbledUp: true,
Muted: true,
VisibleEntryCount: 3,
Expand All @@ -34,7 +35,8 @@ func TestNewPostingKeepsWhatARowShows(t *testing.T) {
if posting.ID != 4471829 || posting.TopicID != 501 || posting.Name != "Kitchen remodel quote" {
t.Errorf("posting = %+v", posting)
}
if !posting.Seen || !posting.BubbledUp || !posting.Muted || posting.VisibleEntryCount != 3 {
// HEY's `bundled` means filed inside a bundle; only kind "bundle" makes a row one.
if !posting.Seen || posting.IsBundle || !posting.BubbledUp || !posting.Muted || posting.VisibleEntryCount != 3 {
t.Errorf("posting state = %+v", posting)
}
if posting.Summary != "Here is the revised quote for the cabinets" || posting.AlternativeSenderName != "Ryan at Fine Woodwork" {
Expand Down Expand Up @@ -129,12 +131,17 @@ func TestTopicIDOfFallsBackToTheBundleURL(t *testing.T) {
}

for name, test := range tests {
test.posting.Kind = "bundle"
if got := TopicIDOf(test.posting); got != test.want {
t.Errorf("%s: topic ID = %d, want %d", name, got, test.want)
}
if described := NewPosting(test.posting); described.TopicID != test.want {
described := NewPosting(test.posting)
if described.TopicID != test.want {
t.Errorf("%s: NewPosting topic ID = %d, want %d", name, described.TopicID, test.want)
}
if !described.IsBundle {
t.Errorf("%s: a kind %q posting should be a bundle", name, test.posting.Kind)
}
}
}

Expand Down
1 change: 1 addition & 0 deletions internal/tui/collections_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ func TestMailViewCollectionMembershipFailureKeepsState(t *testing.T) {
func TestMailViewCollectionMembershipRequiresTopicID(t *testing.T) {
v, recorded := mailWithTestServer(t, http.StatusNoContent)
v.boxes = append(v.boxes, mail.Source{ID: 12, Kind: mail.KindCollection, Name: "Kitchen remodel"})
v.postingList.postings[0].TopicID = 0

if cmd := v.HandleContentKey(keyPress("n")); cmd != nil {
t.Fatal("unresolved posting should not start a mutation")
Expand Down
Loading
Loading