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

Add optional email field for feedback, record feedback in db #1695

Merged
merged 5 commits into from
Oct 3, 2024

Conversation

ob6160
Copy link
Member

@ob6160 ob6160 commented Jul 27, 2024

What does this change?

  • This improves the feedback form, adding an optional email field so we can get in touch with individuals who wish to be contacted back
  • We also record the route so we know which page the user sent the feedback from
  • Some small improvements to accessibility and width on mobile
Screenshot 2024-09-01 at 17 05 26

Copy link

vercel bot commented Jul 27, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
toiletmap ✅ Ready (Inspect) Visit Preview Oct 1, 2024 9:40pm

Copy link

📦 Next.js Bundle Analysis for toiletmap

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 197.28 KB (🟡 +153 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Seven Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (200 KB)
/ 12.19 KB 209.48 KB 104.74% (+/- <0.01%)
/explorer/loos/[id] 16.4 KB 213.69 KB 106.84% (🟡 +0.01%)
/explorer/search 16.83 KB 214.11 KB 107.05% (+/- <0.01%)
/loos/[id] 20.32 KB 217.6 KB 108.80% (+/- <0.01%)
/loos/[id]/edit 45.79 KB 243.07 KB 121.54% (🟢 -0.01%)
/loos/[id]/remove 16.11 KB 213.39 KB 106.70% (+/- <0.01%)
/loos/add 45.27 KB 242.55 KB 121.28% (🟢 -0.02%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 10% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

Copy link

cypress bot commented Jul 31, 2024

GBPTM    Run #1330

Run Properties:  status check passed Passed #1330  •  git commit e9c22e2d77 ℹ️: Merge cdf437d53c08419bee8c81ef9a2e447284aa28a5 into 5152c959bb2fa58757ceed0d0f71...
Project GBPTM
Branch Review refs/pull/1695/merge
Run status status check passed Passed #1330
Run duration 03m 10s
Commit git commit e9c22e2d77 ℹ️: Merge cdf437d53c08419bee8c81ef9a2e447284aa28a5 into 5152c959bb2fa58757ceed0d0f71...
Committer Oliver Barnwell
View all properties for this run ↗︎

Test results
Tests that failed  Failures 0
Tests that were flaky  Flaky 0
Tests that did not run due to a developer annotating a test with .skip  Pending 0
Tests that did not run due to a failure in a mocha hook  Skipped 0
Tests that passed  Passing 63
View all changes introduced in this branch ↗︎

Copy link

📦 Next.js Bundle Analysis for toiletmap

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 197.28 KB (🟡 +277 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Four Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (200 KB)
/explorer/loos/[id] 16.4 KB 213.67 KB 106.84% (🟢 -0.01%)
/explorer/search 16.82 KB 214.1 KB 107.05% (+/- <0.01%)
/loos/[id]/edit 45.79 KB 243.07 KB 121.53% (🟢 -0.01%)
/loos/add 45.27 KB 242.55 KB 121.27% (🟢 -0.01%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 10% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

@ob6160 ob6160 changed the base branch from main to ob/psql-overhaul August 23, 2024 18:08
@ob6160 ob6160 changed the title Add optional name and email fields for feedback Add optional email field for feedback, record feedback in db Sep 1, 2024
Copy link

github-actions bot commented Sep 1, 2024

📦 Next.js Bundle Analysis for toiletmap

This analysis was generated by the Next.js Bundle Analysis action. 🤖

⚠️ Global Bundle Size Increased

Page Size (compressed)
global 197.32 KB (🟡 +323 B)
Details

The global bundle is the javascript bundle that loads alongside every page. It is in its own category because its impact is much higher - an increase to its size means that every page on your website loads slower, and a decrease means every page loads faster.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

If you want further insight into what is behind the changes, give @next/bundle-analyzer a try!

Six Pages Changed Size

The following pages changed size from the code in this PR compared to its base branch:

Page Size (compressed) First Load % of Budget (200 KB)
/explorer/loos/[id] 16.4 KB 213.72 KB 106.86% (+/- <0.01%)
/explorer/search 16.82 KB 214.14 KB 107.07% (+/- <0.01%)
/loos/[id] 20.32 KB 217.64 KB 108.82% (+/- <0.01%)
/loos/[id]/edit 45.76 KB 243.08 KB 121.54% (🟢 -0.02%)
/loos/[id]/remove 16.04 KB 213.36 KB 106.68% (🟢 -0.03%)
/loos/add 45.24 KB 242.56 KB 121.28% (🟢 -0.03%)
Details

Only the gzipped size is provided here based on an expert tip.

First Load is the size of the global bundle plus the bundle for the individual page. If a user were to show up to your website and land on a given page, the first load size represents the amount of javascript that user would need to download. If next/link is used, subsequent page loads would only need to download that page's bundle (the number in the "Size" column), since the global bundle has already been downloaded.

Any third party scripts you have added directly to your app using the <script> tag are not accounted for in this analysis

The "Budget %" column shows what percentage of your performance budget the First Load total takes up. For example, if your budget was 100kb, and a given page's first load size was 10kb, it would be 10% of your budget. You can also see how much this has increased or decreased compared to the base branch of your PR. If this percentage has increased by 10% or more, there will be a red status indicator applied, indicating that special attention should be given to this. If you see "+/- <0.01%" it means that there was a change in bundle size, but it is a trivial enough amount that it can be ignored.

Copy link
Collaborator

@mxdvl mxdvl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

db: the SQL

src/pages/api/feedback/index.page.ts Outdated Show resolved Hide resolved
Copy link
Collaborator

@Hoolean Hoolean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice 💪 Added a few comments on validation and column types (and some bits I am just curious about); nothing blocking though, otherwise looks good to me

schema.prisma Show resolved Hide resolved
schema.prisma Outdated
id Int @id @default(autoincrement())
email String? @db.VarChar(255)
feedback_text String
route String
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any other properties we should stick a limit on too? 🔎

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've limited feedback_text to 5000 chars and route to 255, both seemed reasonable. If someone has more than 5000>chars to write they better write us an email

src/pages/api/feedback/index.page.ts Show resolved Hide resolved
// We'd like to record the full feedback entry in our database for future reference.
await prisma.feedback.create({
data: {
email: email ?? 'No email provided',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we make this column nullable instead?

Copy link
Member Author

@ob6160 ob6160 Oct 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch, this is nullable by default so I didn't really need to have this text fallback. if email is undefined/null this field will be null too. will remove the fallback

@Hoolean
Copy link
Collaborator

Hoolean commented Sep 23, 2024

Whoopsy, I've double-reviewed you - definitely not meant to replace yours Max, just had the page open too long before hitting go 😄

@ob6160
Copy link
Member Author

ob6160 commented Sep 23, 2024

Whoopsy, I've double-reviewed you - definitely not meant to replace yours Max, just had the page open too long before hitting go 😄

thanks for the extra comments, all good points - i'll get back soon 🚗

@ob6160
Copy link
Member Author

ob6160 commented Oct 1, 2024

@Hoolean I've had a look and made some changes based on your feedback :)

Copy link
Collaborator

@Hoolean Hoolean left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All feedback addressed :shipit:

@ob6160 ob6160 merged commit 4a92dcd into main Oct 3, 2024
14 checks passed
@ob6160 ob6160 deleted the ob/feedback-improvements branch October 3, 2024 08:05
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.

3 participants