Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "Close" button to close kanban and disable auto closing #44

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

benlau
Copy link
Collaborator

@benlau benlau commented Jun 22, 2023

Implements #21

  • Added a "close" button at the left of the kanban title to close kanban
  • Disabled auto closing if user open a note which is not in the current kanban (as user could close the kanban by using the close button)

Screenshot 2023-06-22 at 10 04 30 AM

@@ -127,10 +127,9 @@ async function reloadConfig(noteId: string) {
const valid = ymlConfig !== null && (await board.loadConfig(ymlConfig));
if (valid) {
openBoard = board;
} else {
openBoard = undefined;
Copy link
Collaborator

Choose a reason for hiding this comment

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

wouldn't it be good to set openBoard as undefined in this case?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remove the code to prevent the board from closing automatically and keep the current board working.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

If it set to undefined, I am afraid the current board will not be working any more.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, I'll need more time to understand the code on my side then

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, after additional test, this part is ok

@mhelleboid
Copy link
Collaborator

This works as described.

The board lifecycle seems to have change a bit, but it seems ok.

Not sure that the initial feature request suggested to also disable the "auto closing". In this case this could be an option.
Anyway, this can be done in an additional commit/branch.

@benlau
Copy link
Collaborator Author

benlau commented Jun 23, 2023

@mhelleboid Thanks for reviewing!

yes, the auto closing is not described in the feature requirement.

However, as we now have a close button and therefore I think auto closing is not needed anymore as user could choose when should it be closed. It is more flexible.

Example:

  1. Edit a kanban board
  2. User find that a note should be added to the kanban
  3. Open the note and change folder/tag to add to kanban
  4. The board closed and user need to open the kanban again to resume the works but it may need to wait for a few seconds for reloading

Disable the auto closing feature could save the time for reloading in step 4

@PackElend , what do you think?

@mhelleboid
Copy link
Collaborator

Ok the scenario makes sense, and I agree that this is a good thing

@PackElend
Copy link
Collaborator

Sounds good but let me check the history why auto close exsist

@benlau
Copy link
Collaborator Author

benlau commented Jun 25, 2023

@PackElend thx. If it is approved, I may try to work on a feature to drag a note from note list to a Kanban column directly.

@PackElend
Copy link
Collaborator

PackElend commented Jun 27, 2023

could find anything and still don't see a reason to keep auto close but others may think differently.
I started a "survey", see https://discourse.joplinapp.org/t/shall-we-replace-auto-close-by-close-button/31440

@PackElend
Copy link
Collaborator

let's wait for a week, if it is not significant response I'll merge it

@PackElend
Copy link
Collaborator

I may try to work on a feature to drag a note from note list to a Kanban column directly.

@benlau please go ahead but open a topic in the forum as well, to allow the community to join the development :)

@@ -273,12 +276,19 @@ async function handleKanbanMessage(msg: Action) {
* the domain of the current board.
*/
async function handleNewlyOpenedNote(newNoteId: string) {

if (openBoard) {
if (openBoard.configNoteId === newNoteId) return;
if (await openBoard.isNoteIdOnBoard(newNoteId)) return;
else {
Copy link
Collaborator

@mhelleboid mhelleboid Jul 1, 2023

Choose a reason for hiding this comment

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

this code was already there, but is this "else" useful?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes. Let's say you have opened Kanban A note , and then open another Kanban B note, the else code handle this condition and replace the the board to Kanban B. If no such code, you need to close the current board and then open the Kanban note B manually.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Remark: The reloadConfig() replace the "openBoard" variable. That is why it looks a bit weird.

@mhelleboid
Copy link
Collaborator

The code and the PR is ok for me, from a technical and functional (auto close) point of view

@PackElend
Copy link
Collaborator

@benlau do you want to add some comments / do changes due to the latest review, if necessary?

So that I can merge it.

@benlau
Copy link
Collaborator Author

benlau commented Jul 9, 2023

@PackElend I think it should be ready to merge. thx

@PackElend PackElend merged commit 0e4098d into joplin:dev Jul 10, 2023
@AndiLeni
Copy link

@benlau Sorry to comment on this old pr, but how do I activate this feature? The button is missing on my end.

@benlau
Copy link
Collaborator Author

benlau commented Feb 27, 2024

@AndiLeni I think the change is not published yet.

@PackElend Do you have the permission to release a new version?

@PackElend
Copy link
Collaborator

Do you have the permission to release a new version?

will check

@PackElend
Copy link
Collaborator

PackElend commented May 15, 2024

@mhelleboid
@benlau

Eventually GSoC is rolling smoothly and we are looking into other things.
We get errors when we build it:

> [email protected] prepare
> npm run dist


> [email protected] dist
> webpack --joplin-plugin-config buildMain && webpack --joplin-plugin-config buildExtraScripts && webpack --joplin-plugin-config createArchive

do you get the same when you do that?

it is discussed in https://discord.com/channels/610762468960239627/919979500765335613/1240377195730440274

@PackElend
Copy link
Collaborator

#50 could fix it, let's see.

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.

None yet

4 participants