Skip to content

feat(ui): add My Issues filter button (#63)#161

Merged
thebtf merged 1 commit into
mainfrom
fix/my-tasks-filter
Apr 14, 2026
Merged

feat(ui): add My Issues filter button (#63)#161
thebtf merged 1 commit into
mainfrom
fix/my-tasks-filter

Conversation

@thebtf
Copy link
Copy Markdown
Owner

@thebtf thebtf commented Apr 14, 2026

Adds "My Issues" toggle to filter issues by source_project=dashboard (operator-created issues).

  • fetchIssues: added sourceProject parameter
  • useIssues: added sourceProjectFilter with auto-reload
  • IssuesView: purple "My Issues" toggle button

Part 1 of #63. Part 2 (reserved operator project ID for agent→operator issues) needs design.

Summary by CodeRabbit

Новые возможности

  • Новые функции
    • Добавлена фильтрация задач по исходному проекту.
    • Реализована кнопка "Мои задачи" в списке задач, позволяющая пользователям быстро переключаться между просмотром всех задач и только своих задач из личной панели.

Adds source_project filter support to fetchIssues API and useIssues
composable. "My Issues" toggle filters to source_project=dashboard
(issues created by the operator). Purple highlight when active.
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 14, 2026

Пояснение

Изменения добавляют возможность фильтрации проблем по исходному проекту через новый реактивный фильтр sourceProjectFilter. Параметр передаётся вниз по цепочке от компонента представления через composable к API функции, с синхронизацией через кнопку "My Issues" в интерфейсе.

Изменения

Cohort / File(s) Summary
API и фильтрация composable
ui/src/utils/api.ts, ui/src/composables/useIssues.ts
Добавлен новый опциональный параметр sourceProject к функции fetchIssues, который передаётся в query параметры как source_project. Composable экспортирует новую реактивную переменную sourceProjectFilter и передаёт её значение в функцию API. Обновлены зависимости watcher-а для отслеживания изменений фильтра.
UI компонент представления
ui/src/views/IssuesView.vue
Добавлена кнопка "My Issues" в заголовок, которая управляет состоянием myIssuesOnly. При нажатии кнопка синхронизирует sourceProjectFilter со значением 'dashboard' (включено) или '' (выключено), позволяя пользователям просматривать только личные проблемы.

Смета на рецензирование кода

🎯 2 (Простое) | ⏱️ ~12 минут

Возможно связанные MR

  • feat: agent issues — cross-project issue tracking for AI agents #133: основной MR расширяет листинг проблем UI, добавляя sourceProjectFilter и передавая его в fetchIssues, непосредственно модифицируя те же composable и сигнатуру API функции, которые были добавлены/использованы в текущем MR.

Предлагаемые метки

ai-review:active

Стихотворение

🐰 Кролик прыгает с восторгом,
Фильтры новые добавлены с толком!
«My Issues» кнопка светит в окне,
Мои проблемы, только не мне!
По проектам теперь всё сортируем,
Код красивый, всё облагораживаем! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'feat(ui): add My Issues filter button (#63)' clearly and accurately summarizes the main change - adding a new filter button to the Issues UI component.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/my-tasks-filter

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
ui/src/views/IssuesView.vue (1)

11-16: Сведите фильтр к одному источнику правды.

На Line 11-16 myIssuesOnly и sourceProjectFilter хранят один и тот же смысл, из-за чего возможна рассинхронизация состояния UI и фактического фильтра.

♻️ Предложение
-import { ref, onMounted } from 'vue'
+import { ref, computed, onMounted } from 'vue'

 const { issues, total, loading, error, statusFilter, sourceProjectFilter, typeFilter, load } = useIssues()
-const myIssuesOnly = ref(false)
+const myIssuesOnly = computed(() => sourceProjectFilter.value === 'dashboard')

 function toggleMyIssues() {
-  myIssuesOnly.value = !myIssuesOnly.value
-  sourceProjectFilter.value = myIssuesOnly.value ? 'dashboard' : ''
+  sourceProjectFilter.value = myIssuesOnly.value ? '' : 'dashboard'
 }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ui/src/views/IssuesView.vue` around lines 11 - 16, The code keeps duplicate
state in myIssuesOnly and sourceProjectFilter which can drift; remove the
redundant ref and collapse to a single source of truth by either (A) deleting
the myIssuesOnly ref and have toggleMyIssues update only sourceProjectFilter, or
(B) make myIssuesOnly a computed with get() returning sourceProjectFilter.value
=== 'dashboard' and set(v) updating sourceProjectFilter.value = v ? 'dashboard'
: ''. Update the toggleMyIssues function (and any consumers) to use the single
source (either the computed myIssuesOnly or sourceProjectFilter) and remove any
direct writes to the removed ref.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ui/src/views/IssuesView.vue`:
- Around line 140-150: Добавьте состояние доступности к кнопке-фильтру, привязав
атрибут aria-pressed к булевому состоянию myIssuesOnly (например
:aria-pressed="myIssuesOnly") на том же элементе button, где используется
`@click`="toggleMyIssues", чтобы скринридеры корректно озвучивали включённость
фильтра; убедитесь, что myIssuesOnly действительно булево и обновляется в методе
toggleMyIssues.

---

Nitpick comments:
In `@ui/src/views/IssuesView.vue`:
- Around line 11-16: The code keeps duplicate state in myIssuesOnly and
sourceProjectFilter which can drift; remove the redundant ref and collapse to a
single source of truth by either (A) deleting the myIssuesOnly ref and have
toggleMyIssues update only sourceProjectFilter, or (B) make myIssuesOnly a
computed with get() returning sourceProjectFilter.value === 'dashboard' and
set(v) updating sourceProjectFilter.value = v ? 'dashboard' : ''. Update the
toggleMyIssues function (and any consumers) to use the single source (either the
computed myIssuesOnly or sourceProjectFilter) and remove any direct writes to
the removed ref.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5837d2bc-a0be-452a-8b44-e53ea7aef1bb

📥 Commits

Reviewing files that changed from the base of the PR and between 5fe3e89 and 0689769.

📒 Files selected for processing (3)
  • ui/src/composables/useIssues.ts
  • ui/src/utils/api.ts
  • ui/src/views/IssuesView.vue

Comment on lines +140 to +150
<button
@click="toggleMyIssues"
:class="[
'px-3 py-1.5 text-sm rounded-md transition-colors',
myIssuesOnly
? 'bg-purple-600 text-white hover:bg-purple-500'
: 'bg-gray-200 dark:bg-gray-700 text-gray-700 dark:text-gray-300 hover:bg-gray-300 dark:hover:bg-gray-600'
]"
>
<i class="fas fa-user mr-1" />My Issues
</button>
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Добавьте состояние переключателя для доступности.

Для toggle-кнопки на Line 140-150 лучше явно выставить aria-pressed, чтобы screen reader корректно озвучивал включённость фильтра.

♿ Небольшое улучшение
         <button
           `@click`="toggleMyIssues"
+          type="button"
+          :aria-pressed="myIssuesOnly"
           :class="[
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@ui/src/views/IssuesView.vue` around lines 140 - 150, Добавьте состояние
доступности к кнопке-фильтру, привязав атрибут aria-pressed к булевому состоянию
myIssuesOnly (например :aria-pressed="myIssuesOnly") на том же элементе button,
где используется `@click`="toggleMyIssues", чтобы скринридеры корректно озвучивали
включённость фильтра; убедитесь, что myIssuesOnly действительно булево и
обновляется в методе toggleMyIssues.

@thebtf thebtf merged commit 4e8e978 into main Apr 14, 2026
2 checks passed
@thebtf thebtf deleted the fix/my-tasks-filter branch April 14, 2026 20:55
Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request implements a 'My Issues' filter by introducing a sourceProjectFilter state and updating the fetchIssues API call to support the source_project query parameter. The UI now includes a toggle button to activate this filter. Reviewers suggested refactoring the fetchIssues function to use an options object to avoid a long list of positional arguments. It was also noted that the myIssuesOnly ref is redundant and can be replaced by checking the filter value directly.

Comment thread ui/src/utils/api.ts
Comment on lines +1067 to +1068
type?: string,
sourceProject?: string
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The fetchIssues function is accumulating a large number of positional arguments (now 7), most of which are optional. This makes the function difficult to call and maintain, as it often requires passing multiple undefined values to reach later parameters. Consider refactoring this to use a single options object for better readability and extensibility.

Comment on lines +11 to +16
const myIssuesOnly = ref(false)

function toggleMyIssues() {
myIssuesOnly.value = !myIssuesOnly.value
sourceProjectFilter.value = myIssuesOnly.value ? 'dashboard' : ''
}
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The myIssuesOnly ref is redundant because its state is strictly tied to whether sourceProjectFilter is set to 'dashboard'. You can simplify the component state by removing this ref and checking the filter value directly. Additionally, consider defining a constant for the 'dashboard' string to avoid magic strings in the logic.


function toggleMyIssues() {
  sourceProjectFilter.value = sourceProjectFilter.value === 'dashboard' ? '' : 'dashboard'
}

@click="toggleMyIssues"
:class="[
'px-3 py-1.5 text-sm rounded-md transition-colors',
myIssuesOnly
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Use the sourceProjectFilter directly to determine the active state of the button, avoiding redundant local state.

            sourceProjectFilter === 'dashboard'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant