Skip to content

Conversation

tatianainama
Copy link
Contributor

@tatianainama tatianainama commented Oct 1, 2025

Description:

This PR adds a UI component to display proposed changes tool calls in the UI.

  • Created a new AiProposeChangeToolCall component to render proposed changes
  • Implemented renderers for different entity types (table, dimension, metric)
  • Added support for displaying field operations (currently only 'replace')
  • Added storybook stories file to test multiple variants of the component without the need to prompt ai

Copy link
Contributor Author

tatianainama commented Oct 1, 2025

Copy link

github-actions bot commented Oct 1, 2025

Your preview environment pr-17164 has been deployed with errors.

@tatianainama tatianainama changed the base branch from 10-01-feat_add_propose_change_tool_validators to graphite-base/17164 October 1, 2025 14:33
@tatianainama tatianainama force-pushed the 10-01-feat_propose_change_tool_ui branch from c786248 to 7ac5b63 Compare October 1, 2025 14:33
@graphite-app graphite-app bot changed the base branch from graphite-base/17164 to main October 1, 2025 14:33
@tatianainama tatianainama force-pushed the 10-01-feat_propose_change_tool_ui branch from 7ac5b63 to 572d275 Compare October 1, 2025 14:34
@tatianainama tatianainama force-pushed the 10-01-feat_propose_change_tool_ui branch from 572d275 to 3b08a34 Compare October 1, 2025 15:04
Copy link

github-actions bot commented Oct 1, 2025

Copy link

github-actions bot commented Oct 1, 2025

You can ssh into the preview environment by running: ./scripts/okteto-ssh.sh 17164

@tatianainama tatianainama changed the title feat: propose change tool ui feat: introduce propose change tool template Oct 1, 2025
@tatianainama tatianainama force-pushed the 10-01-feat_propose_change_tool_ui branch from 3b08a34 to fa68e00 Compare October 2, 2025 07:40
Copy link

github-actions bot commented Oct 2, 2025

Copy link

github-actions bot commented Oct 2, 2025

You can ssh into the preview environment by running: ./scripts/okteto-ssh.sh 17164

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Sequence Diagram

sequenceDiagram
    participant User
    participant AssistantBubble as "AgentChatAssistantBubble"
    participant AiProposeChangeToolCall as "AiProposeChangeToolCall"
    participant ChangeRenderer as "ChangeRenderer"
    participant OperationRenderer as "OperationRenderer"
    participant SupportElements as "SupportElements"

    User->>AssistantBubble: "Views AI assistant message"
    AssistantBubble->>AssistantBubble: "Extract proposeChangeToolCall from message/stream"
    
    alt proposeChangeToolCall exists
        AssistantBubble->>AiProposeChangeToolCall: "Render tool call with change & entityTableName"
        AiProposeChangeToolCall->>AiProposeChangeToolCall: "Create collapsible container with change type badge"
        
        alt Container is expanded
            AiProposeChangeToolCall->>ChangeRenderer: "Render change based on entityType"
            
            alt entityType is 'table'
                ChangeRenderer->>SupportElements: "Render TableBreadcrumb"
                ChangeRenderer->>OperationRenderer: "Render operations for each patch field"
            else entityType is 'dimension'
                ChangeRenderer->>SupportElements: "Render FieldBreadcrumb with dimension info"
                ChangeRenderer->>OperationRenderer: "Render operations for each patch field"
            else entityType is 'metric'
                ChangeRenderer->>SupportElements: "Render FieldBreadcrumb with metric info"
                ChangeRenderer->>OperationRenderer: "Render operations for each patch field"
            end
            
            loop For each operation
                OperationRenderer->>OperationRenderer: "Render replace operation with field name and value"
            end
        end
    end
Loading

10 files reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

Copy link

github-actions bot commented Oct 2, 2025

Copy link

github-actions bot commented Oct 2, 2025

You can ssh into the preview environment by running: ./scripts/okteto-ssh.sh 17164

Comment on lines +91 to +96
const proposeChangeToolCall = isStreaming
? (streamingState?.toolCalls.find((t) => t.toolName === 'proposeChange')
?.toolArgs as ToolProposeChangeArgs)
: (message.toolCalls.find((t) => t.toolName === 'proposeChange')
?.toolArgs as ToolProposeChangeArgs); // TODO: fix message type, it's `object` now

Copy link
Contributor

Choose a reason for hiding this comment

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

For later: find a way to avoid "as" and use Tool call zod schemas

@@ -0,0 +1,212 @@
import '@mantine-8/core/styles.css';
Copy link
Contributor

Choose a reason for hiding this comment

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

move to stories


type OperationRendererProps = {
operation: Operation;
fieldName: string;
Copy link
Contributor

Choose a reason for hiding this comment

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

from offline convo: call "property" instead of "field"/"fieldName" to avoid mixing other parts in the codebase mentioning field, which is usually a queryable object(dim,metric,tablecalc...)

@@ -1,3 +1,5 @@
import '@mantine-8/core/styles.css';
Copy link
Contributor

Choose a reason for hiding this comment

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

Import path violation: Replace '@mantine-8/core/styles.css' with the standard Mantine import path '@mantine/core/styles.css'. The frontend development guidelines require using standard Mantine import paths for the base UI library.

Suggested change
import '@mantine-8/core/styles.css';
import '@mantine/core/styles.css';

Spotted by Diamond (based on custom rule: packages/frontend rules)

Fix in Graphite


Is this helpful? React 👍 or 👎 to let us know.

Copy link
Contributor Author

tatianainama commented Oct 2, 2025

Merge activity

  • Oct 2, 12:44 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Oct 2, 12:45 PM UTC: Graphite rebased this pull request as part of a merge.
  • Oct 2, 12:45 PM UTC: @tatianainama merged this pull request with Graphite.

@tatianainama tatianainama force-pushed the 10-01-feat_propose_change_tool_ui branch from 7e48d98 to ddf7b44 Compare October 2, 2025 12:44
@tatianainama tatianainama merged commit 9d63834 into main Oct 2, 2025
8 of 10 checks passed
@tatianainama tatianainama deleted the 10-01-feat_propose_change_tool_ui branch October 2, 2025 12:45
lightdash-bot pushed a commit that referenced this pull request Oct 2, 2025
# [0.2039.0](0.2038.1...0.2039.0) (2025-10-02)

### Features

* introduce propose change tool template ([#17164](#17164)) ([9d63834](9d63834))
@lightdash-bot
Copy link
Collaborator

🎉 This PR is included in version 0.2039.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants