Add CSV download option to table 3-dot menu#207
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
💡 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".
| const dropdown = this.$refs.dropdown; | ||
| if (dropdown && typeof dropdown.contains === 'function' && !dropdown.contains(event.target)) { |
There was a problem hiding this comment.
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 👍 / 👎.
There was a problem hiding this comment.
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-tableand a “Download as CSV” action. - Implemented client-side CSV generation + download (Blob + object URL) and outside-click dropdown dismissal.
- Updated
local.jsto 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.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Motivation
Description
dashboard-tablecomponent UI and aDownload as CSVmenu item infrontend/src/dashboard-result/dashboard-table/dashboard-table.html.showDropdown,toggleDropdown, andhandleBodyClickinfrontend/src/dashboard-result/dashboard-table/dashboard-table.js.escapeCsvCellanddownloadCsv, which handles CSV-safe escaping of quotes, object cell rendering viadisplayValue, and triggers a browser download usingBlob/URL.createObjectURLwith a success toast.mounted/unmounted) to manage the outside-click handler and add a/* global Blob, URL, document */annotation for linting.Testing
npm run lintand it completed successfully.Codex Task