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 support for multiple boards per workspace #22

Open
wants to merge 98 commits into
base: main
Choose a base branch
from

Conversation

samgiz
Copy link

@samgiz samgiz commented Feb 17, 2023

The main functional change of this PR is the ability to have multiple kanbn boards per workspace. A new kanbn board gets placed in .kanbn_boards/<board_name>/.kanbn instead of the usual .kanbn. Additionally the user can specify more board locations with the additionalBoards setting both in user and workspace settings. I also needed to make changes to the underlying kanbn package to implement support for multiple boards, so I'm pointing to my fork of the kanbn repository in the packages.json file. This should fix #14 and #13.

Additionally I experienced a couple of issues with retainContextWhenHidden enabled for the webviews (like this one), so I ended up making the webviews work without it. There are still issues with maintaining local unsaved changes in task panels (and that's likely the next thing I'll be working on, could still add it to this PR), but other than that the panels mostly work and load quickly, and should use significantly less memory as at most 1 or a few will be active at any given time.

I also updated most dependencies to the newest versions that wouldn't clash, and introduced a linter for more uniform code. This part was mostly for my own benefit, as I wanted to make sure I'm dealing with up to date APIs and cleaner code. I also restructured several pieces of code where I felt I could improve it (for example by removing the static methods from Kanbn{Board,Task,Burndown}Panel so now each object is responsible for exactly one webview panel).

I realise the changelist is quite massive, but I believe almost all of my changes were improvements. The one feature I removed (for now) is making the default assignee be the github username as the git modules refused to work with webkit 5.

I appreciate any feedback, I'm still not too familiar with all the functionality, so could have easily introduced some unintended bugs to the extension.

Currently able to open any already created board or create a new board. Swapping out boards gives errors for now. Also
issues rerendering the board, need to figure out why the file watcher doesn't work.
Now it's possible to open any board created within a workspace, though only one board can be open at a time.
Instead of all classes being static we now instantiate them for each board.
Set up ESLint to have a more consistent coding style, and fixed the majority of issues with the code.

Also updated all the dependencies to the newest version. Removed git-user-name in the process, because it was using the
path library, whereas this is explicitly excluded from react 5. Did not see the need to have have git-user-name be the
default for an assignee.
I added a couple explicit String casts around paramCase for now as there are no typescript bindings for them at the
moment.
Also left a couple of TODOs for when typescript bindings for paramCase get updated.
Was checking for undefined in several places even though I should have been checking for empty string.
Move the ownership of task panels to the corresponding KanbnBoardPanel.
There were a couple bugs associated with retainContextWhenHidden:
* Sometimes ctrl+w can close 2 webviews instead of one. I filed a bug report for this:
* Ctrl+tab / Ctrl+shift+tab would not work consistently, iterating over the tabs in unpredictable order.

These 2 issues have now been fixed. There is a brief bit of lag when switching between views but it is bearable for now.
Will need to investigate possible performance improvements in the future.
Clean up KanbnTaskPanel
Also support legacy boards that are created in the current workspace directory instead of the .kanbn_boards subdirectory.
Multiple setState calls were causing react to rerender much more than it needed to. Encapsulating the state into a
single state object fixes this by only making one setState call per update.
Adding per-workspace and per-user lists of boards to be accessible when we want to open a board.
samgiz and others added 30 commits April 8, 2023 16:37
Rename kanbn.board to kanbn.openBoard in KanbnStatusBarItem.ts.
* Fixed a few of issues with mapping between the extension server and task editor panel that disallowed saving a task that had tags, subtasks or custom fields.
* Fixed a name validation issue that didn't allow saving tasks unless the task name had changed.
* Fixed rendering of dates in the task editor.
* Fixed small rendering issues of custom fields in the board panel, like boolean or integer custom field values showing up even when
  they were not present in the task.
Now board.css gets loaded in all 3 types of panels, whereas previously it wasn't being loaded in any of them.
Fix loading of board.css styles in all panels
Show task counters at the top of a column.
There was an issue saving tasks with a progress value, now tasks should save properly and keep their values.
Fix saving tasks with progress value
Adds command to open task
Realised that my laptop no longer correctly applies the config, this seems to fix it.
Before I was incorrectly checking whether there are any workspaces open to see if any boards are present. Now the check
is whether we have detected at least one board.
Small fixes and cleanup
Fix button style when user is in light theme
Init panel title equally for new task and reopened task
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.

feature request: global kanban file
3 participants