Image editor - #11
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds an authenticated “image detail + editor (watermark)” flow to the web client and introduces backend support for image lineage via an image_parent_table DAG, including a new GraphQL mutation to apply watermarks and new queries/fields to fetch individual images with edit history.
Changes:
- Web client: adds image detail and watermark editor pages under
/profile/images/:imageIdand/profile/images/:imageId/edit, updates image gallery items to link to details, and auto-navigates to details after single-image upload for authenticated users. - Backend: introduces image relationship DAG storage (
image_parent_table), GraphQL fields (parent,changes,lineage) andapplyWatermarkmutation, plus dataloaders and expanded image repository methods. - UI/i18n: expands image item menu options (details/edit), adds “revision” badge, and adds new localization strings.
Reviewed changes
Copilot reviewed 44 out of 52 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| web_client/src/uploader/uploader.tsx | Captures uploaded image ID and redirects authenticated single uploads to the image detail route. |
| web_client/src/site-admin/pages/users/UserImageGallery.tsx | Switches admin galleries to ADMIN_MENU_CONFIG. |
| web_client/src/site-admin/pages/images/listImages.tsx | Switches admin image list to ADMIN_MENU_CONFIG. |
| web_client/src/routes.ts | Adds routes.profile.image() and routes.profile.editImage() helpers. |
| web_client/src/profile/layout.tsx | Adds auth gating/loading state for profile area. |
| web_client/src/entry.tsx | Adds profile image list/detail/editor routes and updates routing structure. |
| web_client/src/editor/WatermarkTool.tsx | New watermark settings UI with overlay picker (uses ImageGallery). |
| web_client/src/editor/ImageEditor.tsx | New editor page that previews/apply watermark and navigates to new revision. |
| web_client/src/editor/ImageDetail.tsx | New detail page with edit-history lineage list and copy-reference formats. |
| web_client/src/editor/EditorCanvas.tsx | New canvas-based overlay positioning preview (mouse/touch). |
| web_client/src/editor/data.tsx | Adds useApplyWatermark GraphQL mutation hook. |
| web_client/src/common/ImageGallery/types.ts | Extends rendering type with optional parent info. |
| web_client/src/common/ImageGallery/render.tsx | Makes gallery items link to image detail and shows “revision” badge. |
| web_client/src/common/ImageGallery/menu.tsx | Adds Details/Edit menu items and improves delete error handling. |
| web_client/src/common/ImageGallery/data.tsx | Extends images query to fetch parent; adjusts delete mutation options. |
| web_client/src/localization/*.json | Adds strings for back/details/edit/revision and editor/detail UI. |
| web_client/src/generated/graphql.ts | Updates generated GraphQL types for new schema operations/fields. |
| web_client/src/generated/gql.ts | Updates generated typed document registry for new operations. |
| httpserver/image_handlers.go | Adds uploaded image id to upload handler JSON response. |
| httpserver/utils.go | Extends resolver wiring to pass DB conn, stored image repo, relationship repo. |
| httpserver/make_server.go | Instantiates relationship repo and passes new resolver/middleware deps. |
| graph/schema/images.graphqls | Adds Image fields (parent, changes, lineage), Anchor enum, and applyWatermark mutation plus viewer.image query. |
| graph/resolver.go | Adds resolver dependencies (DBConn, StoredImageRepo, ImageRelRepo). |
| graph/dataloaders.go | Adds BaseParentByImageIdLoader and extends middleware dependencies. |
| graph/images.resolvers.go | Implements applyWatermark mutation + image fields/resolvers + viewer.image. |
| graph/model/models_gen.go | Adds generated input/output types for watermark mutation and Anchor enum. |
| graph/model/image.go | Extends graph Image model to carry parent/root/changes metadata. |
| graph/generated.go | Regenerates gqlgen runtime for new schema (mutation, inputs, fields). |
| graph/images.resolvers_test.go | Adds integration tests for watermarking, lineage, DAG, viewer.image, and delete blocking. |
| graph/graph_test.go | Wires relationship repo + extra resolver deps in test harness. |
| image/interfaces.go | Adds GetImagesByIds to ImageRepo interface. |
| image/repo.go | Persists Changes, adds batch GetImagesByIds, and improves CreateImage defaults. |
| image/relationship_repo.go | New repo for image DAG relationships with cycle detection + CTE queries. |
| editing/changeset.go | New change-set registry/orchestrator for edits. |
| editing/fetch.go | New storage-backed image byte fetcher with size limiting. |
| editing/watermark.go | New watermark editor implementation (scale/opacity/anchor) and registration. |
| editing/*_test.go | Adds unit tests for watermark and changeset registry/serialization. |
| domainmodels/image.go | Adds Changes field to domain Image model. |
| db/migrations/000004_* | Adds indexes for image lineage columns. |
| db/migrations/000005_* | Adds image_parent_table plus backfill from parent_id/changes JSON. |
| db/.gen/imgdd/public/table/table_use_schema.go | Ensures ImageParentTable schema updates via UseSchema. |
| db/.gen/imgdd/public/table/image_parent_table.go | Generated Jet table definition for image_parent_table. |
| db/.gen/imgdd/public/model/image_parent_table.go | Generated Jet model for image_parent_table. |
| gqlgen.yml | Marks parent and changes as resolver-backed fields. |
Files not reviewed (8)
- db/.gen/imgdd/public/model/image_parent_table.go: Language not supported
- db/.gen/imgdd/public/table/image_parent_table.go: Language not supported
- db/.gen/imgdd/public/table/table_use_schema.go: Language not supported
- graph/generated.go: Language not supported
- graph/images.resolvers.go: Language not supported
- graph/model/models_gen.go: Language not supported
- web_client/src/generated/gql.ts: Language not supported
- web_client/src/generated/graphql.ts: Language not supported
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 44 out of 52 changed files in this pull request and generated 5 comments.
Files not reviewed (8)
- db/.gen/imgdd/public/model/image_parent_table.go: Language not supported
- db/.gen/imgdd/public/table/image_parent_table.go: Language not supported
- db/.gen/imgdd/public/table/table_use_schema.go: Language not supported
- graph/generated.go: Language not supported
- graph/images.resolvers.go: Language not supported
- graph/model/models_gen.go: Language not supported
- web_client/src/generated/gql.ts: Language not supported
- web_client/src/generated/graphql.ts: Language not supported
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.
No description provided.