Skip to content
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

feat: Add an option Share Readonly, Allow Duplicate (for content creators / marketing) #2252

Open
2 tasks
davidkircos opened this issue Jan 30, 2025 · 5 comments · May be fixed by #2281
Open
2 tasks

feat: Add an option Share Readonly, Allow Duplicate (for content creators / marketing) #2252

davidkircos opened this issue Jan 30, 2025 · 5 comments · May be fixed by #2281
Labels
type: enhancement new feature or request

Comments

@davidkircos
Copy link
Collaborator

davidkircos commented Jan 30, 2025

Scope:

  • Add a checkbox to the share dialog for allow duplicate for public share link (or we just make this the default?) Needs scope @jimniels
  • Add ui for logged out users and logged in users to duplicate a readonly file easily in this bar. I'm thinking for anmoyous users we have two buttons "Duplicate" which redirects to signup?next=duplicate_file and "Login / Signup"

Image

@cole-at-quadratic
Copy link

Also need to add "Duplicate" option under File menu in nav - this wasn't available for me within https://app.quadratichq.com/file/963b34fa-bee9-4e72-95f3-2386351ef28e

@jimniels
Copy link
Collaborator

Last we discussed, where we landed was:

If you can access a file, you can duplicate it. So even if a file is in a team you don't belong to but it's been shared with you (via an invite or a link), then a "Duplicate" option will be available in the UI (both under "File -> Duplicate", command palette, and the widget described above in the PR description)

The big question was what happens to connections in shared files (if there are any)? We decided that they just won't work. You'll be able to see the data from the connection, but when you open the code editor you can't re-run it (and you can't see the schema, etc).

I believe most of this should just work given our current permissions setup, but it's just a matter of diving in and starting to build it and seeing if everything works as expected.

@luke-quadratic luke-quadratic added type: enhancement new feature or request high priority within weeks labels Jan 31, 2025
@luke-quadratic luke-quadratic removed the high priority within weeks label Feb 10, 2025
@ddimaria
Copy link
Collaborator

@jimniels I think the connection would just fail. We don't store secrets in the file, so no security implications. Currently, a user can download a readonly file and import, so duplicate just makes this simpler with the same set of possible issues.

@jimniels
Copy link
Collaborator

Noting my thoughts down as I explore this:

Supporting this in the UI is really simple. Change a permission, add a button, and it's basically done (you'd see a UI like this).

Image

The problem is that the API doesn't have a notion of "duplicating" a file. Right now "duplicating" a file is done on the client, so the client has to do steps like:

  • fetch the file
  • get the latest checkpoint for that file
  • get the contents of that latest checkpoint
  • create a new file on the server with its contents as what you just retrieved

And we don't have a bullet-proof method on the client for determining (from the spreadsheet-side of the app) what the user's current team is. We might have it in localstorage. We probably will, most of the time, but it's possible we don't.

And we don't represent on the spreadsheet side of the app which teams you have access to. So when you say "Duplicate", what you mean is "Duplicate it to the team I'm currently in". Because if you have access to more than one team, how do you know where you're duplicating it to? Team A or Team B? There's no UI-facing notion of which team you're "in" from the spreadsheet.

So we could just guess and assume that most of the time it's gonna duplicate to the right spot. But for users with more than one team, it might duplicate to the wrong team.

Also: if you've never created an account, there's an edge case here too where maybe you came to the app because of a shared file, created an account, then went back to the shared file and we haven't yet determined a "team" for you (I'm not sure of the details here...) Probably the best way to do this is check for the presence of the "activeTeam" in local storage and, if it's present, show a "duplicate" button. If we don't have that, just don't show the button (will probably rarely happen, but covers the edge cases)

@jimniels
Copy link
Collaborator

Almost wondering if, perhaps, this notion of an "active team" should make its way into both the app and the dashboard. So when you go upper left in the sheet-side of the app, you would see the "team logo" implying that "Back to dashboard" means "Back to dashboard of Team B"

Image

And then we'd have to figured out how to best represent the brand (if at all) in this experience.

@jimniels jimniels linked a pull request Feb 14, 2025 that will close this issue
14 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement new feature or request
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

5 participants