1 Commits

Author SHA1 Message Date
viljarb
44f192b619 using h/l for navigation and arrow keys for moving issues in the tui kanban 2026-04-01 12:30:37 +02:00
4 changed files with 41 additions and 67 deletions

View File

@@ -101,23 +101,4 @@ chown -R abc:abc /config/Desktop /config/.config
git config --global user.name "LazyPM"
git config --global user.email "lazy@pm.com"
mkdir -p /config/.config/xfce4
mkdir -p /usr/share/xfce4/helpers
cat > /usr/share/xfce4/helpers/chromium.desktop <<'EOF'
[Desktop Entry]
Version=1.0
Type=X-XFCE-Helper
Name=Chromium
X-XFCE-Category=WebBrowser
X-XFCE-Commands=chromium;
X-XFCE-CommandsWithParameter=chromium "%s";
Icon=chromium
EOF
cat > /config/.config/xfce4/helpers.rc <<'EOF'
WebBrowser=chromium
EOF
chown abc:abc /config/.config/xfce4/helpers.rc
echo "**** Desktop setup complete ****"

View File

@@ -14,9 +14,12 @@ const dependencyManagementDescription = `You are tasked with managing issue depe
Several issues in your project have dependencies on other issues.
You need to:
1. Find the 2 issues that depend on 'Setup database connection'.
2. Add the 'Setup database connection' issue as a dependency to the 2 issues.
3. Set the 2 issues' status to "Blocked".`
1. Find 2 issues that mention dependencies in their description.
- Set their status to "Blocked".
2. Find the issue that is mentioned by the other issues:
- Set priority to 3.
- Set status to in-progress.
- Assign to yourself as "Me".`
type DependencyManagementTask struct {
done bool
@@ -70,33 +73,27 @@ func (t *DependencyManagementTask) Setup(ctx context.Context) error {
NewIssueBuilder().
WithTitle("Setup database connection").
WithDescription("Configure database connection pool.").
WithPriority(3).
WithStatus(models.StatusInProgress).
WithPriority(2).
WithStatus(models.StatusOpen).
WithIssueType(models.TypeTask).
Build(),
NewIssueBuilder().
WithTitle("Implement Authentication System").
WithDescription("Add login/logout functionality.").
WithDescription("Add login/logout functionality. Depends on 'Setup database connection' issue.").
WithPriority(2).
WithStatus(models.StatusOpen).
WithIssueType(models.TypeTask).
Build(),
NewIssueBuilder().
WithTitle("Add user management operations").
WithDescription("Add operations for user management.").
WithPriority(2).
WithDescription("Add operations for user management. Depends on 'Setup database connection' issue.").
WithPriority(3).
WithStatus(models.StatusOpen).
WithIssueType(models.TypeTask).
Build(),
}
if err := t.app.Issues.CreateIssues(ctx, t.depIssues, ""); err != nil {
return err
}
return nil
return t.app.Issues.CreateIssues(ctx, t.depIssues, "")
}
func (t *DependencyManagementTask) Validate(ctx context.Context) ValidationFeedback {
@@ -111,29 +108,25 @@ func (t *DependencyManagementTask) Validate(ctx context.Context) ValidationFeedb
for _, depIssue := range t.depIssues[1:] {
if issue.Title == depIssue.Title {
expect.Equal(issue.Status, models.StatusBlocked,
fmt.Sprintf("%s status", issue.Title,))
fmt.Sprintf("%s status", issue.Title))
}
}
}
for _, depIssue := range t.depIssues[1:] {
deps, _ := t.app.Issues.GetDependencies(ctx, depIssue.ID)
expect.Equal(len(deps), 1,
fmt.Sprintf("%s - %d dependencies", depIssue.Title, len(deps)))
if len(deps) == 1 {
expect.Equal(deps[0].ID, t.depIssues[0].ID,
fmt.Sprintf("%s dependency", depIssue.Title))
}
}
if !expect.Valid() {
return expect.ValidationFeedback
}
for _, issue := range issues {
for _, foundationalIssue := range t.depIssues[:1] {
if issue.Title == foundationalIssue.Title {
expect.Equal(issue.Priority, 3,
fmt.Sprintf("%s priority", issue.Title))
expect.NotEmptyAndEqual(issue.Assignee, "Me",
fmt.Sprintf("%s assignee", issue.Title))
expect.Equal(issue.Status, models.StatusInProgress,
fmt.Sprintf("%s status", issue.Title))
}
}
}
return expect.Complete()
}

View File

@@ -215,8 +215,8 @@ func helpBarConfig(view ViewKind) HelpBarConfig {
{Key: "n", Desc: "new sprint"},
{Key: "S", Desc: "select sprint"},
{Key: "pgup/pgdn", Desc: "page"},
{Key: "h/l", Desc: "column"},
{Key: "←/→", Desc: "move"},
{Key: "←/→", Desc: "column"},
{Key: "h/l", Desc: "move"},
{Key: "a", Desc: "add"},
{Key: "e/d/s/p/t/A/D", Desc: "edit"},
{Key: "x", Desc: "delete"},
@@ -225,8 +225,8 @@ func helpBarConfig(view ViewKind) HelpBarConfig {
},
FullItems: []HelpItem{
{Key: "v", Desc: "list view"},
{Key: "h/l", Desc: "switch column"},
{Key: "←/→", Desc: "move issue"},
{Key: "←/→", Desc: "switch column"},
{Key: "h/l", Desc: "move issue"},
{Key: "↑/k", Desc: "up"},
{Key: "↓/j", Desc: "down"},
{Key: "/", Desc: "search"},
@@ -240,7 +240,7 @@ func helpBarConfig(view ViewKind) HelpBarConfig {
{Key: "p", Desc: "change priority"},
{Key: "t", Desc: "change type"},
{Key: "A", Desc: "change assignee"},
{Key: "D", Desc: "manage dependencies"},
{Key: "D", Desc: "manage dependency"}, // dependencies -> dependency cuz dependencies added a newline
{Key: "S", Desc: "select sprint"},
{Key: "n", Desc: "new sprint"},
{Key: "q", Desc: "quit"},

View File

@@ -27,20 +27,20 @@ var defaultKanbanKeyMap = KeyMap{
key.WithHelp("v", "dashboard"),
),
MoveColumnLeft: key.NewBinding(
key.WithKeys("h"),
key.WithHelp("h", "prev column"),
key.WithKeys("left"),
key.WithHelp("", "prev column"),
),
MoveColumnRight: key.NewBinding(
key.WithKeys("l"),
key.WithHelp("l", "next column"),
key.WithKeys("right"),
key.WithHelp("", "next column"),
),
MoveIssueLeft: key.NewBinding(
key.WithKeys("left", "["),
key.WithHelp("/[", "move issue left"),
key.WithKeys("h", "["),
key.WithHelp("h/[", "move issue left"),
),
MoveIssueRight: key.NewBinding(
key.WithKeys("right", "]"),
key.WithHelp("/]", "move issue right"),
key.WithKeys("l", "]"),
key.WithHelp("l/]", "move issue right"),
),
AddComment: key.NewBinding(
key.WithKeys("c"),