Skip to content

Sco 1771 add delete for non foldable list item#103

Merged
JannieT merged 12 commits intomainfrom
sco-1771-add-delete-for-non-foldable-list-item
Feb 25, 2026
Merged

Sco 1771 add delete for non foldable list item#103
JannieT merged 12 commits intomainfrom
sco-1771-add-delete-for-non-foldable-list-item

Conversation

@timosville
Copy link
Contributor

No description provided.

@timosville timosville requested a review from JannieT February 23, 2026 09:00
@linear
Copy link

linear bot commented Feb 23, 2026

@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Feb 23, 2026

Deploying kit with  Cloudflare Pages  Cloudflare Pages

Latest commit: ebc3dc1
Status:🚫  Build failed.

View logs

@github-actions github-actions bot requested a deployment to kit (Preview) February 23, 2026 09:03 Abandoned
@github-actions github-actions bot requested a deployment to kit (Preview) February 23, 2026 12:23 Abandoned
Copy link
Member

@JannieT JannieT left a comment

Choose a reason for hiding this comment

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

There is still problems with a simple list that is non-foldable. Looks like one can only delete the last item and the UX is confusing. We might need design thinking to handle simple lists differently from lists with complex items. Start by setting up two extra variations so we can demonstrate the differences:

  1. Non-foldable complex item
  2. Non-foldable string items

@github-actions github-actions bot requested a deployment to kit (Preview) February 24, 2026 07:55 Abandoned
@timosville timosville requested a review from JannieT February 24, 2026 12:29
@github-actions github-actions bot requested a deployment to kit (Preview) February 24, 2026 12:31 Abandoned
@github-actions github-actions bot requested a deployment to kit (Preview) February 24, 2026 12:58 Abandoned
Copy link
Member

@JannieT JannieT left a comment

Choose a reason for hiding this comment

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

Please look at my concerns.

return Array.isArray(sourceList) && index < sourceList.length;
};

const removedState = computed(() => store.getListRemoved(props.fieldPath));
Copy link
Member

Choose a reason for hiding this comment

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

The store is for shared state. The deleted-ness of each item is state that is only used inside this component, so how about just using a local reference to track it:

Suggested change
const removedState = computed(() => store.getListRemoved(props.fieldPath));
const allFalse = new Array(props.listItems.length).fill(false);
const removedList = ref<boolean[]>(allFalse);

return removedState.value[index] ?? false;
};

const title = (index: number): string => {
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this function always resolves to 'New Section'


const removedState = computed(() => store.getListRemoved(props.fieldPath));

const ensureRemoved = () => {
Copy link
Member

Choose a reason for hiding this comment

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

Make sure this handles both length adjustments: padding and trimming

Suggested change
const ensureRemoved = () => {
const resizeRemovedList = () => {

Copy link
Member

Choose a reason for hiding this comment

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

I was not expecting any changes to the widget store for this feature.

Copy link
Member

Choose a reason for hiding this comment

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

I was wrong about this 🤦

createdAt: '2025-10-24T06:10:38.482+00:00',
},
bundle: {
questions: [],
Copy link
Member

Choose a reason for hiding this comment

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

Let's make sure we can handle something like this:

Suggested change
questions: [],
questions: [
{question: ''},
{question: 'Translated: If it turned out ... '}
],

@github-actions github-actions bot requested a deployment to kit (Preview) February 25, 2026 08:41 Abandoned
Copy link
Member

Choose a reason for hiding this comment

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

I was wrong about this 🤦

@JannieT JannieT merged commit 0503e04 into main Feb 25, 2026
1 of 3 checks passed
@JannieT JannieT deleted the sco-1771-add-delete-for-non-foldable-list-item branch February 25, 2026 08:51
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