sveltia / sveltia-cms

Alternative to Netlify/Decap CMS. Fast, lightweight, Git-based headless CMS. Modern UX, first-class i18n support, open source & free. Made with Svelte.
MIT License
862 stars 43 forks source link

Dividers jump to another position when I change current collection #147

Closed josineto closed 4 months ago

josineto commented 4 months ago

Dividers in collections list jump from their original position when I change between collections. To reproduce:

  1. log in > dividers are ok
  2. change to another collection > dividers jump
  3. change again to another collection > no more jumps, but divider keeps wrong position
  4. open any item/file, make any edits, then return to collection list > divider keeps wrong position
  5. log out and in again > dividers are ok again

I tested with a collection list like this:

This happens locally and also on web.

I know you've just landed dividers for collections list, and they are awesome! So do they that I was eager to test them... Anyway, thank you for this feature!

kyoshino commented 4 months ago

Will check! 🤔

kyoshino commented 4 months ago

Testing with my local client instances but can’t reproduce the issue. @CarloBu Do you see the problem?

CarloBu commented 4 months ago

kyoshino, It works perfectly for me. I will try to reproduce the issue.

CarloBu commented 4 months ago

@josineto, I can't reproduce the issue either. Can you check a test collection schema to see if the divider is still jumping?

config.yaml

backend:
  name: github
  repo: your/repo
  branch: main
  base_url: http://localhost:4321
  auth_endpoint: /api/auth

media_folder: /src/assets/imgs
public_folder: /src/assets/imgs

collections:
  - label: Test1
    name: test1
    folder: src/content/test1
    create: true
    fields:
      - {label: Title, name: title, widget: string}

  - label: Test2
    name: test2
    folder: src/content/test2
    create: true
    fields:
      - {label: Title, name: title, widget: string}

  - label: Test3
    name: test3
    folder: src/content/test3
    create: true
    fields:
      - {label: Title, name: title, widget: string}

  - label: Test4
    name: test4
    folder: src/content/test4
    create: true
    fields:
      - {label: Title, name: title, widget: string}

  - divider: true
    name: d1

  - label: Test5
    name: test5
    folder: src/content/test5
    create: true
    fields:
      - {label: Title, name: title, widget: string}

  - divider: true
    name: d2

  - label: Test6
    name: test6
    folder: src/content/test6
    create: true
    fields:
      - {label: Title, name: title, widget: string}

  - label: Test7
    name: test7
    folder: src/content/test7
    create: true
    fields:
      - {label: Title, name: title, widget: string}

If the divider is not jumping for you in this test schema, then it means there is an issue with your config.yaml. In that case, it would be great if you could share the entire config.yaml file here.

josineto commented 4 months ago

Sorry, problem is: I put the same name, d1, to both dividers... changing to different names solves it. I'll close this issue. But perhaps this mistake could go to the list of things to validate in the configuration... Anyway, sorry (again) for the noise!

kyoshino commented 4 months ago

I thought having the same name for multiple collections would rather result in an empty CMS screen due to an internal error. Anyway, good to know your problem is solved, and I’ll implement config validation soonish!