WIP: Searchable menus #798

Draft
laasyaaki wants to merge 5 commits from searchable_menus into staging
laasyaaki commented 2026-03-23 02:35:41 +00:00 (Migrated from github.com)
Added menus. Backend @ https://github.com/ScottyLabs/dining-api/pull/251
vercel[bot] commented 2026-03-23 02:35:47 +00:00 (Migrated from github.com)

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
cmueats Ready Ready Preview Apr 7, 2026 3:05am

Request Review

[vc]: #oWPez0fLMRkw+U9wN5JzlrY77YZ+IZLUMI0/6o6bqIE=:eyJpc01vbm9yZXBvIjp0cnVlLCJ0eXBlIjoiZ2l0aHViIiwicHJvamVjdHMiOlt7Im5hbWUiOiJjbXVlYXRzIiwicHJvamVjdElkIjoicHJqX1Q5WTRDWmRlMkdtOVFYd2FKWmtNWnZmQWFlMXQiLCJ2MCI6ZmFsc2UsImluc3BlY3RvclVybCI6Imh0dHBzOi8vdmVyY2VsLmNvbS9zY290dHlsYWJzL2NtdWVhdHMvMmR5UFBZd1ZwWEdLZDg4ZnM4YUpVcjhLUlN6MSIsInByZXZpZXdVcmwiOiJjbXVlYXRzLWdpdC1zZWFyY2hhYmxlbWVudXMtc2NvdHR5bGFicy52ZXJjZWwuYXBwIiwibmV4dENvbW1pdFN0YXR1cyI6IkRFUExPWUVEIiwicm9vdERpcmVjdG9yeSI6bnVsbH1dLCJyZXF1ZXN0UmV2aWV3VXJsIjoiaHR0cHM6Ly92ZXJjZWwuY29tL3ZlcmNlbC1hZ2VudC9yZXF1ZXN0LXJldmlldz9vd25lcj1TY290dHlMYWJzJnJlcG89Y211ZWF0cyZwcj03OTgifQ== The latest updates on your projects. Learn more about [Vercel for GitHub](https://vercel.link/github-learn-more). | Project | Deployment | Actions | Updated (UTC) | | :--- | :----- | :------ | :------ | | [cmueats](https://vercel.com/scottylabs/cmueats) | ![Ready](https://vercel.com/static/status/ready.svg) [Ready](https://vercel.com/scottylabs/cmueats/2dyPPYwVpXGKd88fs8aJUr8KRSz1) | [Preview](https://cmueats-git-searchablemenus-scottylabs.vercel.app) | Apr 7, 2026 3:05am | <a href="https://vercel.com/vercel-agent/request-review?owner=ScottyLabs&repo=cmueats&pr=798" rel="noreferrer"><picture><source media="(prefers-color-scheme: dark)" srcset="https://agents-vade-review.vercel.sh/request-review-dark.svg"><source media="(prefers-color-scheme: light)" srcset="https://agents-vade-review.vercel.sh/request-review-light.svg"><img src="https://agents-vade-review.vercel.sh/request-review-light.svg" alt="Request Review"></picture></a>
laasyaaki commented 2026-03-23 02:38:15 +00:00 (Migrated from github.com)

Going to add clicking on image to expand

Going to add clicking on image to expand
sentry[bot] (Migrated from github.com) reviewed 2026-03-23 02:39:07 +00:00
@ -65,11 +65,23 @@ function DrawerTabContent() {
}
sentry[bot] (Migrated from github.com) commented 2026-03-23 02:39:07 +00:00

Bug: The image lookup logic relies on matching filenames, which will likely fail in production builds where asset filenames are hashed by Vite, preventing images from being displayed.
Severity: HIGH

Suggested Fix

To ensure a reliable lookup, avoid relying on the final filename. Instead, use the original module path keys provided by import.meta.glob directly. The API should provide a path segment that can be used to uniquely identify the image within the src/assets/images/menu_items directory, which can then be used to find the correct key in the imageModules map without splitting the path.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent.
Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not
valid.

Location: src/components/DrawerTabContent.tsx#L76-L84

Potential issue: The component dynamically loads menu images using `import.meta.glob`.
It then finds the correct image by matching a filename from an API response against the
local file path. This logic, which uses `key.split('/').pop()`, assumes the filename in
the production build will match the filename from the API. However, Vite's default
production build process hashes asset filenames (e.g., `image.png` becomes
`image-a1b2c3d4.png`). This will cause the lookup to fail, as the API will provide the
original, unhashed filename, resulting in no menu images being displayed in the
production environment.

Did we get this right? 👍 / 👎 to inform future reviews.

**Bug:** The image lookup logic relies on matching filenames, which will likely fail in production builds where asset filenames are hashed by Vite, preventing images from being displayed. <sub>Severity: HIGH</sub> <!-- BUG_PREDICTION --> <details> <summary><b title="Reference ID: `12164829/0`">Suggested Fix</b></summary> To ensure a reliable lookup, avoid relying on the final filename. Instead, use the original module path keys provided by `import.meta.glob` directly. The API should provide a path segment that can be used to uniquely identify the image within the `src/assets/images/menu_items` directory, which can then be used to find the correct key in the `imageModules` map without splitting the path. </details> <details open> <summary><b title="Reference ID: `12164829/0`">Prompt for AI Agent</b></summary> ``` Review the code at the location below. A potential bug has been identified by an AI agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's not valid. Location: src/components/DrawerTabContent.tsx#L76-L84 Potential issue: The component dynamically loads menu images using `import.meta.glob`. It then finds the correct image by matching a filename from an API response against the local file path. This logic, which uses `key.split('/').pop()`, assumes the filename in the production build will match the filename from the API. However, Vite's default production build process hashes asset filenames (e.g., `image.png` becomes `image-a1b2c3d4.png`). This will cause the lookup to fail, as the API will provide the original, unhashed filename, resulting in no menu images being displayed in the production environment. ``` </details> <sub><i>Did we get this right? :+1: / :-1: to inform future reviews.</i></sub> <!-- <sub>Reference ID: `12164829`</sub>-->
Arom1a commented 2026-03-23 03:57:07 +00:00 (Migrated from github.com)

Why do we need the images in the repo? I think we should put them in the database

Why do we need the images in the repo? I think we should put them in the database
cirex-web commented 2026-03-23 23:58:17 +00:00 (Migrated from github.com)

railway bucket store might be a good choice? and then we can just store the urls in the database

railway bucket store might be a good choice? and then we can just store the urls in the database
This pull request has changes conflicting with the target branch.
  • src/App.tsx
  • src/util/useFilteredLocations.ts
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin searchable_menus:searchable_menus
git switch searchable_menus

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch staging
git merge --no-ff searchable_menus
git switch searchable_menus
git rebase staging
git switch staging
git merge --ff-only searchable_menus
git switch searchable_menus
git rebase staging
git switch staging
git merge --no-ff searchable_menus
git switch staging
git merge --squash searchable_menus
git switch staging
git merge --ff-only searchable_menus
git switch staging
git merge searchable_menus
git push origin staging
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
ScottyLabs/eats!798
No description provided.