From b894cba2d16bfda07025e5f7ae1413cc5c522cf4 Mon Sep 17 00:00:00 2001 From: Seongmin Lee Date: Mon, 15 Jun 2026 09:35:32 +0900 Subject: [PATCH] appview/pages/templates: restyle Signed-off-by: Seongmin Lee --- appview/accountmigration/accountmigration.go | 26 +++- appview/pages/pages.go | 1 + .../account/migrate/fragments/repoList.html | 123 ++++++++++-------- .../templates/account/migrate/fromGitHub.html | 108 +++++++++++---- input.css | 10 ++ 5 files changed, 191 insertions(+), 77 deletions(-) diff --git a/appview/accountmigration/accountmigration.go b/appview/accountmigration/accountmigration.go index d18d4260..71b2edc1 100644 --- a/appview/accountmigration/accountmigration.go +++ b/appview/accountmigration/accountmigration.go @@ -67,10 +67,32 @@ func (s *AccountMigration) migratePage(w http.ResponseWriter, r *http.Request) { s.logger.Error("knots lookup failed", "did", user.Did, "err", err) knots = nil } - s.pages.AccountMigrateFromGitHub(w, pages.AccountMigrateFromGitHubParams{ + if err := s.pages.AccountMigrateFromGitHub(w, pages.AccountMigrateFromGitHubParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), Knots: knots, - }) + Repos: []pages.RepoImportParams{ + { + SourceKind: pages.RepoImportSourceGitHub, + CloneUrl: "https://github.com/boltlessengineer/rest.nvim", + Name: "rest.nvim", + Description: "A very fast, powerful, extensible and asynchronous Neovim HTTP client written in Lua.", + Website: "https://tangled.org", + Topics: []string{"lua", "neovim", "curl", "http-client", "nvim", "neovim-plugin", "rest-client"}, + Selected: true, + }, + { + SourceKind: pages.RepoImportSourceGitHub, + CloneUrl: "https://github.com/boltlessengineer/dot", + Name: "super-long-repo-name-fddasfsafdsfasdfaasdfasdfasfasdfasfdasdfasdfsadfsadfasdfaasdfasfasdfdsafd00000s", + Description: "dotfiles", + Website: "https://tangled.org", + Topics: []string{}, + Selected: true, + }, + }, + }); err != nil { + s.logger.Error("failed to render", "err", err) + } default: s.pages.AccountMigrate(w, pages.AccountMigrateParams{ BaseParams: pages.BaseParamsFromContext(r.Context()), diff --git a/appview/pages/pages.go b/appview/pages/pages.go index 1bf555b4..1bf235d0 100644 --- a/appview/pages/pages.go +++ b/appview/pages/pages.go @@ -2058,6 +2058,7 @@ func (p *Pages) AccountMigrate(w io.Writer, params AccountMigrateParams) error { type AccountMigrateFromGitHubParams struct { BaseParams Knots []string + Repos []RepoImportParams } type RepoImportSource string diff --git a/appview/pages/templates/account/migrate/fragments/repoList.html b/appview/pages/templates/account/migrate/fragments/repoList.html index 8d1e1ed6..ec8d0987 100644 --- a/appview/pages/templates/account/migrate/fragments/repoList.html +++ b/appview/pages/templates/account/migrate/fragments/repoList.html @@ -1,67 +1,86 @@ {{ define "account/migrate/fragments/repoList" }} {{ if not .Repos }} -

No importable repositories found.

+

No importable repositories found.

{{ else }}
-
- - -
+
+ {{ range $i, $repo := .Repos }} +
+ +
+ +
- {{ range $i, $repo := .Repos }} -
- -
- -
-
{{ $repo.Name }}
-
{{ $repo.CloneUrl }}
+
+ +
+ {{ i "chevron-right" "size-4 group-open:hidden" }} + {{ i "chevron-down" "size-4 hidden group-open:block" }} +
-
- - -
+
+
+ + -
- - - + - + - -
-
- {{ end }} + -
- +
+ Select a knot to migrate into +
+ {{ range $.Knots }} + + {{ else }} +

No knots available.

+ {{ end }} +
+
+
+ + {{ end }} +
+ +
+
{{ end }} diff --git a/appview/pages/templates/account/migrate/fromGitHub.html b/appview/pages/templates/account/migrate/fromGitHub.html index 0eebb48f..93815b17 100644 --- a/appview/pages/templates/account/migrate/fromGitHub.html +++ b/appview/pages/templates/account/migrate/fromGitHub.html @@ -1,28 +1,21 @@ -{{ define "title" }}Migrate from GitHub{{ end }} +{{ define "title" }}Migrate repositories from GitHub{{ end }} {{ define "content" }} -
-

Migrate from GitHub

-

- Enter a GitHub username to list their public repositories. -

+
+

+ {{ i "import" "size-5 inline m-0.5" }} + Migrate repositories +

-
-
- - -
+
+
+ {{ i "badge-info" "size-6" }} +
+

Migration covers your repos and commit history.
Issues and PRs aren't part of the import yet.

+
+
+ {{ template "step-1" . }} + {{ template "step-2" . }} @@ -32,6 +25,75 @@

{{ end }} -
+
+{{ end }} + +{{ define "step-1" }} +
+
+ {{ template "numberCircle" 1 }} +
+ + +
+ +

Connect Your Account

+
+ + +
+
+
+{{ end }} + +{{ define "step-2" }} +
+
+ {{ template "numberCircle" 2 }} +
+ + +
+
+

Choose & Configure Repositories

+
+ +
+
+
+ + + {{ template "account/migrate/fragments/repoList" . }} +
+
+
+{{ end }} + +{{ define "numberCircle" }} +
+ {{.}}
{{ end }} diff --git a/input.css b/input.css index c0ebd482..aea6883c 100644 --- a/input.css +++ b/input.css @@ -109,6 +109,16 @@ focus:outline-none focus:ring-1 focus:ring-gray-400 dark:focus:ring-gray-500; } + input:disabled, + input:readonly, + textarea:disabled, + textarea:readonly { + @apply bg-gray-100 dark:bg-gray-900 + text-gray-500 dark:text-gray-500 + border-gray-200 dark:border-gray-700 + cursor-not-allowed; + } + input[type="checkbox"] { @apply appearance-none size-4 p-0 rounded bg-transparent border border-gray-200 -- 2.51.2