Skip to content

Add CSV download option to table 3-dot menu#207

Merged
vkarpov15 merged 5 commits intomainfrom
codex/add-csv-download-option-for-table
Apr 6, 2026
Merged

Add CSV download option to table 3-dot menu#207
vkarpov15 merged 5 commits intomainfrom
codex/add-csv-download-option-for-table

Conversation

@vkarpov15
Copy link
Copy Markdown
Member

Motivation

  • Provide an easy way for users to export table outputs as CSV from both chat script outputs and dashboard views by adding a contextual actions menu to table renders.

Description

  • Add a 3-dot actions menu to the dashboard-table component UI and a Download as CSV menu item in frontend/src/dashboard-result/dashboard-table/dashboard-table.html.
  • Implement dropdown state and outside-click dismissal with showDropdown, toggleDropdown, and handleBodyClick in frontend/src/dashboard-result/dashboard-table/dashboard-table.js.
  • Add CSV generation and download logic via escapeCsvCell and downloadCsv, which handles CSV-safe escaping of quotes, object cell rendering via displayValue, and triggers a browser download using Blob/URL.createObjectURL with a success toast.
  • Wire up lifecycle hooks (mounted/unmounted) to manage the outside-click handler and add a /* global Blob, URL, document */ annotation for linting.

Testing

  • Ran npm run lint and it completed successfully.

Codex Task

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 4, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
studio Ready Ready Preview, Comment Apr 6, 2026 7:32pm

@vkarpov15 vkarpov15 marked this pull request as ready for review April 6, 2026 16:01
Copilot AI review requested due to automatic review settings April 6, 2026 16:01
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 71152038f2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +33 to +34
const dropdown = this.$refs.dropdown;
if (dropdown && typeof dropdown.contains === 'function' && !dropdown.contains(event.target)) {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P2 Badge Handle array ref when dismissing table actions menu

Because ref="dropdown" is declared inside a v-for in the table header template, Vue 3 exposes this.$refs.dropdown as an array; in that case dropdown.contains is undefined and the outside-click branch never runs. As a result, opening the 3-dot menu and clicking elsewhere leaves the dropdown stuck open unless the user clicks the trigger again.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds a contextual 3-dot actions menu to rendered dashboard tables so users can download the table output as a CSV, and updates local dev config to include a Gemini API key option.

Changes:

  • Added a dropdown actions menu to dashboard-table and a “Download as CSV” action.
  • Implemented client-side CSV generation + download (Blob + object URL) and outside-click dropdown dismissal.
  • Updated local.js to pass through a Google Gemini API key env var.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
local.js Adds googleGeminiAPIKey to local dev options (env var wiring).
frontend/src/dashboard-result/dashboard-table/dashboard-table.js Adds dropdown state/handlers and CSV export/download logic.
frontend/src/dashboard-result/dashboard-table/dashboard-table.html Adds the 3-dot menu UI and “Download as CSV” action button.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread local.js
Comment thread frontend/src/dashboard-result/dashboard-table/dashboard-table.js Outdated
Comment thread frontend/src/dashboard-result/dashboard-table/dashboard-table.js Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@vkarpov15 vkarpov15 merged commit c5971a3 into main Apr 6, 2026
30 checks passed
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.

2 participants