Skip to content

feat: implement client prototype functions from #649 in the reworked layout - #656

Draft
tylerpotts wants to merge 73 commits into
ux-rework-devfrom
feat/649-client-functions
Draft

tylerpotts wants to merge 73 commits into
ux-rework-devfrom
feat/649-client-functions

Conversation

@tylerpotts

Copy link
Copy Markdown
Collaborator

Implements the functions listed in #649 (grouped by owner directory in #649 (comment)), with the UI from the client prototype (https://nebi-client-prototype.vercel.app/), using the layout from #587. Part of the UX rework epic #554.

What's in here

  • Layout: new internal/artifact (pixi.toml/pixi.lock parsing, form round-trip, diff, archive), internal/client/{sdk/{local,exec,remote,registry},jobs,api,desktop}, and internal/server/{core,api}. Existing code was moved or wrapped only where a function touched it; shims remain in old packages. internal/server/* does not import internal/client/*, and the SDK does not import client/jobs.
  • Version model: every change is a new version, one version installed at a time (InstalledVersion / LastInstalledVersion), base version tracking, tags with auto-moving latest, new job types (create, create_version, install_version, uninstall, pull, pull_install, pull_registry, delete). Legacy edit-in-place job types remain for the legacy API and old rows.
  • Client UI (frontend/apps/client): projects list, create project (form and pixi.toml editor), project detail with version rail, new version, compare versions, server page (connect, pull, pull and install), share dialog, publish dialog, registries page, jobs list and detail, notifications bell, guided tour and help menu.
  • Server UI (frontend/apps/server): server-only projects list, manage access, delete from server.
  • CLI parity: commands in cmd/nebi-cli that call the SDK directly (nebi project ..., nebi project version new, nebi server connect|projects|pull|push|pull-version, nebi jobs ..., registry/publish/import aligned with the SDK).

Decisions on the gaps from #649

  1. Native folder picker: internal/client/desktop.FolderPicker capability implemented by the Wails app; nebi-web reports it unavailable and the UI hides the button.
  2. Publication metadata on the server: new VersionPublication records (no credentials), sent with pushed versions.
  3. Version tags on the server: server tags are authoritative after push; pull mirrors them locally.
  4. Notifications: local jobs only for now.
  5. Job types follow the version model. Push and publish are synchronous, not jobs.
  6. Unpublish: per-registry capability check (GHCR and Docker Hub denied), runtime fallback when a registry rejects tag deletion.

Known issues (why this is a draft)

  • Connecting with auth "None" succeeds but every later call fails, because the team server has no anonymous access.
  • GET /client/projects/:id/versions can renumber local versions (DB writes on a read). Options for fixing the local/remote numbering are being discussed separately.
  • The server token is stored in plaintext SQLite while registry passwords use the keyring.
  • Push and publish do not appear in Jobs or notifications.
  • Smaller: local delete leaves publication rows behind; the pull toast duplicates the jobs toast polling; the create-project discard guard misses header nav links; sdk/registry uses its own HTTP helper; the CLI prints "Install version version N".
  • Prototype differences left: header nav icons, bell and admin shield; fonts come from the Nebari theme (IBM Plex Sans / Fira Code, not Geist); duplicate latest tag and sync-marker semantics when the server is ahead; single-step install progress; a CSP console error for the inline theme script (already on ux-rework-dev).
  • Intentional differences: Channels field on the forms (listed in Map client prototype functionality onto the reworked source layout #649), en-dashes instead of em-dashes, Share disabled until a project is on a server, cancellable pull toast, summary of changes on the new-version page.

This is large (about 380 files). It can be split into per-area PRs (foundation, projects, detail, new version, compare, remote, sharing, publish, jobs) if reviewers prefer.

Testing

  • go build ./..., go vet ./..., go test -tags=e2e -race ./..., golangci-lint run ./... (0 issues), make swagger (no diff).
  • npm run ci, npm test (client 469, server 201, ui 29), npm run build.
  • Each area was exercised against nebi-web and nebi-server with real pixi environments and compared screen by screen with the prototype using Playwright. The native folder picker was only checked in nebi-web (hidden); the desktop dialog was not run.
  • cmd/nebi-cli race tests take about 14 minutes against the 30 minute CI timeout.
  • internal/logstream TestPublishIsolatesSlowSubscriberFromFastOne failed repeatedly in one verification worktree but passed in the final run; it may be flaky.

Introduce internal/artifact, the pure helpers both client and server
use: pixi.toml parsing, format-preserving edits and rendering, name,
channel, platform and constraint validation, pixi.lock parsing (v4 to
v7), requested/resolved version diffs and a deterministic .tar.gz
version archive.

internal/pixi.ValidateProjectName and internal/diff parseCondaFilename
now delegate to artifact with unchanged behaviour.
Add the target layout from issue 587 for the client functions in
issue 649:

- internal/client/sdk/{local,exec,remote,registry} with shared types,
  errors, hooks and a job submitter interface so the SDK never imports
  internal/client/jobs
- internal/client/jobs dispatcher and handlers, internal/client/api
  REST routes, internal/client/desktop and the client entry points
- internal/server/{api,core} for sync, sharing and publications
- model and migration changes for project remotes, version
  publications, jobs and registries
- one CLI command file per SDK unit in cmd/nebi-cli
- frontend apps/client routes, typed API clients, hooks, MSW handlers,
  page and dialog shells, plus shared packages/ui components
sdk.Client.Compare diffs two versions with artifact.DiffVersions. A side
missing on this machine is fetched from the linked server through
sdk/remote (not found when the project is unlinked, no server is
connected or the remote SDK cannot serve files yet). Resolved versions
use this machine's platform when a lock has it. Base and target carry
installed and latest-on-server labels.

nebi project compare prints the Compare versions table (--json,
--resolved), and nebi diff gains --packages for the same view of any two
diff sources.
Implement the team-server side of the share dialog in internal/server/core:
search people and teams, list who has access, grant, change role and
remove access with roles Owner / Can edit / Can view mapped onto the
project owner and the editor / viewer RBAC roles. Only the owner or an
admin manages access; non-admin owners share only with their own teams;
the owner can never be changed or removed (409 last_owner). Grants are
idempotent so an Undo can replay them.

Add DELETE /api/v1/catalog/projects/:id for the server UI: owner or admin
only, enqueuing the existing delete job.
Fill in the remote SDK sharing calls (list, grant, change role, remove,
search) on top of ServerJSON with client-side input checks, and give the
nebi server access/share/set-role/unshare/principals commands readable
output, --json, and name resolution for projects (local project linked
to the server) and principals (username, email or team name).
Implement the create_version flow in sdk/local: validate the draft
(form applied onto the base pixi.toml with artifact.ApplyForm, or an
edited pixi.toml), reject drafts identical to the base with code
no_changes, and submit a create_version job. The job solves pixi.lock in
a staging directory seeded with the base lock, stores the version with
its base version, author and description, and moves tags (latest always
moves to the newest version). The installed version is never touched.

Add the version draft and preview endpoints (summary of changes against
the base) and the nebi project version new command with pixi.toml and
form-style edits, --dry-run and --install.
…ll of a version

Implement the U2 (project detail) backend for issue 649:
- sdk/local: ListVersions (newest first, visible tags with latest first,
  author snapshot or local account name, installed flag, decorators),
  GetVersion with the environment spec, GetVersionFile, ResolvedPackages
  per platform from pixi.lock, WriteVersionArchive via internal/artifact.
- sdk/exec: InstallVersion / Uninstall submit jobs (job_active and
  not_installed conflicts); RunInstallVersion writes the version's
  pixi.toml and pixi.lock and runs pixi install --frozen, restoring the
  previously installed version when the install fails or is cancelled;
  RunUninstall clears the installed version.
- executor: InstallEnvironmentFrozen on the local executor.
- client API: server-only versions fall back to the remote SDK for detail,
  files and packages; safe Content-Disposition for archives.
- CLI: table output for project versions/packages, version install and
  version uninstall commands.
…a the client SDK

Fill in sdk/registry for issue 649: registries in oci_registries with
passwords in the keyring (add, edit, remove, default handling, legacy CLI
row cleanup), publish a chosen version to several registries with
per-registry results, retire publications when a tag moves, unpublish
with a per-registry tag-deletion capability check, the local Published
badge decorator, best-effort reporting to the linked team server, and
pulling a project from a registry as a pull_registry job.

internal/oci gains PublishFiles, DeleteTag (tag-only DELETE, never by
digest), TagDeletionSupport and plain-HTTP browsing. The client API adds
PUT /client/registries/:registryId for editing.
Implement core.RecordPublication, RemovePublication and
PublicationsByVersion on version_publications (gap 2): the client's
publication ID is reused so unpublish can address it, a tag that moves
retires the previous record, and nothing credential-like is stored.
Base and Compare to pickers label the installed version and the
server's latest (and server-only versions), default to the prototype's
choice (opened-from, installed, server latest) and keep the pair in the
URL (?base=&to=). The side-by-side table shows requested packages with
per-side line numbers, added/removed/changed markers and colours, the
"Summary of changes" counts or "No changes", and channel or platform
changes. Exit Compare returns to the detail page (?v=from).

A server-only side that cannot be fetched shows a retryable error and
the query keeps retrying on the error backoff while the server is
unreachable.
The worker now starts a job with a conditional update so a cancel that
lands while the job is queued always wins, watches the job row for a
cancel recorded by another process (the CLI or a second app on the same
database), and keeps a per-job log history in the broker so a late
subscriber gets the log so far and every live chunk exactly once.
… linkage

Fill the client job service: filtered and sorted job list with project
names (kept after a project is deleted), job detail, cancel with real
context cancellation for running jobs (worker or another process) and
row cancellation for queued ones, a log follower that streams from the
worker broker or polls the stored log, and the FailedInstallJobID
project decorator. CLI inline jobs now flush their log while running and
stop when cancelled from the app.

Client REST: the SSE log stream at /client/jobs/:jobId/logs/stream.
CLI: nebi job (alias jobs) list/show/cancel/logs with tables, --json,
short job ids and --follow.
Build the share dialog from the prototype (ShareDialog, ShareRoleMenu,
ShareAdding, ShareToasts): search people and teams on the connected
server, add them as Can view or Can edit, change or remove access from
the role menu, and Undo every change from its toast. People who cannot
manage access see the list read-only. The presentational part is split
from the data wiring so the server app can reuse it.
…pull

Implement core.ListCatalogProjects, CreateCatalogProject, ListSyncVersions,
GetSyncVersion and PushVersions. Pushed versions keep their numbers; the
same number with the same content is accepted again, other content is a
version_conflict and a gap is server_ahead. Tags move with pushed versions,
latest always points at the newest one and publication metadata sent with
a version is recorded.
…emote SDK

Connect to one team server with no auth or a token, manage and disconnect
(pulled projects keep their remote link). List and refresh server
projects, pull a project as a pull or pull_install job with a local name
check, pull a single server-only version, and push local versions in
order (idempotent, optionally up to a version). The project and version
decorators fill update_available, server_latest_version, the server
remote, sync markers, server-only versions and server publications.
Local-only versions that collide with server numbers are renumbered after
the server's newest version.
… SDK

nebi project publish-version/unpublish/publications and nebi registry
pull/repos/tags/update call the client SDK. The local paths of nebi
registry add/list/remove/set-default now use oci_registries (passwords in
the keyring) instead of the legacy local_registries table, nebi publish
--local resolves registries through the SDK, records the Published badge
when the directory matches a stored version and gains --version N, and
nebi import --project creates a local project from an artifact.
…ush on the client SDK

The server commands now print the prototype wording, take --json where
they list data, and add 'server show' (remote details) and 'project push
--up-to'. 'nebi login' and 'nebi logout' store and clear the connection
through the SDK, so the desktop app and nebi-web see the same server.
Legacy directory-based 'nebi push' and 'nebi pull' are unchanged.
Replace the server app's projects pages with the prototype's Server
projects screen: a searchable, sortable list of the projects the user can
see, with Share and a row menu for Manage access and Delete from server.
Nothing can be pulled or installed here. Sharing uses the same dialog as
the client app against the server's access endpoints; deleting asks for
confirmation and is offered to owners and admins only. The header now
shows Server projects, Docs, the server, the admin link and the profile
menu.

Remove the legacy project, registry and settings pages and the
components only they used; admin pages are unchanged.
A form sent together with a pixi.toml is now written onto that text
instead of being rejected, so edits made in the pixi.toml editor before
switching to the GUI form survive (create and preview).
Build /projects/:id/new-version?from=N from the prototype: starts from
the base version's pixi.toml in the shared ManifestEditor (?mode=toml
opens the pixi.toml editor), shows a live summary of changes against the
base, suggests the description from the package changes, moves tags,
and submits a create_version job followed by a job toast (Version N
created, Started from version N). Create and install installs the new
version once it exists. Leaving with unsaved changes asks Discard new
version?, links included.

Add CreateNewVersionButton and useStartNewVersion for the project detail
page: starting from an older version asks Start a new version from
version N? first.
…and guided tour

Build the U2 project detail page (/projects/:id?v=N) from the prototype:
- header with breadcrumb, Install failed badge, Share (opens the sharing
  dialog when the project is on a server) and copy path toasts;
- version rail grouped by age with search, filters (installed, tagged,
  published, not on the server yet, only on the server), sync markers
  with tooltips, Published badges and a collapsed mode;
- selected version: tags, author, date, server and publication line,
  toolbar with Compare versions, Create new version (older-base
  confirmation), Push to server, Publish, Install / Uninstall / Pull;
- install progress, success and failure banners following the job, and
  the uninstall confirmation using the shared job toast;
- environment specification with Specified / All Resolved packages,
  package search, per-platform picker marking this machine, download
  sizes, and the Files menu (view pixi.toml / pixi.lock, download the
  archive);
- first-run tour (prompt, steps, Back / Next / End tour) remembered per
  viewer in localStorage, and Help > Take the page tour.
Build the /jobs and /jobs/:id pages from the prototype: search, Status /
Job type / Project filters kept in the URL (the project filter is
searchable), sort by Started, Refresh, row menu with View project
(disabled once the project is gone) and Cancel job, the failed alert,
Started / Ended / Duration, the waiting state, and a log with search and
match count, Copy and Download (nebi-<type>-<id8>.log). Running jobs
stream their log over SSE.

The reusable job progress toast gains running descriptions, cancelled
and error copy, View job while running, de-duplication and 404 handling.
The header bell lists recent local job outcomes with an unread count
(gap 4: local jobs only). The App route test now expects the bell to be
a menu button instead of a link.
PublishDialog follows the prototype PublishModal: one switch per
registry with its default repository:tag, inline Edit with the
"Use repository:tag" check, the "Will be unpublished" warning, Save
only when something changes, unpublish locked where the registry cannot
delete tags, and a per-registry results view after saving
(PublishAfterSave) with the prototype toasts.

The Registries page (a stub in the prototype) lists registries with
search, default, credentials and unpublish support, and offers add,
edit, make default, remove and pull. AddRegistryDialog adds or edits a
registry (password kept in the keychain) and PullFromRegistryDialog
pulls a repository:tag into a new project with Pull or Pull and
install, tracked by the job toast.
… push controls

Build the Server page from the prototype: connected and disconnected
states, Connected to / Signed in as / Last synced with refresh and a
Syncing state, searchable and sortable server projects with Pull and
install, Pull project, Open project and Manage access, and an unreachable
or rejected-token state that keeps retrying. Connect server and Manage
connection share one dialog (auth None or Token, the stored token is kept
when saving), with the disconnect confirmation. The pull dialog checks the
local name and the pull job toast follows the job through Pulled.
Installing version N, installed, pulled or the cancelled copy. Add Push to
server, Pull version N and sync marker components for the detail page and
show the server without its scheme in the header badge.
List local projects with installed version, install status derived from
jobs and disk, size on disk and registry remotes, then run the registered
project decorators. Validate new projects (strict name rule, duplicate
names ignoring case, at least one platform, description, tags, folder
checks), default the folder to the projects dir, and run create as a job
that solves the lock, stores version 1 with its tags and chains the exec
install body for Create and install. Delete uninstalls, removes folders
Nebi created and soft-deletes the project with its versions, tags and
remotes. Wrap the artifact form and pixi.toml round trip for the client
API.
… the SDK

project list now shows the client project list (version, environment,
size, remotes, path) including workspaces tracked with nebi init, whose
names still follow their pixi.toml. project create takes flags or a
pixi.toml and runs the create job inline; delete asks for confirmation
unless --yes; show prints the list item. install gains --version and,
like uninstall, works on local projects through the exec SDK, falling
back to the configured server for projects not on this machine.
Projects list with search, sortable columns, Install / Uninstall,
Update available and Install failed badges, connected remotes, the row
menu (Create new version, Delete project with a confirmation) and the
New project split button; empty states for connected and not connected
hosts open the server and registry dialogs.

New project page with the Project, Environment, Packages and About
version 1 sections, the native folder picker when the host has one,
client and server validation, Create and Create and install with job
toasts, and the discard confirmation. The shared ManifestEditor now
renders the GUI form (platforms, channels, packages with version
operators) or the pixi.toml editor and converts between them through the
manifest parse and render endpoints.
cmd/nebi-cli now carries end-to-end tests for every client command. Under
-race they open and migrate the pure-Go SQLite database per command and
take about 11 minutes on a laptop, over the 10 minute default.
A compare side the server does not have either now maps to a plain
not-found ('version 9 is not on this machine or on the server') instead
of 'server error (404)'. nebi project compare no longer prints the usage
text when the arguments were valid but the compare failed.
A package whose requested constraint changed but resolves to the same
version was marked changed with identical versions on both sides; the
cells now show each side's constraint. The summary no longer says
"No changes" when only channels or platforms differ.
…ffer

nebi project compare and nebi diff --packages now print +0 -0 ~0 with the
channel or platform line, matching the Compare versions page.
… prototype

Toasts rendered under an open dialog's z-50 viewport, so the Undo on
'Access updated', 'Access removed' and 'Shared <name>' could not be
clicked while the share dialog was open. Raise the toast viewport to
z-[60].

Also match the prototype: focus the search field when the share dialog
opens, use the prototype gap on the row role menu trigger, and use the
default icon size in the server projects row menu.
'nebi server share|set-role|unshare' printed the raw ID when a principal
was given by ID; report the name from the access list instead. Server
refusals (403, 409) no longer print the command usage, like the other
server commands, and the read-only note matches the share dialog.
Base UI clears a multiple combobox's whole selection when Escape is
pressed with the popup closed, so closing the tag or platform picker
with Escape silently dropped every tag (including the typed one) from
the new project. ChipsField now ignores escape-key clears. The Tags
field keeps its "Add a tag" placeholder next to chips, like the
prototype.
The theme's unlayered .font-mono rule forced 14px over text-xs in the
pixi.toml editor, and Fira Code ligatures drew ">=" as a single glyph.
The editor now renders at 12px with ligatures off (also for the version
operator list). The combobox trigger uses chevrons-up-down like the
prototype.
nebi project install printed "Install version version 1 of x"; the
summary now reads "Install version (x, version 1): Succeeded". The
delete confirmation only mentions the installed environment when one
is installed.
…permission message

Sync markers follow the prototype (InSync, ServerAhead): when the newest
versions differ, the newest local version is Newest here and the
server's newest version is Newest on server, even when the other side
also has it.

Tags shown on a linked project's versions are reconciled: latest only on
the newest version (local or server-only), tags of versions not pushed
yet win, and otherwise the server's tags are authoritative, so a pulled
version no longer shows latest next to a newer server-only version.

A push rejected with 403 now explains that the project is view-only.
nebi status prints the tracked project's installed and newest version and,
when it is linked to the connected server, which versions are only on
this machine or only on the server (with the push / pull-version command
to run). --json gains a versions object. Folders tracked with nebi init
that have no versions keep the legacy output.
- Field errors in the connect and pull dialogs use the prototype's
  smaller text.
- The row actions menu keeps the default menu width.
- Syncing stays visible for a moment after a refresh click, as in the
  prototype, even when the refresh is instant.
- A server that rejects a connection without a token asks for one
  instead of suggesting the token expired.
Use the new version copy for the editor sections ("this version",
"Starts with version N's ..."), put the TOML/GUI switch in the page
header, give the discard dialog its close button, title the running
job toast after the project and light up the new version's row in the
rail once it is created (JustCreated). The pixi.toml editor no longer
renders operator ligatures such as >= as a single glyph.
- install_version jobs now fail with pixi's own error line (for example
  "failed to fetch foo-1.0.conda") instead of only "pixi install failed:
  exit status 1"; the executor error stays wrapped
- installing a version that is not local no longer claims it exists:
  "If it is on the server, pull it first"
- nebi project file / packages fall back to the linked server for
  server-only versions, like the client API
- detail commands no longer print usage on runtime errors, the install
  error is not repeated, and download sizes use the app's decimal units
The job page says "Please see logs for details", but the worker only
published "[ERROR] Job failed: <reason>" and "[CANCELLED] Job cancelled"
to live subscribers, so a failed job viewed after the fact showed no
reason (e.g. a permission error only lived in job.error). The worker now
writes both lines through the capped log writer, and CLI inline jobs
append them to the stored log.

A job cancelled from another process (nebi job cancel for an app job, or
the Jobs page for a CLI job) gets its row marked cancelled before its
runner has stopped and saved the cleanup log. FollowLogs (SSE and
nebi job logs -f) and the job page query now keep following such a job
until the stored log ends with the cancel line, bounded to two minutes.
The running job hint now reads "Streaming: job in progress", the
prototype copy without its em-dash.

TestPublishIsolatesSlowSubscriberFromFastOne let a free-running reader
race 4101 non-blocking publishes; on a busy machine the reader was not
scheduled before the buffer filled and the test failed. The publisher now
waits for the fast reader to acknowledge each line.
- Install uses the import icon, Published badges use package-check, and
  Install failed uses triangle-alert, as in the prototype
- the install failure alert and toast show the reason without repeating
  "version N couldn't install"
- Uninstall confirmation gets the close button and secondary Cancel
- package tabs keep the prototype spacing above the table, and the
  platform picker keeps its width when the platform changes
- the tour skips the Share step for projects that are not on a server
- rows light up when a version appears (created or pulled) and the In
  sync marker animates after a push
- Help links Docs with the external-link icon
…d dialogs

- Unpublish removes the server record of a publication that reached the
  server with a pushed version (server ID differs from the local one).
- Publish results explain missing or rejected registry credentials and
  unreachable registries instead of raw OCI errors.
- Publish dialog: mono references at the prototype's 12px, Save stays
  available while a valid repository:tag edit is open, server-only
  publications are named after the matching local registry.
- Add/Edit registry dialog fits a 900px-high window (username and
  password side by side).
- Registries nav item uses the prototype's package icon.
- nebi import --project matches a plain-HTTP registry when the reference
  has no scheme.
# Conflicts:
#	frontend/apps/client/src/components/detail/VersionRow.tsx
#	frontend/apps/client/src/components/manifest/TomlEditor.tsx
Trivy fails the image scan on golang.org/x/net v0.60.0 (HIGH,
golang.org/x/net/html denial of service). The bump pulls the matching
golang.org/x/{crypto,sync,sys,term,text,tools} updates.
@tylerpotts

tylerpotts commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator Author

@pmeier This was mostly a test to see how long it would take Claude to generate a functional POC based on the latest state of the UI and the code architecture. Using parallel workloads in Claude this took 2h 41m to generate and ~15% of my weekly token allowance

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant