Skip to content

Indicate chat exists on project, workflow or job #3258

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jyeshe
Copy link
Collaborator

@jyeshe jyeshe commented May 30, 2025

Description

This PR adds an icon on the workflows and projects lists when the user has a chat in a job that belongs to the workflow or project (directly or indirectly).

It also indicates if the user has started a chat on a specific job, on the Workflow Diagram

Closes #2922

Validation steps

  1. Look at the Projects table and see no icon
  2. Change exists to not exists on
    has_ai_chat: exists(chat_session_exists_query)
  3. Look again at the Projects table and the sparkles are there
  4. Repeat for Workflows table by changing the exists on this line:
    select: %{w | has_ai_chat: exists(chat_session_exists_query)},
  5. Finally to check the Jobs on the Workflow Diagram, change the line
    Map.put(job, "has_ai_chat", has_ai_chat)

Additional notes for the reviewer

  1. (Is there anything else the reviewer should know or look out for?)

AI Usage

Please disclose how you've used AI in this work (it's cool, we just want to know!):

  • Code generation (copilot but not intellisense)
  • Learning or fact checking
  • Strategy / design
  • Optimisation / refactoring
  • Translation / spellchecking / doc gen
  • Other
  • I have not used AI

You can read more details in our Responsible AI Policy

Pre-submission checklist

  • I have performed a self-review of my code.
  • I have implemented and tested all related authorization policies. (e.g., :owner, :admin, :editor, :viewer)
  • I have updated the changelog.
  • I have ticked a box in "AI usage" in this PR

@github-project-automation github-project-automation bot moved this to New Issues in v2 May 30, 2025
@jyeshe jyeshe force-pushed the chat-present-with-sparkles branch 2 times, most recently from 6225ead to cbec882 Compare May 30, 2025 15:27
@jyeshe jyeshe force-pushed the chat-present-with-sparkles branch from cbec882 to 197423d Compare May 30, 2025 15:27
@jyeshe jyeshe changed the title Chat present with sparkles Indicate chat exists on project, workflow or job May 30, 2025
@jyeshe jyeshe self-assigned this May 30, 2025
Copy link

codecov bot commented May 30, 2025

Codecov Report

Attention: Patch coverage is 0% with 27 lines in your changes missing coverage. Please review.

Project coverage is 1.41%. Comparing base (127fb0c) to head (98e0736).
Report is 6 commits behind head on main.

Files with missing lines Patch % Lines
lib/lightning_web/live/workflow_live/edit.ex 0.00% 10 Missing ⚠️
lib/lightning/workflows.ex 0.00% 9 Missing ⚠️
lib/lightning/jobs.ex 0.00% 2 Missing ⚠️
lib/lightning/projects.ex 0.00% 2 Missing ⚠️
...ib/lightning_web/live/dashboard_live/components.ex 0.00% 2 Missing ⚠️
...ing_web/live/workflow_live/dashboard_components.ex 0.00% 1 Missing ⚠️
lib/lightning_web/live/workflow_live/index.ex 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##            main   #3258      +/-   ##
========================================
+ Coverage   1.09%   1.41%   +0.32%     
========================================
  Files        363     363              
  Lines      13938   13958      +20     
========================================
+ Hits         152     197      +45     
+ Misses     13786   13761      -25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jyeshe jyeshe marked this pull request as ready for review June 2, 2025 07:15
@jyeshe jyeshe requested review from josephjclark and elias-ba June 2, 2025 08:08
Copy link
Contributor

@elias-ba elias-ba left a comment

Choose a reason for hiding this comment

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

Hey @jyeshe great job, man. I have just one comment on the placement of the sparkles icon in the projects and workflows table. Maybe worth chatting with @taylordowns2000 and @josephjclark for UI ideas.

@@ -182,6 +182,11 @@ defmodule LightningWeb.DashboardLive.Components do
>
<.td>
{project.name}
<.icon
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we put the icon before the name ? The problem with putting it after the name is when the name is too long we do cut it and then the icon won't appear at all. See in this screenshot, how Validate And Notify Registration is not showing the icon because the name is cut ?

Screenshot 2025-06-02 at 09 18 35

@@ -326,6 +326,7 @@ defmodule LightningWeb.WorkflowLive.DashboardComponents do
style="max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"
>
{@workflow.name}
<.icon :if={@workflow.has_ai_chat} name="hero-sparkles" class="size-4" />
Copy link
Contributor

Choose a reason for hiding this comment

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

Same as my previous comment

@github-project-automation github-project-automation bot moved this from New Issues to In review in v2 Jun 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

Show an Icon for Projects, Workflows and Steps that have associated AI chats
3 participants