Skip to content

Show query time and fix context name in recent queries - #12

Open
skimmilk09 wants to merge 1 commit into
liffiton:mainfrom
skimmilk09:recent-queries-context-time
Open

Show query time and fix context name in recent queries#12
skimmilk09 wants to merge 1 commit into
liffiton:mainfrom
skimmilk09:recent-queries-context-time

Conversation

@skimmilk09

Copy link
Copy Markdown

The context name never showed up in the recent queries list. The template checked prev.context_name, but get_queries() in code_queries/data.py selects that column as t.context_name AS context, so the condition was always false.

I also added the query timestamp above the context line, using the existing localtime filter (t.query_time AS time).

Both changes are in one commit since they touch the same few lines, but I can split them if you'd rather review them separately.

mypy passes (90 files) and pytest passes (170 tests) locally.

I wasn't sure about the placement or styling of the timestamp, so let me know if you want it somewhere else in the entry.

The context name never showed up because the template used prev.context_name,
but get_queries() aliases that column to 'context', so the check was always
false. Also add the query timestamp using the existing localtime filter.
@github-actions

github-actions Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@skimmilk09

Copy link
Copy Markdown
Author

I have read and hereby sign the CLA.

github-actions Bot added a commit that referenced this pull request Aug 6, 2026
@liffiton

liffiton commented Aug 8, 2026

Copy link
Copy Markdown
Owner

Thanks! Looks better. Looking at the design now that the context actually shows up, I think I'd like the context deemphasized a bit like the date is now. So maybe put it in the same line with the date, same formatting, and, if a context is present, separated by a pipe character (see if that looks alright) from the date. So "2026-08-03 | Context: whatever" maybe.

And something to look at next if you have time is the consistency between the designs for recent queries in Code Q&A and recent chats in the Tutors component. Doesn't have to be in this PR, necessarily, though could be if you want to fold it in.

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