Thanks to visit codestin.com
Credit goes to github.com

Skip to content

feat: implement efficient backend querying on the tasks page #18488

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 24, 2025

Conversation

hugodutka
Copy link
Contributor

@hugodutka hugodutka commented Jun 22, 2025

Use the /workspaces?q=has-ai-task=true, /templates?q=has-ai-task=true and /aitasks/prompts endpoints to fetch Task templates and workspaces on the /tasks page.

Also:

  • remove documentation link placeholders: the documentation is not in place yet and is not going to be available before the June 24th code freeze
  • load workspaces and templates in parallel
  • replace loading spinners with content skeletons

Related to #18454 and coder/internal#660.

DANGER: this PR must be merged only after all issues mentioned in #18454 are closed to avoid breaking the dogfood environment.

@hugodutka hugodutka force-pushed the hugodutka/tasks-page-efficient-backend branch from 3883a22 to c4d88d5 Compare June 22, 2025 17:36
@hugodutka hugodutka marked this pull request as ready for review June 23, 2025 11:19
@hugodutka hugodutka requested a review from BrunoQuaresma June 23, 2025 11:21
@hugodutka hugodutka force-pushed the hugodutka/tasks-page-efficient-backend branch from c4d88d5 to 4f403dd Compare June 23, 2025 13:41
@hugodutka hugodutka force-pushed the hugodutka/bulk-wb-parameters branch 2 times, most recently from 4b753a6 to f62da9d Compare June 23, 2025 13:44
@hugodutka hugodutka force-pushed the hugodutka/tasks-page-efficient-backend branch from 4f403dd to 69a2e2d Compare June 23, 2025 13:44
@hugodutka hugodutka force-pushed the hugodutka/bulk-wb-parameters branch from f62da9d to f114f43 Compare June 23, 2025 13:47
@hugodutka hugodutka force-pushed the hugodutka/tasks-page-efficient-backend branch from 69a2e2d to 97a00ba Compare June 23, 2025 13:47
@hugodutka hugodutka force-pushed the hugodutka/bulk-wb-parameters branch from f114f43 to bf23151 Compare June 23, 2025 14:52
@hugodutka hugodutka force-pushed the hugodutka/tasks-page-efficient-backend branch from 97a00ba to 604f994 Compare June 23, 2025 14:52
@hugodutka hugodutka requested a review from code-asher June 23, 2025 18:27
Copy link
Member

@code-asher code-asher left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good to me!

I tried it out and my template is not showing up in the dropdown and my workspace does not show in the table, but from my brief glance at the sql I think this is just because the has_ai_task column is always false at the moment?

@@ -211,7 +247,7 @@ const TaskForm: FC<TaskFormProps> = ({ templates }) => {
form.reset();
} catch (error) {
const message = getErrorMessage(error, "Error creating task");
const detail = getErrorDetail(error) ?? "Please, try again";
const detail = getErrorDetail(error) ?? "Please try again";
Copy link
Member

@code-asher code-asher Jun 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Extremely minor, just noticing that this error message has no comma but the ones on 174 and 379 do. Personally I like it better without a comma.

/>
);
}
if (templates == null) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also minor: I think the linter is fine with this, but everywhere else we do === null (triple equals) or just if (templates).

@hugodutka hugodutka force-pushed the hugodutka/bulk-wb-parameters branch 2 times, most recently from 1273e3c to 5a42c7e Compare June 24, 2025 10:52
Base automatically changed from hugodutka/bulk-wb-parameters to main June 24, 2025 11:06
@hugodutka hugodutka force-pushed the hugodutka/tasks-page-efficient-backend branch from 604f994 to b791c0a Compare June 24, 2025 11:08
@hugodutka hugodutka merged commit 1d2b96b into main Jun 24, 2025
31 of 33 checks passed
@hugodutka hugodutka deleted the hugodutka/tasks-page-efficient-backend branch June 24, 2025 14:25
@github-actions github-actions bot locked and limited conversation to collaborators Jun 24, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants