Skip to content

docs: sort memos by updated_at in fzf-lua example#23

Merged
Cassin01 merged 1 commit into
mainfrom
docs/sort-memos-by-updated-at
Feb 16, 2026
Merged

docs: sort memos by updated_at in fzf-lua example#23
Cassin01 merged 1 commit into
mainfrom
docs/sort-memos-by-updated-at

Conversation

@Cassin01
Copy link
Copy Markdown
Owner

Summary

  • Add table.sort by updated_at (descending) to the fzf-lua memo listing example in README so memos appear most recently modified first.

Test plan

  • Visual review: only the 4-line sort block is added
  • make test passes (README is not compiled)

🤖 Generated with Claude Code

Add table.sort on entries by updated_at (descending) in the
fzf-lua memo listing example so memos appear most recently
modified first.
Copilot AI review requested due to automatic review settings February 16, 2026 05:20
Copy link
Copy Markdown
Contributor

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

Updates the README’s fzf-lua integration example to show memos in a “most recently modified first” order.

Changes:

  • Adds an optional table.sort block to sort memo picker entries by updated_at (descending) in the README example.

Comment thread README.md
local entries = api.get_memos()
-- OPTION: Sort by last modified time (most recent first)
table.sort(entries, function(a, b)
return (a.updated_at or 0) > (b.updated_at or 0)
Copy link

Copilot AI Feb 16, 2026

Choose a reason for hiding this comment

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

The api.get_memos() entries don’t include an updated_at field (they have value, text, ordinal, info, tags), so this sort block will effectively no-op and is misleading in the README. If the goal is “last modified”, compute it from the filepath (e.g., using vim.fn.getftime(entry.value) / vim.uv.fs_stat(entry.value).mtime) or update the API to expose an mtime field and document that instead.

Suggested change
return (a.updated_at or 0) > (b.updated_at or 0)
local a_mtime = vim.fn.getftime(a.value)
local b_mtime = vim.fn.getftime(b.value)
return a_mtime > b_mtime

Copilot uses AI. Check for mistakes.
@Cassin01 Cassin01 merged commit 1bb3548 into main Feb 16, 2026
7 checks passed
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.

2 participants