8000 Implement the Profiles section on the Control page by yakutovicha · Pull Request #261 · aiidalab/aiidalab-home · GitHub
[go: up one dir, main page]

Skip to content

Implement the Profiles section on the Control page - #261

Closed
yakutovicha wants to merge 4 commits into
mainfrom
feature/profiles-tab
Closed

yakutovicha wants to merge 4 commits into
mainfrom
feature/profiles-tab

Conversation

@yakutovicha
@yakutovicha yakutovicha commented Sep 28, 2026 •
Copy link
Copy Markdown
Member

Fixes #256

Replaces the ProfileControlWidget placeholder with one row per profile in the AiiDA config:

  • The profile name, a "default" badge and an "(in use)" marker for the profile loaded by the page.
  • Make default, disabled on the current default. Its success message asks to reload the page, since the page keeps using the profile it loaded (as the Status tab already says in this situation).
  • Delete, disabled for the in-use profile. It opens an inline confirmation with an "Also delete all data of this profile (database and file repository)" checkbox, off by default and passed explicitly (Config.delete_profile deletes the storage by default).

Refresh rebuilds the rows and dismisses any pending confirmation, whose target may no longer exist.

Notes for review:

  • The config is always read fresh from disk with load_config(), both to list and to change it. AiiDA's cached get_config() misses changes made by other processes, and store() writes the whole in-memory config back, so a profile created in a terminal after the page loaded would silently disappear on "Make default". A test covers this against the real test config.
  • When the default profile is deleted, AiiDA 2.9 makes the first remaining profile the default, and the success message names it. When no profile remains, AiiDA keeps the deleted name as the default, so no new default is claimed.
  • The handlers run synchronously. With "delete all data" checked this can take a while (it drops the database and removes the repository), so a "Deleting…" message is shown first.

Tests

Against a fake config (which mirrors AiiDA's default handling): badge placement, disabled states, name escaping, the make-default and delete flows (including retargeting the confirmation, cancel, failure, and deleting the last default profile), and confirmation dismissal on refresh. Against the real test config: making another profile the default changes it on disk and keeps a profile added by another process.

🤖 Generated with Claude Code

@edan-bainglass
edan-bainglass commented Sep 29, 2026 •
Copy link
Copy Markdown
Member

How about we implement an add profile button too? Setup is seamless in v2.9, so the user can just select a profile name and get a ZMQ + sqlite profile, or, since we have rabbitMQ and postgres services in the container, maybe even that sort of profile is simple enough to generate. This would be quite useful, to spin up profiles from this panel, along with making them default (bad API, should just be called select profile or something like that) and/or deleting them.

Happy to discuss further 🙂


Quick test

Ran verdi presto in the container...

(base) jovyan@50196922f728:~$ verdi status
 ✔ version:     AiiDA v2.9.2
 ✔ config:      /home/jovyan/.aiida
 ✔ profile:     presto
 ✔ storage:     SqliteDosStorage[/home/jovyan/.aiida/repository/sqlite_dos_2323e61d02444476bdbed872f690820f]: open,
Warning: RabbitMQ v3.10.25 is not supported and will cause unexpected problems!
Warning: It can cause long-running workflows to crash and jobs to be submitted multiple times.
Warning: See https://github.com/aiidateam/aiida-core/wiki/RabbitMQ-version-to-use for details.
 ✔ broker:      RabbitMQ v3.10.25 @ amqp://guest:***@127.0.0.1:5672?heartbeat=600
 ⏺ daemon:      The daemon is not running.

Then refreshed the UI...

image

I think maybe this is not correct? What does "default (in use)" mean? And why is it that "default" cannot be deleted?

Tried to delete "presto"...

image

and

image

👃🐟

@danielhollas
Copy link
Copy Markdown
Contributor

How about we implement an 8000 add profile button too? Setup is seamless in v2.9, so the user can just select a profile name and get a ZMQ + sqlite profile, or, since we have rabbitMQ and postgres services in the container, maybe even that sort of profile is simple enough to generate. This would be quite useful, to spin up profiles from this panel, along with making them default (bad API, should just be called select profile or something like that) and/or deleting them.

I would leave that out of this PR though. (no scope creep)

I would be honestly fine for leaving this tab out of the initial 3.12 image release, out of all the others this one seems least useful at this point since most / all users will currently have only a single profile, and having more of them doesn't make much sense without more design / UX work in the Apps imo.

@edan-bainglass
Copy link
Copy Markdown
Member

@danielhollas I agree and discuss with @yakutovicha in person. We will close this PR for now and reassess for JL later. I let @yakutovicha do the honors 🙂

@yakutovicha
yakutovicha removed this pull request from stack #263 October 23, 2026 10:30
Replace the ProfileControlWidget placeholder with a per-profile row
list: default badge, in-use marker, Make default, and Delete with an
inline confirmation.

- The config is always read fresh from disk (load_config), both to
  list and to change it. AiiDA's cached config misses changes made by
  other processes, and storing it would silently drop them, e.g. a
  profile created in a terminal after the page was loaded.
- Delete is disabled for the profile loaded by the page. The "also
  delete all data" checkbox defaults to off and is passed explicitly,
  since Config.delete_profile deletes the storage by default.
- Refresh rebuilds the rows and dismisses any pending confirmation,
  whose target may no longer exist.
- Deleting the default profile reports the profile AiiDA picked as
  the new default.

Tested against a fake config (badge placement, disabled states, the
make-default and delete flows, confirmation dismissal) and, on the
real test config, that making a profile the default keeps a profile
added by another process.
When the deleted profile was the default and no profiles remain,
AiiDA keeps the deleted name as the default, so the success message
claimed the deleted profile was the new default. The "No profiles
remain." branch could never be reached.

Only name a new default when profiles remain. Also quote the name in
the "Deleting profile" message, as in the other messages.

The test fake now keeps the stale default like AiiDA does, and a new
test deletes the last (default) profile and checks that no new
default is claimed.
The test for keeping external config changes clicked "Make default"
on the only test profile, which is already the default, so the
button was disabled and the default never changed on disk.

Add a second profile before rendering and make it the default, then
check on disk both that the default changed and that the profile
added by another process survived the store.
Making a profile the default does not change the profile this page
has loaded: it stays marked "(in use)", and the Daemon tab keeps
controlling its daemon until the page is reloaded. Say so in the
success message, consistent with the Status tab's "reload the page
to apply" warning.

The make-default test asserts the full message.
@yakutovicha
yakutovicha force-pushed the feature/processes-tab branch from 79de393 to afaa582 Compare October 23, 2026 10:41
@yakutovicha
yakutovicha changed the base branch from feature/processes-tab to main October 23, 2026 10:42
@yakutovicha
Copy link
Copy Markdown
Member Author

as discussed, closing

80A8
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.

Control page: implement the Profiles section

3 participants

0