message: Show the Create Tag button the filter text isn't matched with any tags (mac)
diff: @@ -47,31 +47,38 @@ final class TagDataSource: AutoCompleteViewDataSource {
  // show all
  if text.isEmpty {
  - render(with: TagStorage.shared.tags)
  + renderTagsAndCreateBtn(TagStorage.shared.tags, with: text)
  return
  }
  // Filter
  let filterItems = TagStorage.shared.filter(with: text)
  - render(with: filterItems)
  + renderTagsAndCreateBtn(filterItems, with: text)
  }
  - override func render(with items: [Any]) {
  - super.render(with: items)
  + func updateSelectedTags(_ tags: [Tag]) {
  + self.selectedTags = tags
  + }
  +
  + private func renderTagsAndCreateBtn(_ tags: [Tag], with text: String) {
  + render(with: tags)
  +
  + // Determine if it should present the Create btn
  + var shouldShowCreateBtn = false
  + if let first = tags.first, first.isEmptyTag {
  + shouldShowCreateBtn = true
  + } else if !text.isEmpty && !tags.contains(where: { $0.name == text }) {
  + shouldShowCreateBtn = true
  + }
  - // Hide create if it's has content
  - if let first = items.first as? Tag, first.isEmptyTag {
  + if shouldShowCreateBtn {
  autoCompleteView.setCreateButtonSectionHidden(false)
  - autoCompleteView.updateTitleForCreateButton(with: "Create new tag \"\(textField.stringValue)\"")
  + autoCompleteView.updateTitleForCreateButton(with: "Create new tag \"\(text)\"")
  } else {
  autoCompleteView.setCreateButtonSectionHidden(true)
  }
  }
  - func updateSelectedTags(_ tags: [Tag]) {
  - self.selectedTags = tags
  - }
  -
  // MARK: Public
  override func tableView(_ tableView: NSTableView, viewFor tableColumn: NSTableColumn?, row: Int) -> NSView? {
  