deepmodeling / deepmodeling/dpgui

[Code scan] Refresh input views after installed templates finish loading

Open
#562 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Vue
Stars
9
Forks
5
PR merge metrics
No merged PRs in 30d

Description

This issue was found during a Codex global code scan of the repository.

Baseline commit: e3c5b38a99eb7ab778b5d8c68a5ed4ddf6cf91b3

Problem

In Python mode, installed templates are fetched asynchronously. When the fetch resolves, the app updates navigation only. The `/input` table and `/input/:id` detail view use one-time snapshots and do not reload after `installed_templates` changes.

Code references:
https://github.com/deepmodeling/dpgui/blob/e3c5b38a99eb7ab778b5d8c68a5ed4ddf6cf91b3/src/App.vue#L108-L114
https://github.com/deepmodeling/dpgui/blob/e3c5b38a99eb7ab778b5d8c68a5ed4ddf6cf91b3/src/views/InputConfig.vue#L30
https://github.com/deepmodeling/dpgui/blob/e3c5b38a99eb7ab778b5d8c68a5ed4ddf6cf91b3/src/views/InputView.vue#L57-L64

Relevant snippet:
```js
this.installed_templates = data;
this.update_navi();
```

```js
items: this.all_items(),
```

Impact

If a user opens `/input` or a direct installed-template URL before `/api/inputs` completes, the table can remain stale or the detail page can show `Invalid ID!` even though the template becomes available shortly afterward.

Suggested fix

Make installed templates reactive for the views: use computed `items`, watch the app-level `installed_templates`, or delay route rendering until the initial template fetch has completed.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in src/App.vue around the installed_templates fetch and update_navi call, then read src/views/InputConfig.vue and src/views/InputView.vue at the referenced lines. Reproduce opening /input or an installed-template URL before /api/inputs completes, and verify both views refresh when installed_templates loads without showing stale data or Invalid ID!.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
frontend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.