Skip to content

Improve "view-all" page - #2

Merged
fillipe-gsm merged 5 commits into
masterfrom
1-improve-view-all-page
Nov 8, 2025
Merged

Improve "view-all" page#2
fillipe-gsm merged 5 commits into
masterfrom
1-improve-view-all-page

Conversation

@fillipe-gsm

@fillipe-gsm fillipe-gsm commented Oct 29, 2025

Copy link
Copy Markdown
Owner

Handles #1.

Currently, the "view-all" view used a Layout to display the data. However, this always covers the entire terminal, which may be too much sometimes or too little and cut some content.

In this pull request, I replaced it with a simple(r) Table view as shown below:

image

It is not that nice looking as before but it should fix the previous issues.

@fillipe-gsm
fillipe-gsm requested a review from Copilot November 1, 2025 00:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances the "view-all" page by refactoring the task display mechanism from a layout-based approach to a table-based presentation. The changes improve the visual organization of tasks grouped by status.

Key changes:

  • Replaced Layout and Panel components with a Table component for displaying tasks
  • Refactored task grouping to use integer status indices instead of string identifiers
  • Added helper methods to build task rows and separator rules for better visual separation

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/tasks/presenters/view_all_presenter.py Refactored presentation logic to use Rich tables with separate methods for building task rows and rule separators
src/tasks/models/task.py Added iter_status_indices() helper method and changed group_by_status() return type from string-keyed to int-keyed dict
tests/tasks/models/test_task.py Added test coverage for the new iter_status_indices() method

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

rows.append(task_row)
rows.append(rule_row)

rows.append(tasks_rows[-1])

Copilot AI Nov 1, 2025

Copy link

Choose a reason for hiding this comment

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

This code will fail with an IndexError when tasks_rows is empty. Add a guard condition to handle the case when there are no tasks, or ensure tasks_rows has at least one element before accessing tasks_rows[-1].

Suggested change
rows.append(tasks_rows[-1])
if tasks_rows:
rows.append(tasks_rows[-1])

Copilot uses AI. Check for mistakes.
@fillipe-gsm
fillipe-gsm force-pushed the 1-improve-view-all-page branch 2 times, most recently from 2870c2b to 156a91b Compare November 1, 2025 00:27
The previous visualization always used the full terminal, and this is
bad:
- the new line after printing gets rid of the statuses names
- in case the terminal is too short, it clips some tasks

This commit replaces it with a table view, which, granted, is not as
nice, but should solve the previous issues.
- Make the columns of equal width with ratio=1
- Center only the table headers and keep the content left justified
@fillipe-gsm
fillipe-gsm force-pushed the 1-improve-view-all-page branch from 7fc153a to 0364f17 Compare November 3, 2025 21:52
@fillipe-gsm
fillipe-gsm merged commit c6922dd into master Nov 8, 2025
4 checks passed
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