[PR #1019] [CLOSED] Fix pinned tags disappearing when not associated with any server #2865

Closed
opened 2026-03-01 17:23:33 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

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

Base: mainHead: copilot/investigate-issue-1013


📝 Commits (2)

📊 Changes

1 file changed (+9 additions, -0 deletions)

View changed files

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

📄 Description

Pinned tags were lost after restart if no servers used them. The issue occurs because ReloadTagsFromServers() only populates TagList with tags from active servers, but the header bar filters TagList for pinned tags.

Changes

Modified Ui/Model/GlobalData_Tag.cs:

  • Added loop to include pinned tags from TagDict even when not used by servers
  • Set ItemsCount = 0 for unused pinned tags
// Add pinned tags that are not currently used by any server
foreach (var savedTag in LocalityTagService.TagDict.Values)
{
    if (savedTag.IsPinned && tags.All(x => !string.Equals(x.Name, savedTag.Name, StringComparison.CurrentCultureIgnoreCase)))
    {
        tags.Add(new Tag(savedTag.Name, savedTag.IsPinned, savedTag.CustomOrder) { ItemsCount = 0 });
    }
}

This ensures pinned tags persist in the header bar regardless of server associations while preserving their custom order and pinned state.

Original prompt

check discussion in #1013, find the issue reason


💬 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/1019 **Author:** [@Copilot](https://github.com/apps/copilot-swe-agent) **Created:** 11/10/2025 **Status:** ❌ Closed **Base:** `main` ← **Head:** `copilot/investigate-issue-1013` --- ### 📝 Commits (2) - [`3264384`](https://github.com/1Remote/1Remote/commit/3264384e3a851cc1434d23214e5684a11e1bc722) Initial plan - [`6c34829`](https://github.com/1Remote/1Remote/commit/6c3482967b7fbbc5c78f2767440923240764c31f) Fix pinned tags not showing after restart (issue #1013) ### 📊 Changes **1 file changed** (+9 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `Ui/Model/GlobalData_Tag.cs` (+9 -0) </details> ### 📄 Description Pinned tags were lost after restart if no servers used them. The issue occurs because `ReloadTagsFromServers()` only populates `TagList` with tags from active servers, but the header bar filters `TagList` for pinned tags. ## Changes Modified `Ui/Model/GlobalData_Tag.cs`: - Added loop to include pinned tags from `TagDict` even when not used by servers - Set `ItemsCount = 0` for unused pinned tags ```csharp // Add pinned tags that are not currently used by any server foreach (var savedTag in LocalityTagService.TagDict.Values) { if (savedTag.IsPinned && tags.All(x => !string.Equals(x.Name, savedTag.Name, StringComparison.CurrentCultureIgnoreCase))) { tags.Add(new Tag(savedTag.Name, savedTag.IsPinned, savedTag.CustomOrder) { ItemsCount = 0 }); } } ``` This ensures pinned tags persist in the header bar regardless of server associations while preserving their custom order and pinned state. <!-- START COPILOT CODING AGENT SUFFIX --> <details> <summary>Original prompt</summary> > check discussion in #1013, find the issue reason </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-01 17:23:33 +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#2865
No description provided.