Skip to content

Conversation

@Mariam-Saeed
Copy link

@Mariam-Saeed Mariam-Saeed commented Sep 20, 2025

resolves #20

@Mariam-Saeed
Copy link
Author

Hello @codedread, I implemented a close button in the button panel that closes the currently open space. I attempted to add unit tests, but I’m still building my testing experience and couldn’t complete them this time. :'D
Thank you a lot for this experience, I’m really learning a lot.

@codedread
Copy link
Owner

Thanks @Mariam-Saeed ! This is great, I can work on convincing an AI to write some unit tests, this patch looks pretty great! Please address the above comments and resolve branch conflicts (rebase to get my latest changes) and then send back and I can merge your PR!

@Mariam-Saeed
Copy link
Author

@codedread, can you check now?

@codedread
Copy link
Owner

@codedread, can you check now?

It looks like you may have updated your branch so there are no conflicts, but you haven't addressed my 3 review comments above. Thanks again.

@Mariam-Saeed
Copy link
Author

@codedread , oh sorry I couldn't see them.
They should be on the files changed ?

js/spaces.js Outdated
});
}

async function performClose(windowId) {
Copy link
Owner

Choose a reason for hiding this comment

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

Can you pls move this function to background.js (which is the thing that is managing windows and calling chrome.windows.*) and just have handleClose() calling chrome.runtime.sendMessage()?

I'd like to keep the architecture consistent.

js/spaces.js Outdated

// Export for testing
export { normaliseTabUrl };
export { normaliseTabUrl, performClose, handleClose };
Copy link
Owner

Choose a reason for hiding this comment

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

nit: No need to expose the functions if there are no unit tests (for now).

js/spaces.js Outdated
const { windowId, name } = globalSelectedSpace;

// Only show confirm if the space is unnamed
const isUnnamed = !name || !name.trim();
Copy link
Owner

Choose a reason for hiding this comment

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

Instead of this checking, I think you can just see if the space has a sessionId instead.

@codedread
Copy link
Owner

Sorry my bad. I forgot to submit the review!

@Mariam-Saeed
Copy link
Author

@codedread Done

@codedread codedread merged commit b357b78 into codedread:master Sep 20, 2025
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.

Ability to close windows from Spaces

2 participants