Skip to content

Conversation

@AdityaHegde
Copy link
Collaborator

@AdityaHegde AdityaHegde commented Dec 15, 2025

  1. Routing generate data CTA to developer chat if the flag is enabled.
  2. Updating the home page to show new CTAs that make sense for the new flow.
  3. Also updating the home page to who a "generating data" message.

Note: This flips the developer flag for ease of testing. Will be disabled before merging.

Checklist:

  • Covered by tests
  • Ran it and it works as intended
  • Reviewed the diff before requesting a review
  • Checked for unhandled edge cases
  • Linked the issues it closes
  • Checked if the docs need to be updated. If so, create a separate Linear DOCS issue
  • Intend to cherry-pick into the release branch
  • I'm proud of this work!

@AdityaHegde AdityaHegde marked this pull request as draft December 15, 2025 15:10
@AdityaHegde AdityaHegde mentioned this pull request Dec 30, 2025
8 tasks
@ericokuma
Copy link
Contributor

ericokuma commented Jan 2, 2026

UXQA:

  1. When generating data from non-home page, we only need display the prompt modal if the developer_chat feature flag is disabled. If developer_chat feature flag is enabled, we don't show the prompt modal and instead show the ChatBot
  2. Generate data action should continue with the current conversation for now
  3. I don't see any generating animation. Just a static image: Screenshot 2026-01-02 at 11 07 42 AM
    some things that I don't see from the Figma is that the designs call for some color on the image as well as the text: "✨ Generating your sample data". Also need some padding between the image and the text below:
    Screenshot 2026-01-02 at 11 14 29 AM.
    The image as well as the title text should be pulsing!
  4. Could we use the display names of the demo projects instead of names?
Screenshot 2026-01-02 at 11 31 03 AM

@AdityaHegde AdityaHegde force-pushed the feat/generate-data-to-dev-chat branch from e20b1a7 to d15d162 Compare January 14, 2026 11:17
@AdityaHegde AdityaHegde marked this pull request as ready for review January 15, 2026 14:29
Copy link
Contributor

@ericpgreen2 ericpgreen2 left a comment

Choose a reason for hiding this comment

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

Architecture Feedback

1. "Navigate on AI file write" should be part of the chat infrastructure

The FileWriteListener class and maybeNavigateToGeneratedFile function implement a behavior that belongs in the developer chat infrastructure, not in generate-sample-data.ts. This behavior—navigating to a file when the AI writes it—applies to all developer chat interactions (e.g., "create a new canvas YAML file"), not just sample data generation.

However, auto-navigating on every file write has a UX problem: what happens when the AI creates multiple files? Navigating on each write would be jarring; navigating only on the last write requires the frontend to guess when the AI is "done."

Recommended approach: Introduce a navigate tool that the AI explicitly invokes when it wants to direct the user's attention to a file. This gives the AI control over the UX—it can navigate immediately for single-file operations, or wait until it finishes a multi-file operation and navigate to the primary artifact.

The existing tool-registry.ts can be extended to handle side effects:

export interface ToolConfig {
  renderMode: ToolRenderMode;
  createBlock?: (...) => ToolBlockType | null;
  /** Side effect to run when tool result is received */
  onResult?: (callMessage: V1Message, resultMessage: V1Message) => void;
}

const TOOL_CONFIGS: Partial<Record<string, ToolConfig>> = {
  // ... existing configs ...
  
  [ToolName.NAVIGATE]: {
    renderMode: "inline",
    onResult: (_call, result) => {
      const path = extractPath(result);
      goto(`/files${path}`);
    },
  },
};

This eliminates maybeNavigateToGeneratedFile, FileWriteListener, and the awkward binding pattern in DeveloperChat.svelte.

2. Remove sourceImportedPath.set() calls from sample data generation

The "source imported" modal should not be triggered for files created through the AI chat experience. The chat should propose the next step—we should not have a no-code UX that competes with the AI chat UX. For example, after generating sample data, the AI could prompt: "How does this look? Any adjustments to the data, or would you like me to create a dashboard from this?" This is a richer experience than a static modal.

The current code calls sourceImportedPath.set(path) in both generateSampleDataWithDevChat and generateSampleDataWithOverlay, which triggers the modal. These calls should be removed. FileAndResourceWatcher will continue to handle the modal for user-initiated imports (drag-drop, Add Data modal).

Minor Issues

3. createResource wrapper in CreateExploreDialog.svelte is redundant

The function just forwards to createResourceAndNavigate. The onClick handler can call createResourceAndNavigate directly.

4. Silent catch block in OnboardingWorkspace.svelte:56-58

} catch {
  // no-op
}

This swallows errors silently. Consider logging to console for debuggability.

5. waitUntil condition may be inverted

In generate-sample-data.ts:161-164 and :215-218:

