General feedback #3334
Replies: 11 comments 17 replies
-
There's a use case I have been thinking about for a while, which seems to be far closer within reach now: Having some Sanity-powered forms embedded into a sidebar of a site, shown only when an admin is logged in. Sure, it would go a bit against the pure headless nature of Sanity, but it would make some things much easier when content is shown in its context. While Studio offers preview integration and side-by-side panes for this, I would be interested in showing individual documents without the full Studio UI and Structure navigation. Perhaps there can be some config options to the announced I have seen https://github.com/sanity-io/sanity/blob/next/packages/%40sanity/form-builder/docs/quickstart.md which is deprecated/legacy documentation that shows exactly what I would like to have available. This would be the lowest level approach. A bit more high level to deal with changes (and document creation for example) would certainly be welcome. |
Beta Was this translation helpful? Give feedback.
-
Great work on this release. I had trouble finding much information about integrating into an existing Next.js app. Are there any docs that cover this? |
Beta Was this translation helpful? Give feedback.
-
Typescript suggestion I'm migrating some schemas over to V3 and love the type safety, but am having issues correctly migrating document previews. Here is what I have to do to avoid typescript errors: import { formatRelative } from "date-fns";
import { SchemaTypeDefinition } from "sanity";
function selectTopic(topics: unknown[]) {
const currentTopic = topics[topics.length - 1];
if (currentTopic && typeof currentTopic === "object") {
const title = "title" in currentTopic ? (currentTopic["title"] as string) : undefined;
const category = "category" in currentTopic ? (currentTopic["category"] as string) : undefined;
const twitchCategory = "twitchCategory" in currentTopic ? (currentTopic["twitchCategory"] as string) : undefined;
return [title, category, twitchCategory].filter((x) => !!x).join(" · ");
}
return "No topic";
}
export const LivestreamDocumentSchema: SchemaTypeDefinition = {
title: "Livestream",
name: "livestream",
type: "document",
fields: [
{
title: "Started At",
name: "timeStart",
type: "datetime",
initialValue: () => new Date().toISOString(),
validation: (Rule) => Rule.required(),
},
{
title: "Topics",
name: "topics",
type: "array",
of: [{ type: "streamTopic" }],
initialValue: [],
validation: (Rule) => Rule.min(1),
},
],
preview: {
select: {
topics: "topics",
timeStart: "timeStart",
},
prepare({ topics, timeStart: rawTimeStart }) {
const title = selectTopic(topics as []);
const timeStart = typeof rawTimeStart === "string" || typeof rawTimeStart === "number" ? rawTimeStart || "" : "";
const startAt = formatRelative(new Date(timeStart || ""), new Date());
const subtitle = startAt.toLocaleUpperCase();
return { title, subtitle };
},
},
}; What would make more sense to me is if I could pass a Generic to the prepare function like so: export const LivestreamDocumentSchema: SchemaTypeDefinition = {
// removed for brevity
preview: {
select: {
topics: "topics",
timeStart: "timeStart",
},
prepare<{ topics: [], timeStart:string }>({ topics, timeStart }) {
const currentTopic = topics[topics.length - 1];
const title = [title, category, twitchCategory].filter((x) => !!x).join(" · ");
const startAt = formatRelative(new Date(timeStart || ""), new Date());
const subtitle = startAt.toLocaleUpperCase();
return { title, subtitle };
},
},
}; |
Beta Was this translation helpful? Give feedback.
-
Tiny, tiny Typescript issue: field's type definition don't support interface BaseDefinitionOptions {
// ...
validation?: (rule: Rule) => Rule
PS: should I report these somewhere else? |
Beta Was this translation helpful? Give feedback.
-
I don't know where to post this but I thought I'd let you guys know that with the latest dev build, we get |
Beta Was this translation helpful? Give feedback.
-
What could I be missing here? This is in a Next.js app setup and I can't see the Desk in studio running development mode |
Beta Was this translation helpful? Give feedback.
-
Hey, Nice work on the v3. Il really love the fact that you used Vite, it is going to make the dev experience so much faster! First of all, I do not get why you added an other level of information for slugs: "Current slug". And at least, I hope this is going to be editable :-). French editors do not understand the word "slug", so this might not help their editing experience. Oh and we lost the "generate" button, or I missed it somewhere? Secondly, why is there a level indentation (fieldset line) for single inputs like a block or array (or even the slug input)? I get it when we need to group multiple fields together, for readability. But for single elements, it might be overkill, don't you think? Thank's again for all the work you are doing! |
Beta Was this translation helpful? Give feedback.
-
So, because there are so many hours in a day, let me outsource some thoughts for expanding Sanity's capabilities. Hopefully, a kind-hearted developer who shares these visions will pick up these breadcrumbs and bring these features into existence. 🙏🤞 v3 Studio ideas:
General Sanity platform ideas:
Those are the main things I can think of for now. If I come up with more, I'll let everyone know. Thanks! |
Beta Was this translation helpful? Give feedback.
-
I've been working with V3 for 2.5 weeks now, I'm beyond excited for it! Tons of new architectural patterns and editorial improvements that were impossible before - thank you for the work on this 😄 Here's what I've gathered so far: Feature requests
Bugs & odditiesI imagine you know about most of these and hence why it's a dev preview and not a production-ready version 🙃
Let me know if I should consolidate this elsewhere - glad to help however I can! |
Beta Was this translation helpful? Give feedback.
-
Hi! Testing out the new v3 for the first time, and I'm loving it so far. Here's a few things I'd love for you to consider moving forward: Remove prettier configThe files generated with Sanity's CLI includes a customized Prettier setup. I suggest you skip that, and instead opt in to the default settings of Prettier. There is no reason for why you want to add these hightly subjective preferences to the boilerplate – just let people override them if they want. Stop using yarnNPM is the default tool for handling packages. Why not default to using that? Especially when I run the CLI bootstrapping script in a context of existing package-lock.json files etc – shouldn't it just use what's already there? Make TypeScript the defaultRight now, you have to opt-in of using TypeScript instead of opting out. This is contrary to what i.e. Remix does in their bootstrapping tool. TypeScript has become the defacto standard for developing these days, and changing the default to "yes" would be a step in the right direction Use React 18 by defaultIs there any reason whatsoever to not use React 18 out of the box when things are bootstrapped? –– Otherwise, I'd love a 1-to-1 migration guide for the most common packages. |
Beta Was this translation helpful? Give feedback.
-
I guess this doesn't apply specifically to the v3 Studio, but not sure where else to add this feedback, so giving it a shot... 1. Third-Party AuthenticationWas using the CLI to create a new project, and logged in via GitHub, which I often do in other services. Turned out I accidentally created a new Sanity account, because my my actual account uses email+password. Would be great if you, like so many others, allowed me to add the alternative authentication methods to my existing account, so I can use either one. 2. 2FAI've started using 1Password, and it makes it much easier for me to set up 2FA authentication on services via their built-in OTA-feature. So I've been going through important accounts and enabling it everywhere. Came to Sanity, and seems you don't support any 2FA at all? Can't find anything about it under my Account Settings at least. An account with access to do so much, leak data, potential damage, and so on, it feels like Sanity should definitely have the option of enabling 2FA? |
Beta Was this translation helpful? Give feedback.
-
Any piece of feedback for the Developer Preview of Sanity Studio v3 that doesn't fit in the other threads? Put it here!
Beta Was this translation helpful? Give feedback.
All reactions