Skip to content

Image editor - #11

Merged
ericls merged 15 commits into
mainfrom
shen/image-editor
Jun 2, 2026
Merged

Image editor#11
ericls merged 15 commits into
mainfrom
shen/image-editor

Conversation

@ericls

@ericls ericls commented Jun 2, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

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 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/:imageId and /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) and applyWatermark mutation, 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.

Comment thread web_client/src/uploader/uploader.tsx
Comment thread web_client/src/common/ImageGallery/render.tsx Outdated
Comment thread web_client/src/common/ImageGallery/menu.tsx
Comment thread graph/images.resolvers.go Outdated
Comment thread graph/images.resolvers.go
Comment thread graph/images.resolvers.go Outdated
Comment thread image/relationship_repo.go

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread image/repo.go
Comment thread graph/images.resolvers.go Outdated
Comment thread web_client/src/editor/ImageEditor.tsx
Comment thread web_client/src/editor/EditorCanvas.tsx
Comment thread web_client/src/editor/WatermarkTool.tsx
@ericls
ericls merged commit eb25d3a into main Jun 2, 2026
8 checks passed
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.

2 participants