Skip to content

Conversation

kiitosu
Copy link
Contributor

@kiitosu kiitosu commented May 11, 2025

📑 Summary

articleの表示順をタイトル順でソートするようにしました。
以下に作業内容を整理しました。

Resolves #

📋 Tasks

プルリクエストを作成いただく際、お手数ですが以下の内容についてご確認をお願いします。

  • 📖 Contribution Guide を読んだ
  • 👩‍💻 canary ブランチに対するプルリクエストである
  • 実行して正しく動作しているか確認する
  • 不要なコードが含まれていないか( コメントやログの消し忘れに注意 )
  • XSS になるようなコードが含まれていないか
  • Pull Reuqest の内容は妥当か( 膨らみすぎてないか )

より詳しい内容は Pull Request Policy を参照してください。

@cm-igarashi-ryosuke
Copy link
Member

@kiitosu ご提案ありがとうございます!また、ご連絡が遅くなりすみません。順次確認しますのでお待ち下さい 🙏

@cm-wada-yusuke
Copy link
Member

cm-wada-yusuke commented Jun 9, 2025

@kiitosu 実装ありがとうございます!タイトルで並び替えられるのはわかりやすくていいですね。
従来のパス順前提でファイル名を組んでいるパターン(2025-02-02-articleとか)もあるため、デフォルトを変えるとびっくりする人もいるかもしれません。何でソートするか選べるようにすることは可能ですか?こちらでディスカッションできればと思います。

#124

@kiitosu
Copy link
Contributor Author

kiitosu commented Jun 10, 2025

@cm-igarashi-ryosuke
以下で設定を追加しました!

title-sort

Copy link

@Copilot Copilot AI left a comment

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 updates the article sorting behavior to allow sorting by title instead of the default file path order.

  • Introduces a new configuration (zenn-preview.sortArticle) that enables title-based sorting.
  • Modifies the PreviewTreeItem.sortTreeItems method to remove emojis from labels before sorting.
  • Updates package.json to define the new configuration option with enum values.

Reviewed Changes

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

File Description
src/treeview/previewTreeItem.ts Updated sorting logic to support title-based sorting.
package.json Added configuration definition for sortArticle option.

const aCleanLabel = getCleanLabel(a);
const bCleanLabel = getCleanLabel(b);

if (aCleanLabel || bCleanLabel) {
Copy link

Copilot AI Jun 16, 2025

Choose a reason for hiding this comment

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

[nitpick] Consider using an explicit non-empty string check (e.g., aCleanLabel !== '' || bCleanLabel !== '') to clarify the intended condition and improve code readability for future maintainers.

Suggested change
if (aCleanLabel || bCleanLabel) {
if (aCleanLabel !== '' || bCleanLabel !== '') {

Copilot uses AI. Check for mistakes.

@cm-igarashi-ryosuke
Copy link
Member

@kiitosu ご対応いただきありがとうございます!

内容自体は良さそうですが、package.json のインデントが2から4に変わっているため差分が分かりにくくなっています。お手数ですがインデント2に修正をお願いいたします 🙇

@cm-igarashi-ryosuke cm-igarashi-ryosuke self-requested a review June 16, 2025 02:28
@kiitosu
Copy link
Contributor Author

kiitosu commented Jun 16, 2025

@cm-igarashi-ryosuke

すみません気づいてませんでした!
修正しました 👍

@cm-wada-yusuke
Copy link
Member

@kiitosu 忘れていないです、すいません、もう少々お待ち下さい🙇

Copy link
Member

@cm-wada-yusuke cm-wada-yusuke left a comment

Choose a reason for hiding this comment

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

おまたせしました!コメントについて確認し、必要に応じて取り入れていただけるでしょうか?ロジックはよさそうです!ありがとうございます。

Co-authored-by: Yusuke Wada <[email protected]>
@kiitosu
Copy link
Contributor Author

kiitosu commented Jun 30, 2025

pakcage.jsonの最後は改行で終わったほうが良いということですね。取り入れました!

@cm-wada-yusuke cm-wada-yusuke self-requested a review July 11, 2025 08:16
Copy link
Member

@cm-wada-yusuke cm-wada-yusuke left a comment

Choose a reason for hiding this comment

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

わたしはLGTMです!

@cm-wada-yusuke cm-wada-yusuke merged commit 36ff36d into zenn-dev:canary Jul 29, 2025
1 check passed
cm-wada-yusuke added a commit that referenced this pull request Aug 8, 2025
cm-wada-yusuke added a commit to cm-wada-yusuke/zenn-vscode-extension that referenced this pull request Aug 8, 2025
…t_with_titles

記事のソートをタイトル順にする
kiitosu pushed a commit to kiitosu/zenn-vscode-extension that referenced this pull request Aug 8, 2025
…t_with_titles

記事のソートをタイトル順にする
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.

3 participants