From 5c97f1cc886344bb8a9eba315a39c0fc14cee51f Mon Sep 17 00:00:00 2001 From: oppiliappan Date: Tue, 09 Jun 2026 13:02:09 +0000 Subject: [PATCH] appview/pages: UI bits for focus mode Signed-off-by: oppiliappan --- input.css | 14 +++++++++++++- appview/issues/issues.go | 10 +++++----- appview/knots/knots.go | 4 ++-- appview/notifications/notifications.go | 16 ++++++++++++++-- appview/pages/funcmap.go | 4 ++++ appview/pages/pages.go | 276 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++------------------------------------------------------------------------------------------------------------------------------------ appview/pipelines/pipelines.go | 14 +++++++------- appview/pulls/comment.go | 8 ++++---- appview/pulls/compose.go | 2 +- appview/pulls/list.go | 2 +- appview/pulls/single.go | 4 ++-- appview/repo/artifact.go | 4 ++-- appview/repo/branches.go | 2 +- appview/repo/compare.go | 24 ++++++++++++------------ appview/repo/index.go | 4 ++-- appview/repo/log.go | 4 ++-- appview/repo/repo.go | 36 ++++++++++++++++++------------------ appview/repo/settings.go | 8 ++++---- appview/repo/tags.go | 4 ++-- appview/repo/webhooks.go | 8 ++++---- appview/settings/settings.go | 12 ++++++------ appview/spindles/spindles.go | 12 ++++++------ appview/state/gfi.go | 16 ++++++++-------- appview/state/profile.go | 40 ++++++++++++++++++++-------------------- appview/state/search.go | 16 ++++++++-------- appview/state/state.go | 2 +- appview/strings/strings.go | 10 +++++----- appview/timeline/home.go | 2 +- appview/pages/templates/layouts/base.html | 2 ++ appview/pages/templates/notifications/list.html | 23 ++++------------------- appview/pages/templates/focus/fragments/beginButton.html | 10 ++++++++++ appview/pages/templates/focus/fragments/pill.html | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ appview/pages/templates/notifications/fragments/count.html | 2 +- appview/pages/templates/notifications/fragments/preview.html | 32 ++++++++++++++++++-------------- appview/pages/templates/timeline/fragments/notifications.html | 18 ++++++++++-------- 35 file(s) changed, 396 insertion(s)(+), 301 deletion(s)(-) diff --git a/input.css b/input.css --- a/input.css +++ b/input.css @@ -217,12 +217,13 @@ @apply hover:bg-gray-50 dark:hover:bg-gray-700 hover:before:shadow-[inset_0_-2px_0_0_theme(colors.gray.300)] dark:hover:before:shadow-[inset_0_-2px_0_0_theme(colors.gray.800)] active:before:shadow-[inset_0_2px_2px_0_theme(colors.gray.200)] dark:active:before:shadow-[inset_0_2px_2px_0_theme(colors.gray.900)] + active:translate-y-0.5 disabled:cursor-not-allowed disabled:opacity-50; } .btn-flat { @apply inline-flex items-center justify-center - min-h-7 px-2 py-[6px] + min-h-[30px] px-2 py-[6px] rounded text-sm text-gray-900 dark:text-gray-100 cursor-pointer transition-colors duration-150 ease-in-out @@ -249,6 +250,17 @@ before:shadow-none hover:before:shadow-none active:before:shadow-none; + } + + .btn-primary { + @apply btn text-white + bg-indigo-600 hover:bg-indigo-700 dark:bg-indigo-500 dark:hover:bg-indigo-600 + border border-indigo-700 hover:border-indigo-800 dark:border-indigo-600 dark:hover:border-indigo-700 + focus-visible:outline-indigo-500 + disabled:bg-indigo-400 dark:disabled:bg-indigo-400 + before:shadow-[inset_0_-2px_0_0_theme(colors.gray.900/25%)] + hover:before:shadow-[inset_0_-2px_0_0_theme(colors.gray.900/25%)] + active:before:shadow-[inset_0_2px_2px_0_theme(colors.gray.900/50%)]; } .btn-cancel { diff --git a/appview/issues/issues.go b/appview/issues/issues.go --- a/appview/issues/issues.go +++ b/appview/issues/issues.go @@ -166,7 +166,7 @@ } err = rp.pages.RepoSingleIssue(w, pages.RepoSingleIssueParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), RepoInfo: rp.repoResolver.GetRepoInfo(r, user), Issue: issue, CommentList: models.NewCommentList(issue.Comments), @@ -196,8 +196,8 @@ case http.MethodGet: rp.pages.EditIssueFragment(w, pages.EditIssueParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - RepoInfo: rp.repoResolver.GetRepoInfo(r, user), - Issue: issue, + RepoInfo: rp.repoResolver.GetRepoInfo(r, user), + Issue: issue, }) case http.MethodPost: noticeId := "issues" @@ -632,7 +632,7 @@ } baseFilterQuery := strings.Join(baseFilterParts, " ") rp.pages.RepoIssues(w, pages.RepoIssuesParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), RepoInfo: repoInfo, Issues: issues, IssueCount: totalIssues, @@ -661,7 +661,7 @@ case http.MethodGet: rp.pages.RepoNewIssue(w, pages.RepoNewIssueParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - RepoInfo: rp.repoResolver.GetRepoInfo(r, user), + RepoInfo: rp.repoResolver.GetRepoInfo(r, user), }) case http.MethodPost: body := r.FormValue("body") diff --git a/appview/knots/knots.go b/appview/knots/knots.go --- a/appview/knots/knots.go +++ b/appview/knots/knots.go @@ -90,7 +90,7 @@ k.Pages.Knots(w, pages.KnotsParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - Knots: knots, + Knots: knots, }) } @@ -141,7 +141,7 @@ } k.Pages.Knot(w, pages.KnotParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), Registration: ®istration, Members: members, Repos: repoMap, diff --git a/appview/notifications/notifications.go b/appview/notifications/notifications.go --- a/appview/notifications/notifications.go +++ b/appview/notifications/notifications.go @@ -152,8 +152,13 @@ l.Error("failed to count social unread", "err", err) } + focusCount, err := db.CountFocusNotifs(n.db, user.Did) + if err != nil { + l.Error("failed to count focus notifs", "err", err) + } + err = n.pages.Notifications(w, pages.NotificationsParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), MobileGroups: pages.GroupNotificationsByDate(notifications), WorkGroups: pages.GroupNotificationsByDate(workNotifications), SocialGroups: pages.GroupNotificationsByDate(socialNotifications), @@ -163,6 +168,7 @@ Total: total, ReadFilter: readFilter, CategoryFilter: categoryFilter, + CanFocus: focusCount > 1, }) if err != nil { l.Error("failed to render page", "err", err) @@ -186,11 +192,17 @@ return } + focusCount, err := db.CountFocusNotifs(n.db, user.Did) + if err != nil { + l.Error("failed to count focus notifs", "err", err) + } + err = n.pages.NotificationPreview(w, pages.NotificationPreviewParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), Notifications: notifications, ReadFilter: readFilter, CategoryFilter: categoryFilter, + CanFocus: focusCount > 1, }) if err != nil { l.Error("failed to render notification preview", "err", err) diff --git a/appview/pages/funcmap.go b/appview/pages/funcmap.go --- a/appview/pages/funcmap.go +++ b/appview/pages/funcmap.go @@ -77,6 +77,9 @@ "resolve": func(s string) string { return p.DisplayHandle(context.Background(), s) }, + "resolver": func() *idresolver.Resolver { + return p.resolver + }, "primaryHandle": func(s string) string { return primaryHandle(p.resolver, s) }, @@ -383,6 +386,7 @@ // returns false for other "zero" values return t == nil }, + "hasPrefix": strings.HasPrefix, "list": func(args ...any) []any { return args }, diff --git a/appview/pages/pages.go b/appview/pages/pages.go --- a/appview/pages/pages.go +++ b/appview/pages/pages.go @@ -42,6 +42,19 @@ type BaseParams struct { LoggedInUser *oauth.MultiAccountUser + FocusParams FocusParams +} + +type FocusParams struct { + Focusing bool + FocusLink string + FocusNotificationID int64 + CurrentPath string // r.URL.Path, for off-focus detection in templates + FocusCount int // total unread focus-eligible items remaining +} + +func (p *Pages) Resolver() *idresolver.Resolver { + return p.resolver } func BaseParamsIntoContext(ctx context.Context, bp BaseParams) context.Context { @@ -384,7 +397,7 @@ type PrivacyPolicyParams struct { BaseParams - Content template.HTML + Content template.HTML } func (p *Pages) PrivacyPolicy(w io.Writer, params PrivacyPolicyParams) error { @@ -458,11 +471,11 @@ type GoodFirstIssuesParams struct { BaseParams - Issues []models.Issue - RepoGroups []*models.RepoGroup - LabelDefs map[string]*models.LabelDefinition - GfiLabel *models.LabelDefinition - Page pagination.Page + Issues []models.Issue + RepoGroups []*models.RepoGroup + LabelDefs map[string]*models.LabelDefinition + GfiLabel *models.LabelDefinition + Page pagination.Page } func (p *Pages) GoodFirstIssues(w io.Writer, params GoodFirstIssuesParams) error { @@ -550,11 +563,10 @@ return p.executePlain("notifications/fragments/preview", w, params) } - type UserKeysSettingsParams struct { BaseParams - PubKeys []models.PublicKey - Tab string + PubKeys []models.PublicKey + Tab string } func (p *Pages) UserKeysSettings(w io.Writer, params UserKeysSettingsParams) error { @@ -564,8 +576,8 @@ type UserEmailsSettingsParams struct { BaseParams - Emails []models.Email - Tab string + Emails []models.Email + Tab string } func (p *Pages) UserEmailsSettings(w io.Writer, params UserEmailsSettingsParams) error { @@ -575,8 +587,8 @@ type UserNotificationSettingsParams struct { BaseParams - Preferences *models.NotificationPreferences - Tab string + Preferences *models.NotificationPreferences + Tab string } func (p *Pages) UserNotificationSettings(w io.Writer, params UserNotificationSettingsParams) error { @@ -620,8 +632,8 @@ type KnotsParams struct { BaseParams - Knots []KnotListingParams - Tab string + Knots []KnotListingParams + Tab string } func (p *Pages) Knots(w io.Writer, params KnotsParams) error { @@ -654,8 +666,8 @@ type SpindlesParams struct { BaseParams - Spindles []models.Spindle - Tab string + Spindles []models.Spindle + Tab string } func (p *Pages) Spindles(w io.Writer, params SpindlesParams) error { @@ -674,10 +686,10 @@ type SpindleDashboardParams struct { BaseParams - Spindle models.Spindle - Members []string - Repos map[string][]models.Repo - Tab string + Spindle models.Spindle + Members []string + Repos map[string][]models.Repo + Tab string } func (p *Pages) SpindleDashboard(w io.Writer, params SpindleDashboardParams) error { @@ -686,7 +698,7 @@ type NewRepoParams struct { BaseParams - Knots []string + Knots []string } func (p *Pages) NewRepo(w io.Writer, params NewRepoParams) error { @@ -695,8 +707,8 @@ type ForkRepoParams struct { BaseParams - Knots []string - RepoInfo repoinfo.RepoInfo + Knots []string + RepoInfo repoinfo.RepoInfo } func (p *Pages) ForkRepo(w io.Writer, params ForkRepoParams) error { @@ -767,11 +779,11 @@ type ProfileStarredParams struct { BaseParams - Repos []models.Repo - Card *ProfileCard - Page pagination.Page - Total int - Active string + Repos []models.Repo + Card *ProfileCard + Page pagination.Page + Total int + Active string } func (p *Pages) ProfileStarred(w io.Writer, params ProfileStarredParams) error { @@ -781,9 +793,9 @@ type ProfileStringsParams struct { BaseParams - Strings []models.String - Card *ProfileCard - Active string + Strings []models.String + Card *ProfileCard + Active string } func (p *Pages) ProfileStrings(w io.Writer, params ProfileStringsParams) error { @@ -809,7 +821,7 @@ } type FollowCard struct { - UserDid string + UserDid string BaseParams FollowStatus models.FollowStatus FollowersCount int64 @@ -819,9 +831,9 @@ type ProfileFollowersParams struct { BaseParams - Followers []FollowCard - Card *ProfileCard - Active string + Followers []FollowCard + Card *ProfileCard + Active string } func (p *Pages) ProfileFollowers(w io.Writer, params ProfileFollowersParams) error { @@ -831,9 +843,9 @@ type ProfileFollowingParams struct { BaseParams - Following []FollowCard - Card *ProfileCard - Active string + Following []FollowCard + Card *ProfileCard + Active string } func (p *Pages) ProfileFollowing(w io.Writer, params ProfileFollowingParams) error { @@ -871,8 +883,8 @@ type EditBioParams struct { BaseParams - Profile *models.Profile - AlsoKnownAs []string + Profile *models.Profile + AlsoKnownAs []string } func (p *Pages) EditBioFragment(w io.Writer, params EditBioParams) error { @@ -881,8 +893,8 @@ type EditPinsParams struct { BaseParams - Profile *models.Profile - AllRepos []PinnedRepo + Profile *models.Profile + AllRepos []PinnedRepo } type PinnedRepo struct { @@ -980,11 +992,11 @@ type RepoCommitParams struct { BaseParams - RepoInfo repoinfo.RepoInfo - Active string - EmailToDid map[string]string - Pipeline *models.Pipeline - DiffOpts types.DiffOpts + RepoInfo repoinfo.RepoInfo + Active string + EmailToDid map[string]string + Pipeline *models.Pipeline + DiffOpts types.DiffOpts // singular because it's always going to be just one VerifiedCommit commitverify.VerifiedCommits @@ -1061,8 +1073,8 @@ type RepoBranchesParams struct { BaseParams - RepoInfo repoinfo.RepoInfo - Active string + RepoInfo repoinfo.RepoInfo + Active string types.RepoBranchesResponse } @@ -1073,8 +1085,8 @@ type RepoTagsParams struct { BaseParams - RepoInfo repoinfo.RepoInfo - Active string + RepoInfo repoinfo.RepoInfo + Active string types.RepoTagsResponse ArtifactMap map[plumbing.Hash][]models.Artifact DanglingArtifacts []models.Artifact @@ -1087,8 +1099,8 @@ type RepoTagParams struct { BaseParams - RepoInfo repoinfo.RepoInfo - Active string + RepoInfo repoinfo.RepoInfo + Active string types.RepoTagResponse ArtifactMap map[plumbing.Hash][]models.Artifact DanglingArtifacts []models.Artifact @@ -1101,8 +1113,8 @@ type RepoArtifactParams struct { BaseParams - RepoInfo repoinfo.RepoInfo - Artifact models.Artifact + RepoInfo repoinfo.RepoInfo + Artifact models.Artifact } func (p *Pages) RepoArtifactFragment(w io.Writer, params RepoArtifactParams) error { @@ -1217,9 +1229,9 @@ type WebhookDeliveriesListParams struct { BaseParams - RepoInfo repoinfo.RepoInfo - Webhook *models.Webhook - Deliveries []models.WebhookDelivery + RepoInfo repoinfo.RepoInfo + Webhook *models.Webhook + Deliveries []models.WebhookDelivery } func (p *Pages) WebhookDeliveriesList(w io.Writer, params WebhookDeliveriesListParams) error { @@ -1269,12 +1281,12 @@ type RepoSingleIssueParams struct { BaseParams - RepoInfo repoinfo.RepoInfo - Active string - Issue *models.Issue - CommentList []models.CommentListItem - Backlinks []models.RichReferenceLink - LabelDefs map[string]*models.LabelDefinition + RepoInfo repoinfo.RepoInfo + Active string + Issue *models.Issue + CommentList []models.CommentListItem + Backlinks []models.RichReferenceLink + LabelDefs map[string]*models.LabelDefinition Reactions map[syntax.ATURI]map[models.ReactionKind]models.ReactionDisplayData UserReacted map[syntax.ATURI]map[models.ReactionKind]bool @@ -1288,9 +1300,9 @@ type EditIssueParams struct { BaseParams - RepoInfo repoinfo.RepoInfo - Issue *models.Issue - Action string + RepoInfo repoinfo.RepoInfo + Issue *models.Issue + Action string } func (p *Pages) EditIssueFragment(w io.Writer, params EditIssueParams) error { @@ -1313,10 +1325,10 @@ type RepoNewIssueParams struct { BaseParams - RepoInfo repoinfo.RepoInfo - Issue *models.Issue // existing issue if any -- passed when editing - Active string - Action string + RepoInfo repoinfo.RepoInfo + Issue *models.Issue // existing issue if any -- passed when editing + Active string + Action string } func (p *Pages) RepoNewIssue(w io.Writer, params RepoNewIssueParams) error { @@ -1468,9 +1480,9 @@ type PullNewCommentParams struct { BaseParams - RepoInfo repoinfo.RepoInfo - Pull *models.Pull - RoundNumber int + RepoInfo repoinfo.RepoInfo + Pull *models.Pull + RoundNumber int } func (p *Pages) PullNewCommentFragment(w io.Writer, params PullNewCommentParams) error { @@ -1479,14 +1491,14 @@ type RepoCompareParams struct { BaseParams - RepoInfo repoinfo.RepoInfo - Forks []models.Repo - Branches []types.Branch - Tags []*types.TagReference - Base string - Head string - Diff *types.NiceDiff - DiffOpts types.DiffOpts + RepoInfo repoinfo.RepoInfo + Forks []models.Repo + Branches []types.Branch + Tags []*types.TagReference + Base string + Head string + Diff *types.NiceDiff + DiffOpts types.DiffOpts Active string } @@ -1498,12 +1510,12 @@ type RepoCompareNewParams struct { BaseParams - RepoInfo repoinfo.RepoInfo - Forks []models.Repo - Branches []types.Branch - Tags []*types.TagReference - Base string - Head string + RepoInfo repoinfo.RepoInfo + Forks []models.Repo + Branches []types.Branch + Tags []*types.TagReference + Base string + Head string Active string } @@ -1515,9 +1527,9 @@ type RepoCompareAllowPullParams struct { BaseParams - RepoInfo repoinfo.RepoInfo - Base string - Head string + RepoInfo repoinfo.RepoInfo + Base string + Head string } func (p *Pages) RepoCompareAllowPullFragment(w io.Writer, params RepoCompareAllowPullParams) error { @@ -1535,10 +1547,10 @@ type LabelPanelParams struct { BaseParams - RepoInfo repoinfo.RepoInfo - Defs map[string]*models.LabelDefinition - Subject string - State models.LabelState + RepoInfo repoinfo.RepoInfo + Defs map[string]*models.LabelDefinition + Subject string + State models.LabelState } func (p *Pages) LabelPanel(w io.Writer, params LabelPanelParams) error { @@ -1547,11 +1559,11 @@ type EditLabelPanelParams struct { BaseParams - RepoInfo repoinfo.RepoInfo - Defs map[string]*models.LabelDefinition - Subject string - State models.LabelState - Prefix string + RepoInfo repoinfo.RepoInfo + Defs map[string]*models.LabelDefinition + Subject string + State models.LabelState + Prefix string } func (p *Pages) EditLabelPanel(w io.Writer, params EditLabelPanelParams) error { @@ -1560,11 +1572,11 @@ type RepoStarsParams struct { BaseParams - RepoInfo repoinfo.RepoInfo - Active string - Starrers []models.Star - Page pagination.Page - TotalCount int + RepoInfo repoinfo.RepoInfo + Active string + Starrers []models.Star + Page pagination.Page + TotalCount int } func (p *Pages) RepoStars(w io.Writer, params RepoStarsParams) error { @@ -1574,11 +1586,11 @@ type RepoForksParams struct { BaseParams - RepoInfo repoinfo.RepoInfo - Active string - Forks []models.Repo - Page pagination.Page - TotalCount int + RepoInfo repoinfo.RepoInfo + Active string + Forks []models.Repo + Page pagination.Page + TotalCount int } func (p *Pages) RepoForks(w io.Writer, params RepoForksParams) error { @@ -1588,11 +1600,11 @@ type PipelinesParams struct { BaseParams - RepoInfo repoinfo.RepoInfo - Pipelines []models.Pipeline - Active string - FilterKind string - Total int64 + RepoInfo repoinfo.RepoInfo + Pipelines []models.Pipeline + Active string + FilterKind string + Total int64 } func (p *Pages) Pipelines(w io.Writer, params PipelinesParams) error { @@ -1642,11 +1654,11 @@ type WorkflowParams struct { BaseParams - RepoInfo repoinfo.RepoInfo - Pipeline models.Pipeline - Workflow string - LogUrl string - Active string + RepoInfo repoinfo.RepoInfo + Pipeline models.Pipeline + Workflow string + LogUrl string + Active string } func (p *Pages) Workflow(w io.Writer, params WorkflowParams) error { @@ -1656,7 +1668,7 @@ type PutStringParams struct { BaseParams - Action string + Action string // this is supplied in the case of editing an existing string String models.String @@ -1668,8 +1680,8 @@ type StringsDashboardParams struct { BaseParams - Card ProfileCard - Strings []models.String + Card ProfileCard + Strings []models.String } func (p *Pages) StringsDashboard(w io.Writer, params StringsDashboardParams) error { @@ -1678,7 +1690,7 @@ type StringTimelineParams struct { BaseParams - Strings []models.String + Strings []models.String } func (p *Pages) StringsTimeline(w io.Writer, params StringTimelineParams) error { @@ -1708,13 +1720,13 @@ type SearchReposParams struct { BaseParams - Repos []models.Repo - Page pagination.Page - ResultCount int - FilterQuery string - SortParam string - TimeTaken time.Duration - DocCount int64 + Repos []models.Repo + Page pagination.Page + ResultCount int + FilterQuery string + SortParam string + TimeTaken time.Duration + DocCount int64 } func (p *Pages) SearchRepos(w io.Writer, params SearchReposParams) error { diff --git a/appview/pipelines/pipelines.go b/appview/pipelines/pipelines.go --- a/appview/pipelines/pipelines.go +++ b/appview/pipelines/pipelines.go @@ -120,10 +120,10 @@ p.pages.Pipelines(w, pages.PipelinesParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - RepoInfo: p.repoResolver.GetRepoInfo(r, user), - Pipelines: ps, - FilterKind: filterKind, - Total: total, + RepoInfo: p.repoResolver.GetRepoInfo(r, user), + Pipelines: ps, + FilterKind: filterKind, + Total: total, }) } @@ -169,9 +169,9 @@ p.pages.Workflow(w, pages.WorkflowParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - RepoInfo: p.repoResolver.GetRepoInfo(r, user), - Pipeline: singlePipeline, - Workflow: workflow, + RepoInfo: p.repoResolver.GetRepoInfo(r, user), + Pipeline: singlePipeline, + Workflow: workflow, }) } diff --git a/appview/pulls/comment.go b/appview/pulls/comment.go --- a/appview/pulls/comment.go +++ b/appview/pulls/comment.go @@ -37,10 +37,10 @@ switch r.Method { case http.MethodGet: s.pages.PullNewCommentFragment(w, pages.PullNewCommentParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), - RepoInfo: s.repoResolver.GetRepoInfo(r, user), - Pull: pull, - RoundNumber: roundNumber, + BaseParams: pages.BaseParamsFromContext(r.Context()), + RepoInfo: s.repoResolver.GetRepoInfo(r, user), + Pull: pull, + RoundNumber: roundNumber, }) return } diff --git a/appview/pulls/compose.go b/appview/pulls/compose.go --- a/appview/pulls/compose.go +++ b/appview/pulls/compose.go @@ -306,7 +306,7 @@ } return pages.RepoNewPullParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), RepoInfo: repoInfo, Branches: branches, SourceBranches: sourceBranchList, diff --git a/appview/pulls/list.go b/appview/pulls/list.go --- a/appview/pulls/list.go +++ b/appview/pulls/list.go @@ -310,7 +310,7 @@ } err = s.pages.RepoPulls(w, pages.RepoPullsParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), RepoInfo: repoInfo, Pulls: pulls, LabelDefs: defs, diff --git a/appview/pulls/single.go b/appview/pulls/single.go --- a/appview/pulls/single.go +++ b/appview/pulls/single.go @@ -66,7 +66,7 @@ } s.pages.PullActionsFragment(w, pages.PullActionsParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), RepoInfo: s.repoResolver.GetRepoInfo(r, user), Pull: pull, RoundNumber: roundNumber, @@ -251,7 +251,7 @@ } err = s.pages.RepoSinglePull(w, pages.RepoSinglePullParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), RepoInfo: s.repoResolver.GetRepoInfo(r, user), Pull: pull, Stack: stack, diff --git a/appview/repo/artifact.go b/appview/repo/artifact.go --- a/appview/repo/artifact.go +++ b/appview/repo/artifact.go @@ -128,8 +128,8 @@ rp.pages.RepoArtifactFragment(w, pages.RepoArtifactParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - RepoInfo: rp.repoResolver.GetRepoInfo(r, user), - Artifact: artifact, + RepoInfo: rp.repoResolver.GetRepoInfo(r, user), + Artifact: artifact, }) } diff --git a/appview/repo/branches.go b/appview/repo/branches.go --- a/appview/repo/branches.go +++ b/appview/repo/branches.go @@ -38,7 +38,7 @@ sortBranches(result.Branches) user := rp.oauth.GetMultiAccountUser(r) rp.pages.RepoBranches(w, pages.RepoBranchesParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), RepoInfo: rp.repoResolver.GetRepoInfo(r, user), RepoBranchesResponse: result, }) diff --git a/appview/repo/compare.go b/appview/repo/compare.go --- a/appview/repo/compare.go +++ b/appview/repo/compare.go @@ -85,11 +85,11 @@ rp.pages.RepoCompareNew(w, pages.RepoCompareNewParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - RepoInfo: rp.repoResolver.GetRepoInfo(r, user), - Branches: branches, - Tags: tags.Tags, - Base: base, - Head: head, + RepoInfo: rp.repoResolver.GetRepoInfo(r, user), + Branches: branches, + Tags: tags.Tags, + Base: base, + Head: head, }) } @@ -202,13 +202,13 @@ rp.pages.RepoCompare(w, pages.RepoCompareParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - RepoInfo: rp.repoResolver.GetRepoInfo(r, user), - Branches: branches.Branches, - Tags: tags.Tags, - Base: base, - Head: head, - Diff: &diff, - DiffOpts: diffOpts, + RepoInfo: rp.repoResolver.GetRepoInfo(r, user), + Branches: branches.Branches, + Tags: tags.Tags, + Base: base, + Head: head, + Diff: &diff, + DiffOpts: diffOpts, }) } diff --git a/appview/repo/index.go b/appview/repo/index.go --- a/appview/repo/index.go +++ b/appview/repo/index.go @@ -58,7 +58,7 @@ if err != nil { l.Error("failed to build index response", "err", err) rp.pages.RepoIndexPage(w, pages.RepoIndexParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), KnotUnreachable: true, RepoInfo: rp.repoResolver.GetRepoInfo(r, user), }) @@ -171,7 +171,7 @@ } rp.pages.RepoIndexPage(w, pages.RepoIndexParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), RepoInfo: rp.repoResolver.GetRepoInfo(r, user), TagMap: tagMap, RepoIndexResponse: *result, diff --git a/appview/repo/log.go b/appview/repo/log.go --- a/appview/repo/log.go +++ b/appview/repo/log.go @@ -185,7 +185,7 @@ } rp.pages.RepoLog(w, pages.RepoLogParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), TagMap: tagMap, RepoInfo: rp.repoResolver.GetRepoInfo(r, user), RepoLogResponse: xrpcResp, @@ -261,7 +261,7 @@ } rp.pages.RepoCommit(w, pages.RepoCommitParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), RepoInfo: rp.repoResolver.GetRepoInfo(r, user), RepoCommitResponse: result, EmailToDid: emailToDidMap, diff --git a/appview/repo/repo.go b/appview/repo/repo.go --- a/appview/repo/repo.go +++ b/appview/repo/repo.go @@ -665,10 +665,10 @@ user := rp.oauth.GetMultiAccountUser(r) rp.pages.LabelPanel(w, pages.LabelPanelParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - RepoInfo: rp.repoResolver.GetRepoInfo(r, user), - Defs: defs, - Subject: subject.String(), - State: state, + RepoInfo: rp.repoResolver.GetRepoInfo(r, user), + Defs: defs, + Subject: subject.String(), + State: state, }) } @@ -713,10 +713,10 @@ user := rp.oauth.GetMultiAccountUser(r) rp.pages.EditLabelPanel(w, pages.EditLabelPanelParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - RepoInfo: rp.repoResolver.GetRepoInfo(r, user), - Defs: defs, - Subject: subject.String(), - State: state, + RepoInfo: rp.repoResolver.GetRepoInfo(r, user), + Defs: defs, + Subject: subject.String(), + State: state, }) } @@ -1426,8 +1426,8 @@ rp.pages.ForkRepo(w, pages.ForkRepoParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - Knots: knots, - RepoInfo: rp.repoResolver.GetRepoInfo(r, user), + Knots: knots, + RepoInfo: rp.repoResolver.GetRepoInfo(r, user), }) case http.MethodPost: @@ -1698,10 +1698,10 @@ rp.pages.RepoStars(w, pages.RepoStarsParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - RepoInfo: rp.repoResolver.GetRepoInfo(r, user), - Starrers: starrers, - Page: page, - TotalCount: totalCount, + RepoInfo: rp.repoResolver.GetRepoInfo(r, user), + Starrers: starrers, + Page: page, + TotalCount: totalCount, }) } @@ -1734,10 +1734,10 @@ err = rp.pages.RepoForks(w, pages.RepoForksParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - RepoInfo: rp.repoResolver.GetRepoInfo(r, user), - Forks: forks, - Page: page, - TotalCount: totalCount, + RepoInfo: rp.repoResolver.GetRepoInfo(r, user), + Forks: forks, + Page: page, + TotalCount: totalCount, }) if err != nil { l.Error("failed to render page", "err", err) diff --git a/appview/repo/settings.go b/appview/repo/settings.go --- a/appview/repo/settings.go +++ b/appview/repo/settings.go @@ -241,7 +241,7 @@ } rp.pages.RepoSiteSettings(w, pages.RepoSiteSettingsParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), RepoInfo: rp.repoResolver.GetRepoInfo(r, user), Branches: result.Branches, SiteConfig: siteConfig, @@ -436,7 +436,7 @@ } rp.pages.RepoGeneralSettings(w, pages.RepoGeneralSettingsParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), RepoInfo: rp.repoResolver.GetRepoInfo(r, user), Branches: result.Branches, Labels: labels, @@ -459,7 +459,7 @@ collaborators := rp.acl.Collaborators(r.Context(), f) rp.pages.RepoAccessSettings(w, pages.RepoAccessSettingsParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), RepoInfo: rp.repoResolver.GetRepoInfo(r, user), Collaborators: collaborators, CanRemoveCollaborator: knotcompat.KnotHasCapability(r.Context(), f.Knot, rp.config.Core.Dev, consts.CapKnotACL), @@ -519,7 +519,7 @@ } rp.pages.RepoPipelineSettings(w, pages.RepoPipelineSettingsParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), RepoInfo: rp.repoResolver.GetRepoInfo(r, user), Spindles: spindles, CurrentSpindle: f.Spindle, diff --git a/appview/repo/tags.go b/appview/repo/tags.go --- a/appview/repo/tags.go +++ b/appview/repo/tags.go @@ -67,7 +67,7 @@ user := rp.oauth.GetMultiAccountUser(r) rp.pages.RepoTags(w, pages.RepoTagsParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), RepoInfo: rp.repoResolver.GetRepoInfo(r, user), RepoTagsResponse: result, ArtifactMap: artifactMap, @@ -142,7 +142,7 @@ user := rp.oauth.GetMultiAccountUser(r) rp.pages.RepoTag(w, pages.RepoTagParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), RepoInfo: rp.repoResolver.GetRepoInfo(r, user), RepoTagResponse: result, ArtifactMap: artifactMap, diff --git a/appview/repo/webhooks.go b/appview/repo/webhooks.go --- a/appview/repo/webhooks.go +++ b/appview/repo/webhooks.go @@ -45,7 +45,7 @@ } rp.pages.RepoWebhooksSettings(w, pages.RepoWebhooksSettingsParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), RepoInfo: rp.repoResolver.GetRepoInfo(r, user), Webhooks: webhooks, WebhookDeliveries: deliveriesMap, @@ -366,8 +366,8 @@ rp.pages.WebhookDeliveriesList(w, pages.WebhookDeliveriesListParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - RepoInfo: rp.repoResolver.GetRepoInfo(r, user), - Webhook: webhook, - Deliveries: deliveries, + RepoInfo: rp.repoResolver.GetRepoInfo(r, user), + Webhook: webhook, + Deliveries: deliveries, }) } diff --git a/appview/settings/settings.go b/appview/settings/settings.go --- a/appview/settings/settings.go +++ b/appview/settings/settings.go @@ -125,7 +125,7 @@ isTnglHandle, _ := s.isTnglHandle(r.Context(), syntax.DID(user.Did)) s.Pages.UserSiteSettings(w, pages.UserSiteSettingsParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), Claim: claim, SitesDomain: s.Config.Sites.Domain, IsTnglHandle: isTnglHandle, @@ -270,7 +270,7 @@ isDeactivated := s.isAccountDeactivated(r.Context(), syntax.DID(user.Did)) s.Pages.UserProfileSettings(w, pages.UserProfileSettingsParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), PunchcardPreference: punchcardPreferences, IsTnglSh: isTnglSh, IsDeactivated: isDeactivated, @@ -289,8 +289,8 @@ } s.Pages.UserNotificationSettings(w, pages.UserNotificationSettingsParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), - Preferences: prefs, + BaseParams: pages.BaseParamsFromContext(r.Context()), + Preferences: prefs, }) } @@ -330,7 +330,7 @@ s.Pages.UserKeysSettings(w, pages.UserKeysSettingsParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - PubKeys: pubKeys, + PubKeys: pubKeys, }) } @@ -343,7 +343,7 @@ s.Pages.UserEmailsSettings(w, pages.UserEmailsSettingsParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - Emails: emails, + Emails: emails, }) } diff --git a/appview/spindles/spindles.go b/appview/spindles/spindles.go --- a/appview/spindles/spindles.go +++ b/appview/spindles/spindles.go @@ -70,8 +70,8 @@ s.Pages.Spindles(w, pages.SpindlesParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - Spindles: all, - Tab: "spindles", + Spindles: all, + Tab: "spindles", }) } @@ -127,10 +127,10 @@ s.Pages.SpindleDashboard(w, pages.SpindleDashboardParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - Spindle: spindle, - Members: members, - Repos: repoMap, - Tab: "spindles", + Spindle: spindle, + Members: members, + Repos: repoMap, + Tab: "spindles", }) } diff --git a/appview/state/gfi.go b/appview/state/gfi.go --- a/appview/state/gfi.go +++ b/appview/state/gfi.go @@ -36,10 +36,10 @@ if len(repoLabels) == 0 { s.pages.GoodFirstIssues(w, pages.GoodFirstIssuesParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - RepoGroups: []*models.RepoGroup{}, - LabelDefs: make(map[string]*models.LabelDefinition), - Page: page, - GfiLabel: gfiLabelDef, + RepoGroups: []*models.RepoGroup{}, + LabelDefs: make(map[string]*models.LabelDefinition), + Page: page, + GfiLabel: gfiLabelDef, }) return } @@ -145,9 +145,9 @@ s.pages.GoodFirstIssues(w, pages.GoodFirstIssuesParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - RepoGroups: paginatedGroups, - LabelDefs: labelDefsMap, - Page: page, - GfiLabel: gfiLabelDef, + RepoGroups: paginatedGroups, + LabelDefs: labelDefsMap, + Page: page, + GfiLabel: gfiLabelDef, }) } diff --git a/appview/state/profile.go b/appview/state/profile.go --- a/appview/state/profile.go +++ b/appview/state/profile.go @@ -187,7 +187,7 @@ } err = s.pages.ProfileOverview(w, pages.ProfileOverviewParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), Card: profile, Repos: pinnedRepos, CollaboratingRepos: pinnedCollaboratingRepos, @@ -336,7 +336,7 @@ } err = s.pages.ProfileRepos(w, pages.ProfileReposParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), Repos: repos, StarStatuses: starStatuses, Card: profile, @@ -376,10 +376,10 @@ err = s.pages.ProfileStarred(w, pages.ProfileStarredParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - Repos: repos, - Total: int(profile.Stats.StarredCount), - Card: profile, - Page: page, + Repos: repos, + Total: int(profile.Stats.StarredCount), + Card: profile, + Page: page, }) if err != nil { l.Error("failed to render", "err", err) @@ -406,8 +406,8 @@ err = s.pages.ProfileStrings(w, pages.ProfileStringsParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - Strings: strings, - Card: profile, + Strings: strings, + Card: profile, }) } @@ -502,7 +502,7 @@ } err = s.pages.ProfileVouches(w, pages.ProfileVouchesParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), Vouches: vouches, Suggestions: suggestions, Card: profile, @@ -596,7 +596,7 @@ profile.Did = did } followCards[i] = pages.FollowCard{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), UserDid: did, FollowStatus: followStatus, FollowersCount: followStats.Followers, @@ -619,8 +619,8 @@ s.pages.ProfileFollowers(w, pages.ProfileFollowersParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - Followers: followPage.Follows, - Card: followPage.Card, + Followers: followPage.Follows, + Card: followPage.Card, }) } @@ -633,8 +633,8 @@ s.pages.ProfileFollowing(w, pages.ProfileFollowingParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - Following: followPage.Follows, - Card: followPage.Card, + Following: followPage.Follows, + Card: followPage.Card, }) } @@ -1008,7 +1008,7 @@ } s.pages.ProfilePopoverFragment(w, pages.ProfilePopoverParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), UserDid: did, Profile: profile, FollowStatus: followStatus, @@ -1039,9 +1039,9 @@ } s.pages.EditBioFragment(w, pages.EditBioParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), - Profile: profile, - AlsoKnownAs: alsoKnownAs, + BaseParams: pages.BaseParamsFromContext(r.Context()), + Profile: profile, + AlsoKnownAs: alsoKnownAs, }) } @@ -1084,8 +1084,8 @@ s.pages.EditPinsFragment(w, pages.EditPinsParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - Profile: profile, - AllRepos: allRepos, + Profile: profile, + AllRepos: allRepos, }) } diff --git a/appview/state/search.go b/appview/state/search.go --- a/appview/state/search.go +++ b/appview/state/search.go @@ -142,14 +142,14 @@ } err = s.pages.SearchRepos(w, pages.SearchReposParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), - Repos: repos, - Page: page, - FilterQuery: query.String(), - SortParam: sortParam, - TimeTaken: searchDuration, - ResultCount: resultCount, - DocCount: docCount, + BaseParams: pages.BaseParamsFromContext(r.Context()), + Repos: repos, + Page: page, + FilterQuery: query.String(), + SortParam: sortParam, + TimeTaken: searchDuration, + ResultCount: resultCount, + DocCount: docCount, }) if err != nil { l.Error("failed to render page", "err", err) diff --git a/appview/state/state.go b/appview/state/state.go --- a/appview/state/state.go +++ b/appview/state/state.go @@ -456,7 +456,7 @@ s.pages.NewRepo(w, pages.NewRepoParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - Knots: knots, + Knots: knots, }) case http.MethodPost: diff --git a/appview/strings/strings.go b/appview/strings/strings.go --- a/appview/strings/strings.go +++ b/appview/strings/strings.go @@ -80,7 +80,7 @@ s.Pages.StringsTimeline(w, pages.StringTimelineParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - Strings: strings, + Strings: strings, }) } @@ -192,7 +192,7 @@ } err = s.Pages.SingleString(w, pages.SingleStringParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), RenderToggle: renderToggle, ShowRendered: showRendered, String: &string, @@ -264,8 +264,8 @@ // return the form with prefilled fields s.Pages.PutString(w, pages.PutStringParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - Action: "edit", - String: first, + Action: "edit", + String: first, }) case http.MethodPost: fail := func(msg string, err error) { @@ -349,7 +349,7 @@ case http.MethodGet: s.Pages.PutString(w, pages.PutStringParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), - Action: "new", + Action: "new", }) case http.MethodPost: fail := func(msg string, err error) { diff --git a/appview/timeline/home.go b/appview/timeline/home.go --- a/appview/timeline/home.go +++ b/appview/timeline/home.go @@ -26,7 +26,7 @@ } t.pages.Home(w, pages.TimelineParams{ - BaseParams: pages.BaseParamsFromContext(r.Context()), + BaseParams: pages.BaseParamsFromContext(r.Context()), Timeline: timeline, BlueskyPosts: blueskyPosts, RecentBlogPosts: t.recentPosts, diff --git a/appview/pages/templates/layouts/base.html b/appview/pages/templates/layouts/base.html --- a/appview/pages/templates/layouts/base.html +++ b/appview/pages/templates/layouts/base.html @@ -105,6 +105,8 @@ {{ template "layouts/fragments/footer" . }} {{ end }} + + {{ template "focus/pill" .FocusParams }} {{ end }} diff --git a/appview/pages/templates/notifications/list.html b/appview/pages/templates/notifications/list.html --- a/appview/pages/templates/notifications/list.html +++ b/appview/pages/templates/notifications/list.html @@ -10,27 +10,11 @@ (dict "Key" "unread" "Value" "Unread" "Icon" "glasses") }} - {{/* Mobile controls: single row */}} -
-
- {{ template "fragments/tabSelector" (dict "Name" "read" "Values" $readVals "Active" .ReadFilter) }} - -
- - {{ i "cog" "size-5" }} - -
- {{/* Desktop controls: single row */}} -