sanity-io / sanity

Sanity Studio – Rapidly configure content workspaces powered by structured content
https://www.sanity.io
MIT License
5.07k stars 411 forks source link

Hotspot cropping preview doesn't respect curent crop #6882

Open rikusen0335 opened 1 month ago

rikusen0335 commented 1 month ago

Describe the bug

As title says, preview shows old or wrong one and not the current cropping status. See screenshot to know more detail

To Reproduce

Steps to reproduce the behavior:

Just use hotspot & crop

Expected behavior

Preview respects current cropping and shows correct preview.

Screenshots image

Which versions of Sanity are you using?

@sanity/cli (global)        3.43.0 (latest: 3.45.0)
@sanity/demo                 2.0.0 (up to date)
@sanity/icons               2.11.8 (latest: 3.2.0)
@sanity/image-url            1.0.2 (up to date)
@sanity/locale-ja-jp         1.1.4 (up to date)
@sanity/preview-url-secret  1.6.13 (latest: 1.6.17)
@sanity/react-loader        1.9.19 (latest: 1.10.2)
@sanity/ui                  2.1.11 (latest: 2.3.1)
@sanity/vision              3.43.0 (latest: 3.45.0)
sanity                      3.43.0 (latest: 3.45.0)

What operating system are you using? Windows 11

Which versions of Node.js / npm are you running?

pnpm - 9.2.0
node - v20.10.0

Additional context

Nothing

Security issue?

No.

binoy14 commented 3 weeks ago

Hi @rikusen0335 sorry you are running into this issue, I tried recreating this issue on the latest version of sanity but have not been able to successfully do so. Could you try updating to the latest version of sanity studio and see if this issue is still happening.

rikusen0335 commented 2 weeks ago

Yeah sure, bouta upgrade them.

rikusen0335 commented 2 weeks ago

@binoy14 Well I upgraded everything relates to sanity, but it still not fixed :(

❯ pnpm sanity versions
@sanity/cli (global)        3.47.1 (up to date)
@sanity/color-input          3.1.1 (up to date)
@sanity/demo                 2.0.0 (up to date)
@sanity/icons                3.2.0 (up to date)
@sanity/image-url            1.0.2 (up to date)
@sanity/locale-ja-jp         1.1.4 (up to date)
@sanity/preview-url-secret  1.6.17 (up to date)
@sanity/react-loader        1.10.3 (up to date)
@sanity/ui                   2.4.0 (up to date)
@sanity/vision              3.47.1 (up to date)
sanity                      3.47.1 (up to date)
runeb commented 2 weeks ago

Hi @rikusen0335, could you share the content of the hotspot and the crop attributes on the image field for this document? You should be able to see them by inspecting the document from the Studio editing screen.

Also, what browser and version are you using?

rikusen0335 commented 2 weeks ago

@runeb Thank you for response.

Here's image field includes hotspot and crop:

defineField({
  name: 'coverImage',
  title: 'カバー画像',
  description: 'このプロジェクトのカバー画像。プロジェクト一覧や、トップページに表示される',
  type: 'image',
  options: {
    hotspot: true,
  },
  validation: (rule) => rule.required(),
  fields: [
    defineField({
      name: 'alt',
      type: 'string',
      title: 'Altテキスト',
      description: '視覚障害者用の、読み上げソフトが読むテキスト。',
      validation: (rule) => rule.required(),
    }),
  ],
}),

Also I've got the issue with these browsers: