feat: issue detail extraction, inbox enhancements, misc UI polish
- Extract IssueDetail into reusable component - Inbox: add body/type fields, bulk actions, read state - Pages: consistent layout patterns - Workspace avatar, markdown, realtime sync improvements Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
59816b807b
commit
655aa40732
24 changed files with 1144 additions and 950 deletions
|
|
@ -11,6 +11,46 @@ import (
|
|||
"github.com/jackc/pgx/v5/pgtype"
|
||||
)
|
||||
|
||||
const archiveAllInbox = `-- name: ArchiveAllInbox :execrows
|
||||
UPDATE inbox_item SET archived = true
|
||||
WHERE recipient_type = 'member' AND recipient_id = $1 AND archived = false
|
||||
`
|
||||
|
||||
func (q *Queries) ArchiveAllInbox(ctx context.Context, recipientID pgtype.UUID) (int64, error) {
|
||||
result, err := q.db.Exec(ctx, archiveAllInbox, recipientID)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return result.RowsAffected(), nil
|
||||
}
|
||||
|
||||
const archiveAllReadInbox = `-- name: ArchiveAllReadInbox :execrows
|
||||
UPDATE inbox_item SET archived = true
|
||||
WHERE recipient_type = 'member' AND recipient_id = $1 AND read = true AND archived = false
|
||||
`
|
||||
|
||||
func (q *Queries) ArchiveAllReadInbox(ctx context.Context, recipientID pgtype.UUID) (int64, error) {
|
||||
result, err := q.db.Exec(ctx, archiveAllReadInbox, recipientID)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return result.RowsAffected(), nil
|
||||
}
|
||||
|
||||
const archiveCompletedInbox = `-- name: ArchiveCompletedInbox :execrows
|
||||
UPDATE inbox_item SET archived = true
|
||||
WHERE recipient_type = 'member' AND recipient_id = $1 AND archived = false
|
||||
AND issue_id IN (SELECT id FROM issue WHERE status IN ('done', 'cancelled'))
|
||||
`
|
||||
|
||||
func (q *Queries) ArchiveCompletedInbox(ctx context.Context, recipientID pgtype.UUID) (int64, error) {
|
||||
result, err := q.db.Exec(ctx, archiveCompletedInbox, recipientID)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return result.RowsAffected(), nil
|
||||
}
|
||||
|
||||
const archiveInboxItem = `-- name: ArchiveInboxItem :one
|
||||
UPDATE inbox_item SET archived = true
|
||||
WHERE id = $1
|
||||
|
|
@ -179,6 +219,19 @@ func (q *Queries) ListInboxItems(ctx context.Context, arg ListInboxItemsParams)
|
|||
return items, nil
|
||||
}
|
||||
|
||||
const markAllInboxRead = `-- name: MarkAllInboxRead :execrows
|
||||
UPDATE inbox_item SET read = true
|
||||
WHERE recipient_type = 'member' AND recipient_id = $1 AND archived = false AND read = false
|
||||
`
|
||||
|
||||
func (q *Queries) MarkAllInboxRead(ctx context.Context, recipientID pgtype.UUID) (int64, error) {
|
||||
result, err := q.db.Exec(ctx, markAllInboxRead, recipientID)
|
||||
if err != nil {
|
||||
return 0, err
|
||||
}
|
||||
return result.RowsAffected(), nil
|
||||
}
|
||||
|
||||
const markInboxRead = `-- name: MarkInboxRead :one
|
||||
UPDATE inbox_item SET read = true
|
||||
WHERE id = $1
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue