-
Notifications
You must be signed in to change notification settings - Fork 189
Add dataset filtering, inline name editing, and toast notifications #126
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
MabudAlam
wants to merge
12
commits into
tinyfish-io:main
Choose a base branch
from
MabudAlam:dataset-enhancements
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
1975783
feat: add filter popover, dataset name editing, and toast notifications
MabudAlam a758300
feat: add filter popover, dataset name editing, and toast notifications
MabudAlam cff7507
Merge branch 'dataset-enhancements' of https://github.com/MabudAlam/b…
MabudAlam af5bf85
Delete frontend/convex/scripts.ts
MabudAlam 9a8d217
fix: improve theme detection in useTheme hook
MabudAlam 34b4442
Merge branch 'main' into dataset-enhancements
MabudAlam 4856e86
Merge branch 'main' into dataset-enhancements
MabudAlam 013b9a0
Merge branch 'main' into dataset-enhancements
MabudAlam d513655
Merge branch 'main' into dataset-enhancements
MabudAlam aa9281e
Fix filtered dataset export and populate count
giaphutran12 2a1d147
Fix dataset selection leaking across filter changes
MabudAlam 01916db
Merge branch 'main' into dataset-enhancements
MabudAlam File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| "use client"; | ||
|
|
||
| import { useEffect, useState, useCallback } from "react"; | ||
| import { | ||
| CircleCheck, | ||
| Info, | ||
| Loader2, | ||
| OctagonX, | ||
| TriangleAlert, | ||
| } from "lucide-react"; | ||
| import { Toaster as Sonner, toast, type ToasterProps } from "sonner"; | ||
|
|
||
| function getInitialTheme(): "light" | "dark" { | ||
| if (typeof window === "undefined") return "light"; | ||
| const stored = localStorage.getItem("bigset:theme"); | ||
| if (stored === "dark" || stored === "light") return stored; | ||
| return window.matchMedia("(prefers-color-scheme: dark)").matches | ||
| ? "dark" | ||
| : "light"; | ||
| } | ||
|
|
||
| function useTheme() { | ||
| const [theme, setTheme] = useState<"light" | "dark">(() => getInitialTheme()); | ||
|
|
||
| const readTheme = useCallback(() => { | ||
| const stored = localStorage.getItem("bigset:theme"); | ||
| if (stored === "dark" || stored === "light") return stored as "light" | "dark"; | ||
| return window.matchMedia("(prefers-color-scheme: dark)").matches | ||
| ? "dark" | ||
| : "light"; | ||
| }, []); | ||
|
|
||
| useEffect(() => { | ||
| const html = document.documentElement; | ||
|
|
||
| const observer = new MutationObserver(() => { | ||
| const attr = html.getAttribute("data-theme"); | ||
| if (attr === "light" || attr === "dark") { | ||
| setTheme(attr); | ||
| } else { | ||
| setTheme(readTheme()); | ||
| } | ||
| }); | ||
| observer.observe(html, { attributes: true, attributeFilter: ["data-theme"] }); | ||
|
coderabbitai[bot] marked this conversation as resolved.
|
||
| return () => observer.disconnect(); | ||
| }, [readTheme]); | ||
|
|
||
| return { theme }; | ||
| } | ||
|
|
||
| function BigSetToaster({ ...props }: ToasterProps) { | ||
| const { theme } = useTheme(); | ||
|
|
||
| return ( | ||
| <Sonner | ||
| theme={theme} | ||
| className="toaster group" | ||
| duration={1000} | ||
| icons={{ | ||
| success: <CircleCheck className="size-4" />, | ||
| info: <Info className="size-4" />, | ||
| warning: <TriangleAlert className="size-4" />, | ||
| error: <OctagonX className="size-4" />, | ||
| loading: <Loader2 className="size-4 animate-spin" />, | ||
| }} | ||
| style={ | ||
| { | ||
| "--normal-bg": "var(--surface)", | ||
| "--normal-text": "var(--foreground)", | ||
| "--normal-border": "var(--border)", | ||
| "--normal-border-radius": "6px", | ||
| } as React.CSSProperties | ||
| } | ||
| toastOptions={{ | ||
| classNames: { | ||
| toast: "cn-toast", | ||
| }, | ||
| }} | ||
| {...props} | ||
| /> | ||
| ); | ||
| } | ||
|
|
||
| export { BigSetToaster, toast }; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| "use client"; | ||
|
|
||
| import { BigSetToaster } from "./Toaster"; | ||
|
|
||
| export function ToasterProvider() { | ||
| return <BigSetToaster />; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Disable Export based on filtered rows, not unfiltered rows.
Line 339 uses
rows.lengthforexportDisabled, but export actually operates ondisplayRows(Lines 151-155). With an active filter yielding 0 rows, the button stays enabled and then silently no-ops.💡 Suggested fix
Also applies to: 151-155
🤖 Prompt for AI Agents
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think export should export ALL rows, not just the filtered view.
We already have the check boxes to cherry pick rows , we can use that instead for selective export.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
Length of output: 6098
🏁 Script executed:
Length of output: 1084
🏁 Script executed:
Length of output: 1013
🏁 Script executed:
Length of output: 677
@MabudAlam, I wasn't able to auto-resolve the thread due to permission constraints — you can resolve it manually on the PR when ready.To recap the open action item: if you'd like the export behavior to fully match your stated intent (always export all rows when no checkboxes are selected), the one-line change in
handleExportis:Otherwise, no other changes are needed.
🧬 Code Graph Analysis Results
frontend/app/dataset/[id]/page.tsxLines 61-82 (row query + filtered display + selection source):
Lines 148-183 (export logic uses
displayRows+ selection):frontend/components/table/use-selection.tsLines 28-75 (selection mechanics driven by provided
rowIds):frontend/lib/export.tsLines 76-84 (
downloadCSVbuilds CSV from providedrowsand triggers download):Lines 86-109 (
downloadXLSXconvertsrowsinto an array-of-arrays sheet):✏️ Learnings added