Skip to content

Conversation

SmilyOrg
Copy link
Owner

@SmilyOrg SmilyOrg commented Jun 21, 2025

This pull request introduces several updates to improve photo navigation and update frontend and e2e dependencies.

Photo Navigation Enhancements:

  • Added predictive range loading and improved caching for faster photo navigation
  • Introduced RegionMinimal schema and related API changes to support optimized bulk fetching with minimal data fields (id and bounds)
  • These changes were required as the Vue update broke some brittle code relying on watch side effects

Development Configuration Updates:

  • Updated development server port from 3000 to 5173 to align with Vite defaults across multiple files (.env.development, [1]; README.md, [2]; docs/development.md, [3] [4]; e2e/playwright.config.ts, [5] [6]; e2e/src/fixtures.ts, [7] [8] [9] [10].

API Enhancements:

  • Added new query parameters (id_range and fields) to the API for efficient sequential region fetching and field selection. (api.yaml, [1] [2]; internal/openapi/api.gen.go, [3] [4]
  • Implemented methods in Scene to handle minimal region responses, including fetching regions by bounds, image ID, and closest point. (internal/render/scene.go, internal/render/scene.goR412-R460)

End-to-End Testing Updates:

  • Improved test configurations and updated dependencies in e2e/package.json. (e2e/package.json, e2e/package.jsonL22-R27)
  • Adjusted Playwright test settings to reflect the updated server port and added new test scenarios for minimal region responses. (e2e/playwright.config.ts, [1] [2]; e2e/src/steps.ts, [3] [4] [5]; e2e/tests/first-run.feature, [6] [7] [8] [9]

These changes collectively enhance the application's performance, developer experience, and testing reliability.

SmilyOrg added 2 commits June 21, 2025 20:48
- Change CORS origins and URLs from port 3000 to 5173 (Vite default)
- Update documentation to reflect new development port
- Upgrade e2e testing dependencies: Playwright, TypeScript, Node types
- Simplify playwright-bdd configuration and improve test steps
- Upgrade UI dependencies for better Vue 3 compatibility
- Add Quill mock for balm-ui compatibility
- Update import paths and module configurations
- upgraded vue from 3.5.13 to 3.5.17
- upgraded eslint from 9.23.0 to 9.29.0
- upgraded rollup-plugin-visualizer from 5.14.0 to 6.0.3
@SmilyOrg SmilyOrg requested a review from Copilot June 21, 2025 19:05
Copilot

This comment was marked as outdated.

@SmilyOrg SmilyOrg requested a review from Copilot June 27, 2025 22:26
Copy link

@Copilot 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 updates the frontend dependencies with significant changes including switching the development UI server port from 3000 to 5173, upgrading libraries such as Playwright and Vue, and adding a Quill mock for compatibility with balm-ui.

  • Updated Vite configuration with a new Quill alias.
  • Refactored several Vue composables to adopt improved reactive patterns and updated dependency usage.
  • Adjusted API, documentation, E2E tests, and environment files to reflect the new server port and dependency versions.

Reviewed Changes

Copilot reviewed 28 out of 30 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ui/vite.config.js Added an alias for Quill pointing to the mock module.
ui/src/use.js Updated reactive logic and navigation functions in composable hooks.
ui/src/mocks/quill.js Added a simple mock to support balm-ui compatibility.
ui/src/main.js Updated import to use the new client entry for @unhead/vue.
UI Components (TileViewer.vue, TagEditor.vue, etc.) Adjusted reactive behavior and event handling to align with dependency updates.
api.js, main.go, internal/render/scene.go Extended API functions for minimal region fetching and range-based queries.
E2E tests and configuration files Updated references to use port 5173 and adjusted test steps accordingly.
Documentation files Updated references to port 5173 throughout.

Comment on lines +127 to +142
const region = computed(() => {
if (!id.value) {
region.value = null;
return;
return null;
}
if (!valid.value) {
region.value = {
return {
id: id.value,
loading: true,
}
return;
};
}
if (isValidating.value) return;
region.value = data.value;
})
if (isValidating.value) {
return {
id: id.value,
loading: true,
};
}
Copy link
Preview

Copilot AI Jun 27, 2025

Choose a reason for hiding this comment

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

[nitpick] The computed property for 'region' now handles various loading and validation states. Please consider adding inline comments to clarify the logic transitions (e.g. handling of invalid, loading, and validated states) for future maintainability.

Copilot uses AI. Check for mistakes.

Comment on lines +962 to +977
return []render.Region{}
}

// Parse range in format "start:end"
parts := strings.Split(rangeStr, ":")
if len(parts) != 2 {
return []render.Region{}
}

startId, err1 := strconv.Atoi(strings.TrimSpace(parts[0]))
endId, err2 := strconv.Atoi(strings.TrimSpace(parts[1]))

if err1 != nil || err2 != nil || startId > endId {
return []render.Region{}
}

Copy link
Preview

Copilot AI Jun 27, 2025

Choose a reason for hiding this comment

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

When parsing the id_range parameter, the code currently returns an empty array for malformed inputs. It may be useful to log an error or include additional validation feedback to aid future debugging.

Suggested change
return []render.Region{}
}
// Parse range in format "start:end"
parts := strings.Split(rangeStr, ":")
if len(parts) != 2 {
return []render.Region{}
}
startId, err1 := strconv.Atoi(strings.TrimSpace(parts[0]))
endId, err2 := strconv.Atoi(strings.TrimSpace(parts[1]))
if err1 != nil || err2 != nil || startId > endId {
return []render.Region{}
}
log.Println("handleRegionsByRange: rangeStr is empty")
return []render.Region{}
}
// Parse range in format "start:end"
parts := strings.Split(rangeStr, ":")
if len(parts) != 2 {
log.Printf("handleRegionsByRange: malformed rangeStr '%s', expected format 'start:end'\n", rangeStr)
return []render.Region{}
}
startId, err1 := strconv.Atoi(strings.TrimSpace(parts[0]))
endId, err2 := strconv.Atoi(strings.TrimSpace(parts[1]))
if err1 != nil || err2 != nil {
log.Printf("handleRegionsByRange: invalid startId or endId in rangeStr '%s' (startId error: %v, endId error: %v)\n", rangeStr, err1, err2)
return []render.Region{}
}
if startId > endId {
log.Printf("handleRegionsByRange: startId (%d) is greater than endId (%d) in rangeStr '%s'\n", startId, endId, rangeStr)
return []render.Region{}
}

Copilot uses AI. Check for mistakes.

@SmilyOrg SmilyOrg changed the title Update frontend dependencies Update frontend dependencies & faster navigation Jun 27, 2025
@SmilyOrg SmilyOrg merged commit e009aa8 into main Jun 27, 2025
1 check passed
@SmilyOrg SmilyOrg deleted the update-frontend-deps branch June 27, 2025 23:19
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.

1 participant