Feat/mobile#165
Merged
Merged
Conversation
- Initialize MediaQueryList variables as undefined to prevent potential errors if onUnmounted runs before onMounted - Compute initial isMobile/isSmall/isLandscape values synchronously in setup() to avoid layout flash on first render - Extract media query strings to module-level constants
Avoid copying the entire build context to prevent accidentally including sensitive files (.env, credentials, keys). Copy only the specific source directories and config files needed for each build stage. Resolves SonarCloud security hotspot docker:S6497.
There was a problem hiding this comment.
Pull request overview
This PR improves mobile viewport detection in the Vue composable and optimizes Docker build caching by narrowing Docker build contexts to only the files needed for compilation.
Changes:
- Update
useIsMobileto initialize state frommatchMediaand centralize media query strings as constants. - Optimize frontend Docker build layers by copying only config files plus
src/andpublic/(instead ofCOPY . .). - Optimize backend Docker build layers by copying only
cmd/,internal/, andpkg/(instead ofCOPY . .).
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| frontend/src/composables/useIsMobile.ts | Initializes mobile flags using media queries and de-duplicates query strings. |
| frontend/Dockerfile | Improves Docker layer caching by copying only the files needed to build the SPA. |
| backend/Dockerfile | Improves Docker layer caching by copying only Go source directories needed to build the server. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
- Update backend Dockerfile from golang:1.23 to golang:1.25 to match go.mod requirement (go 1.25.0) - Reuse stored MediaQueryList objects in update() instead of creating new ones via window.matchMedia on every change event
|
koishi510
approved these changes
Mar 14, 2026
4rthurCai
added a commit
that referenced
this pull request
Mar 14, 2026
- Update backend Dockerfile from golang:1.23 to golang:1.25 to match go.mod requirement (go 1.25.0) - Reuse stored MediaQueryList objects in update() instead of creating new ones via window.matchMedia on every change event
koishi510
pushed a commit
that referenced
this pull request
Mar 14, 2026
- Update backend Dockerfile from golang:1.23 to golang:1.25 to match go.mod requirement (go 1.25.0) - Reuse stored MediaQueryList objects in update() instead of creating new ones via window.matchMedia on every change event
4rthurCai
added a commit
that referenced
this pull request
Mar 14, 2026
- Update backend Dockerfile from golang:1.23 to golang:1.25 to match go.mod requirement (go 1.25.0) - Reuse stored MediaQueryList objects in update() instead of creating new ones via window.matchMedia on every change event
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Related Issue
Summary
Change Type
Self-Check Checklist
Backend (Go):
go build ./...passesgo vet ./...passesgofmtproduces no diffFrontend (Vue):
npm run lintpassesnpm run typecheckpassesGeneral:
Test Steps