await waitUntil(
  () => !get(conversation.isStreaming) && !get(conversation.streamError),
  -1,
);

This waits until streaming stops AND there's no error. If streamError becomes truthy, the condition !get(conversation.streamError) is false, so the waitUntil never resolves. Should this be || instead of &&?

6. Feature flag default

developer_chat is set to true in runtime/feature_flags.go. The PR description notes this will be reverted before merge.


Developed in collaboration with Claude Code

@AdityaHegde
Copy link
Collaborator Author

AdityaHegde commented Jan 19, 2026

  1. There is no consensus on requirement to only navigate once right now. But I guess it makes sense to only navigate once. Added a tool navigate
  2. This is by requirement, I added it explicitly after a UXQA feedback.

3,4. Done
5. Conversation always sets isStreaming to false. Removing the check on streamError since it is redundant.

@AdityaHegde AdityaHegde force-pushed the feat/generate-data-to-dev-chat branch from a1f3f72 to bd2ce30 Compare January 19, 2026 06:50
@ericokuma
Copy link
Contributor

ericokuma commented Jan 20, 2026

  1. This is by requirement, I added it explicitly after a UXQA feedback.

if we remove this prompt box, would it be possible to create a CTA object in the chatbox experience? To start we can just replicate the same primary CTA button: "Generate Dashboard" cc @nishantmonu51

Copy link
Contributor

@ericpgreen2 ericpgreen2 left a comment

Choose a reason for hiding this comment

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

Architecture Feedback

1. Remove FileWriteListener class; simplify the dev chat path

The FileWriteListener class introduces infrastructure that will be short-lived—it's only needed for the overlay path, which becomes dead code once the developer_chat flag is lifted.

Recommended approach:

  • Dev chat path: Remove FileWriteListener entirely. The chat is visible, so users see the AI's response directly. The navigate tool handles navigation. No need for created/lastReadFile tracking or post-hoc notifications.
  • Overlay path: Keep the detection logic inline (don't extract it into a class). Mark it clearly as legacy code to remove when the feature flag is lifted.

The dev chat path simplifies to:

async function generateSampleDataWithDevChat(agentPrompt, conversationManager) {
  conversationManager.enterNewConversationMode();
  const conversation = get(conversationManager.getCurrentConversation());
  conversation.cancelStream();

  overlay.set(null);
  sidebarActions.startChat(agentPrompt);
  
  await waitUntil(() => get(conversation.isStreaming));
  await waitUntil(() => !get(conversation.isStreaming), -1);
}

2. Render the navigate tool as a top-level block

Currently renderMode: "hidden" means navigate calls aren't visible. Users should see that navigation occurred—it's a meaningful action.

Rather than creating a dedicated NavigateBlock component, introduce a generic tool-call block type. Consider adding a new ToolCall variant (e.g., variant="standalone") to distinguish from variant="block" which implies rich content below with a collapsible toggle.

3. Remove navigate-specific gating in conversation.ts

The current code special-cases navigate:

if (response.message.tool === ToolName.NAVIGATE && response.message.type === MessageType.CALL) {
  const config = getToolConfig(response.message.tool);
  config?.onResult?.(response.message);
}

This should call onResult for any tool:

if (response.message.type === MessageType.CALL) {
  const config = getToolConfig(response.message.tool);
  config?.onResult?.(response.message);
}

4. Use existing addLeadingSlash utility

maybePrependSlash in file-path-utils.ts duplicates addLeadingSlash from entity-mappers.ts. Use the existing utility.

5. Fix prompt inconsistency

In developer_agent.go:164, the prompt says "Use type 'file'" but the schema field is kind. These should match.

6. Rephrase prompt without caps

"Generate a NEW model..." — capitalizing "NEW" doesn't look clean. Rephrase: "Generate a new model with sample data based on the following user input: ..."


Developed in collaboration with Claude Code

@ericokuma
Copy link
Contributor

ericokuma commented Jan 23, 2026

LGTM except there isn't a clear CTA to a dashboard now.

I would do two things:

  1. After generating sample data, the AI could prompt: "How does this look? Any adjustments to the data, or would you like me to create a dashboard from this?" This is a richer experience than a static modal.
  2. Replace "generate Metrics View with AI" with "Generate Canvas Dashboard" which will kick off the Canvas Generation process with the developer agent (and will generate a metrics view, explore dashboard and canvas dashboard)

cc @nishantmonu51

@AdityaHegde AdityaHegde force-pushed the feat/generate-data-to-dev-chat branch from da63404 to c24f0cf Compare January 27, 2026 06:34
@AdityaHegde AdityaHegde force-pushed the feat/generate-data-to-dev-chat branch from c24f0cf to 910de33 Compare January 27, 2026 11:25
@AdityaHegde
Copy link
Collaborator Author

We will be adding CTAs in #8655 since we will have an aggregation block there.

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.

4 participants