[PR #1025] [CLOSED] Fix tag pin/unpin not updating UI in ListBoxTags #3864

Closed
opened 2026-03-13 13:02:18 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/1Remote/1Remote/pull/1025
Author: @Copilot
Created: 11/15/2025
Status: Closed

Base: mainHead: copilot/fix-listbox-tags-visibility


📝 Commits (2)

  • 6de91e4 Initial plan
  • d37bdc6 Fix tag pinning UI synchronization issue

📊 Changes

2 files changed (+10 additions, -0 deletions)

View changed files

📝 Ui/Model/GlobalData_Tag.cs (+9 -0)
📝 Ui/Model/Tag.cs (+1 -0)

📄 Description

When toggling IsPinned on a tag, the UI sometimes fails to show/hide the tag in the header bar. The property change on the Tag object doesn't propagate to observers watching GlobalData.TagList.

Changes

  • GlobalData_Tag.cs: Add RaiseTagListChanged() method to notify TagList property observers
  • Tag.cs: Call RaiseTagListChanged() in IsPinned setter after state change

Flow

// Tag.cs IsPinned setter
if (SetAndNotifyIfChanged(ref _isPinned, value))
{
    // ... reorder logic ...
    LocalityTagService.UpdateTags(IoC.Get<GlobalData>().TagList);
    IoC.Get<ServerListPageViewModel>().CalcTagFilterBarVisibility();
    IoC.Get<GlobalData>().RaiseTagListChanged();  // ← triggers OnGlobalDataTagListChanged()
}

This ensures ServerPageViewModelBase.OnGlobalDataTagListChanged() rebuilds HeaderTags from TagList.Where(x => x.IsPinned), updating the UI binding.

Original prompt

现在发现,当 TagActionHelper.cs 的 t.IsPinned = !t.IsPinned; 执行后,ServerListPageView.xaml 中 ListBoxTags 对应的 tag有时候不会相应的显示或隐藏。这个bug并不是总会触发,而是比如总共4个tag可能其中的3个正常而剩下一个不会在t.IsPinned = !t.IsPinned;后在界面上对应的显示或隐藏。
在修改这个bug时,你可以先根据#1013的讨论和


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/1Remote/1Remote/pull/1025 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 11/15/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `copilot/fix-listbox-tags-visibility` --- ### 📝 Commits (2) - [`6de91e4`](https://github.com/1Remote/1Remote/commit/6de91e4e4c3e6e3adde8b96bd6c5556150580417) Initial plan - [`d37bdc6`](https://github.com/1Remote/1Remote/commit/d37bdc60712ed026bd8f80c29be40245f0bcba60) Fix tag pinning UI synchronization issue ### 📊 Changes **2 files changed** (+10 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `Ui/Model/GlobalData_Tag.cs` (+9 -0) 📝 `Ui/Model/Tag.cs` (+1 -0) </details> ### 📄 Description When toggling `IsPinned` on a tag, the UI sometimes fails to show/hide the tag in the header bar. The property change on the `Tag` object doesn't propagate to observers watching `GlobalData.TagList`. ## Changes - **GlobalData_Tag.cs**: Add `RaiseTagListChanged()` method to notify `TagList` property observers - **Tag.cs**: Call `RaiseTagListChanged()` in `IsPinned` setter after state change ## Flow ```csharp // Tag.cs IsPinned setter if (SetAndNotifyIfChanged(ref _isPinned, value)) { // ... reorder logic ... LocalityTagService.UpdateTags(IoC.Get<GlobalData>().TagList); IoC.Get<ServerListPageViewModel>().CalcTagFilterBarVisibility(); IoC.Get<GlobalData>().RaiseTagListChanged(); // ← triggers OnGlobalDataTagListChanged() } ``` This ensures `ServerPageViewModelBase.OnGlobalDataTagListChanged()` rebuilds `HeaderTags` from `TagList.Where(x => x.IsPinned)`, updating the UI binding. <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > 现在发现,当 TagActionHelper.cs 的 t.IsPinned = !t.IsPinned; 执行后,ServerListPageView.xaml 中 ListBoxTags 对应的 tag有时候不会相应的显示或隐藏。这个bug并不是总会触发,而是比如总共4个tag可能其中的3个正常而剩下一个不会在t.IsPinned = !t.IsPinned;后在界面上对应的显示或隐藏。 > 在修改这个bug时,你可以先根据#1013的讨论和 </details> <!-- START COPILOT CODING AGENT TIPS --> --- 💬 We'd love your input! Share your thoughts on Copilot coding agent in our [2 minute survey](https://gh.io/copilot-coding-agent-survey). --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-13 13:02:18 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/1Remote#3864
No description provided.