Skip to content

Feat/mobile#165

Merged
4rthurCai merged 4 commits into
devfrom
feat/mobile
Mar 14, 2026
Merged

Feat/mobile#165
4rthurCai merged 4 commits into
devfrom
feat/mobile

Conversation

@4rthurCai
Copy link
Copy Markdown
Collaborator

Related Issue

Summary

Change Type

  • New Feature (feat)
  • Bug Fix (fix)
  • Refactoring (refactor)
  • Documentation (docs)
  • Dependency / Configuration (chore)

Self-Check Checklist

Backend (Go):

  • go build ./... passes
  • go vet ./... passes
  • gofmt produces no diff

Frontend (Vue):

  • npm run lint passes
  • npm run typecheck passes

General:

  • Removed all temporary debug output
  • No sensitive data in the code

Test Steps

  1. Pull branch and install dependencies:
    cd backend && go mod download
    cd ../frontend && npm install
  2. Start the application:
    make dev-backend    # Terminal 1
    make dev-frontend   # Terminal 2
  3. Verification steps:
    • ...

- 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.
@4rthurCai 4rthurCai requested a review from koishi510 as a code owner March 14, 2026 16:53
Copilot AI review requested due to automatic review settings March 14, 2026 16:53
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 useIsMobile to initialize state from matchMedia and centralize media query strings as constants.
  • Optimize frontend Docker build layers by copying only config files plus src/ and public/ (instead of COPY . .).
  • Optimize backend Docker build layers by copying only cmd/, internal/, and pkg/ (instead of COPY . .).

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.

Comment thread backend/Dockerfile Outdated
Comment thread frontend/src/composables/useIsMobile.ts Outdated
- 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
@sonarqubecloud
Copy link
Copy Markdown

@4rthurCai 4rthurCai merged commit 4964bff into dev Mar 14, 2026
11 checks passed
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
@4rthurCai 4rthurCai deleted the feat/mobile branch March 14, 2026 17:16
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
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