Skip to content

UI improvements, bug fix -- seed run on duckdb#36

Open
Deepak-Gnanasekar wants to merge 7 commits intomainfrom
hover-text-copy
Open

UI improvements, bug fix -- seed run on duckdb#36
Deepak-Gnanasekar wants to merge 7 commits intomainfrom
hover-text-copy

Conversation

@Deepak-Gnanasekar
Copy link
Copy Markdown
Contributor

What

  • Added hover-to-copy functionality on no-code model table cells via new CopyableCell widget
  • Fixed DuckDB seed execution to surface clear error messages instead of cryptic NoneType AttributeError
  • Removed unused Custom Data section from Environment page

Why

  • Table cell data in the no-code model preview was not easily copyable — users had to manually select and copy text
  • DuckDB seed failures (e.g., reserved keyword table names like pivot.csv) raised 'NoneType' object has no attribute 'insert_csv_records' with no meaningful
    feedback to the user
  • Custom Data in Environment was stored in DB but never consumed during execution — dead UI that could confuse users

How

  • Created frontend/src/widgets/copyable-cell/ — a reusable component that shows a copy icon on hover and copies cell content to clipboard. Integrated into the
    no-code model table column renderer replacing raw <span> elements
  • Wrapped DuckDB DuckDbSeed.execute() with a null guard on db_connection and a try/except that raises SeedFailureException with the table name in the error
    message
  • Removed EnvCustomDataSection rendering, all customData state/handlers, fetchProjectByConnection, and related imports from NewEnv.jsx

Can this PR break any existing features. If yes, please list possible items. If no, please explain why.

  • CopyableCell: Additive change — wraps existing table cell content with hover-copy behavior, no change to data rendering logic
  • DuckDB seed fix: Only changes exception handling within the existing catch flow — errors now surface as SeedFailureException instead of raw AttributeError
  • Custom Data removal: Frontend-only change. Backend still accepts custom_data in API payloads and stores it (no migration needed), so no backward
    compatibility issue

Database Migrations

  • None

Env Config

  • None

Relevant Docs

  • N/A

Related Issues or PRs

  • N/A

Dependencies Versions

  • None

Notes on Testing

  • Hover over table cells in no-code model preview — copy icon should appear, clicking copies the value
  • Create a DuckDB project, upload a CSV with a reserved keyword name (e.g., pivot.csv), run seed — should show a descriptive error notification
  • Open Environment create/edit modal — confirm Custom Data section is no longer visible
  • Verify existing environment create/update flows still work without issues

Screenshots

Screenshot from 2026-04-02 16-58-06 Screenshot from 2026-04-02 16-57-19

Checklist

I have read and understood the Contribution Guidelines.

@Deepak-Gnanasekar Deepak-Gnanasekar self-assigned this Apr 2, 2026
@Deepak-Gnanasekar Deepak-Gnanasekar added bug Something isn't working enhancement New feature or request labels Apr 2, 2026
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Apr 2, 2026

Greptile Summary

This PR bundles three focused improvements: a new CopyableCell widget for hover-to-copy in the no-code model table, a DuckDB seed error-surfacing fix, and removal of the dead EnvCustomDataSection from the Environment form.

  • CopyableCell (widgets/copyable-cell/): well-structured Ant Design Tooltip-based component with proper timeout cleanup, silent clipboard failure handling, and 500-char truncation for large values. Both the value prop and children now correctly use formattedValue (formatted number, stringified boolean, etc.), addressing the display/copy mismatch from a prior review thread.
  • DuckDB seed fix (seed.py): adds a null-guard on db_connection and wraps insert_csv_records in a try/except that either re-raises an existing SeedFailureException unchanged or converts any other exception into a user-friendly SeedFailureException with the table name — clean pattern with no over-catching.
  • no-code-model.jsx: the cell renderer now correctly passes isWindowColumn as the third argument to formCol (previously omitted), which was a latent bug preventing window-column styling from applying to cell content rows. setIsLoading(false) is also correctly added to the .catch() path.
  • NewEnv.jsx: all customData state, handlers, fetchProjectByConnection, and EnvCustomDataSection are removed in a clean sweep. The backend API still accepts custom_data, so no migration or backward-compatibility concern.
  • notification-service.js: fixes an empty notification title for markdown-formatted errors by replacing "" with "Failed".

Confidence Score: 5/5

  • Safe to merge — all three changes are additive fixes with no breaking surface area.
  • No P0 or P1 issues found. The DuckDB fix follows a correct re-raise pattern, the CopyableCell correctly passes formattedValue for both display and clipboard (addressing the prior review thread), the formCol window-column bug fix is correct, and the dead-code removal is complete. All changes are low-risk and well-scoped.
  • No files require special attention.

Important Files Changed

Filename Overview
backend/visitran/adapters/duckdb/seed.py Adds null-guard on db_connection and wraps insert_csv_records in a try/except that re-raises SeedFailureException passthrough or converts any other exception into a descriptive SeedFailureException — clean, correct fix.
frontend/src/widgets/copyable-cell/index.js New CopyableCell widget using Ant Design Tooltip with clipboard copy on icon click and double-click; handles empty/null values, truncates tooltip at 500 chars, and cleans up timeout on unmount.
frontend/src/widgets/copyable-cell/copyable-cell.css New CSS for copyable cell — correct overflow handling and tooltip layout styles.
frontend/src/ide/editor/no-code-model/no-code-model.jsx Replaces raw <span> cell renderer with CopyableCell, extracts formattedValue/alignClass variables, fixes formCol call to include the previously-missing isWindowColumn arg, and adds setIsLoading(false) in the catch block.
frontend/src/base/components/environment/NewEnv.jsx Removes customData state, EnvCustomDataSection, fetchProjectByConnection, getProjectDependency, and related handlers — clean dead-code removal with no functional regressions.
frontend/src/service/notification-service.js Fixes empty notification title for markdown error messages by changing "" to "Failed" — small but correct bug fix.

Flowchart

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[DuckDbSeed.execute called] --> B{db_connection is None?}
    B -- Yes --> C[raise SeedFailureException\n'connection not available']
    B -- No --> D[insert_csv_records]
    D --> E{Exception raised?}
    E -- No --> F[Success]
    E -- SeedFailureException --> G[re-raise as-is]
    E -- Other Exception --> H[wrap in SeedFailureException\n with table name + err message]
    G --> I[Caller shows error notification]
    H --> I
Loading

Reviews (2): Last reviewed commit: "addressing greptile cmt" | Re-trigger Greptile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant