Skip to content

Add 'Display Name' to questions#159

Open
andrewlee1089 wants to merge 1 commit into
taibeled:masterfrom
andrewlee1089:andrewlee/add-display-name
Open

Add 'Display Name' to questions#159
andrewlee1089 wants to merge 1 commit into
taibeled:masterfrom
andrewlee1089:andrewlee/add-display-name

Conversation

@andrewlee1089

Copy link
Copy Markdown

Hi @taibeled !

Love the app - I used it in London for a two day game last weekend and it worked a treat!

I'm just dipping my toes in with a simple PR - I am no frontend developer!

I've added the ability to give custom names to questions for ease of navigation
I've also given the questions better default names, as opposed to e.g. "Radius 1" etc.

image image

I found that when using the website I had multiple e.g., "Matching 1" and "Matching 2" and could not remember what they were. This gives a more useful default name (which dynamically updates when the parameters change), and can be overwritten by the user if they so wish.

One issue I still have is that I am using the data.type for the matching question which gives names such as "Measuring: closer to zoo-full" over "measuring: closer to zoo", which is not as nice. If I have more time i will add a human readable field to all the data types.

Let me know what you think!

Andrew

@taibeled

Copy link
Copy Markdown
Owner

Thanks for the pull request! For the human-readable aspect of this, I believe that the description of each field with Zod is the human-readable name. You should be able to look at the code from matching/measuring cards and use that to find the human-readable names. Also, I think the UI would look better if the display name innut was integrated into the text, as not to add more space. Let me know what you think of these.

@andrewlee1089

Copy link
Copy Markdown
Author

Hi!

The descriptions are currently strings like "Cinema Question (Small+Medium Games)" which are still a little bit too verbose in my opinion.

I'm thinking we should import zod v4 (as simple as import { z } from "zod/v4";) which introduces the ability to add arbitary metadata to each zod element (https://zod.dev/metadata#meta) so we could have description e.g. "Cinema Question (Small+Medium Games)" and a title (e.g. "Cinema"):

            z
                .literal("airport")
                .meta({
                    title: "Airport",
                    description: "Commercial Airport In Zone Question",
                }),

I'm busy this week but should have time over the weekend to implement this

@taibeled

Copy link
Copy Markdown
Owner

Ah, I wish Zod 4 was released like three months earlier. That would have made it much easier. I have some future plans for drastically changing the entire system, but I am busy now so that may take weeks or months to complete. In the mean time, a full transition to Zod 4 may not be necessary, but if you have some free time feel free to implement it. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants