Skip to content

Conversation

@msmithstubbs
Copy link
Contributor

@msmithstubbs msmithstubbs commented Dec 2, 2025

This PR adds support for displaying fields selected as part of a query in the search results list.

The last nested path key is used as the label, unless an alias is specified. Labels are truncated if necessary.

If a select rule is used the modal link (view, context, etc) are moved underneath the select fields.

CleanShot 2025-12-15 at 10 16 41@2x

They remain inline, after the log event message, when select rules are not used.

CleanShot 2025-12-15 at 10 18 59@2x

Also

  • convert SearchLV EEx templates have been converted to HEEx components
  • convert live_modal_show_link to a function component and update references.

@msmithstubbs msmithstubbs force-pushed the feat/search-results-select-fields branch 2 times, most recently from cb3db79 to 759db1a Compare December 3, 2025 02:12
@msmithstubbs msmithstubbs marked this pull request as ready for review December 3, 2025 02:54
@msmithstubbs msmithstubbs changed the title WIP: display select fields in search results feat: display select fields in search results Dec 3, 2025
@Ziinc
Copy link
Contributor

Ziinc commented Dec 4, 2025

CleanShot 2025-12-04 at 15 41 54@2x @msmithstubbs can we adjust the ui to something like this: - action button links below the selected fields (if any), otherwise inline with the event message - shift the field path to be in the timestamp column and styled as label - no opinion on colors, though secondary or link-red might work.

haven't reviewed code yet, but copying the log line should also copy the selected fields

Copy link
Contributor

@Ziinc Ziinc left a comment

Choose a reason for hiding this comment

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

mostly styling adjustments


assert html =~ "metadata.user_id:"
assert html =~ "user_123"
assert html =~ "metadata.store.city:"
Copy link
Contributor

Choose a reason for hiding this comment

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

should also consider long field paths, in case it execeds timestamp col width, would need to truncate with ...

phx-click={
JS.dispatch("logflare:copy-to-clipboard",
detail: %{
text: "#{LogflareWeb.SearchLive.LogEventComponents.formatted_timestamp(log, assigns[:search_timezone])} #{log.body["event_message"]}"
Copy link
Contributor

Choose a reason for hiding this comment

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

woudl need to include selected fields, each as a new line.

my.field: value

long_field:
.....
`
- inline if <=64 char
- newline if longer

@msmithstubbs
Copy link
Contributor Author

msmithstubbs commented Dec 8, 2025

CleanShot 2025-12-09 at 09 00 22@2x

Moved the field names under timestamp and links under select fields. The select field name is truncated in the middle if too long.

How's that now @Ziinc ?

(Haven't updated the code yet.)

@Ziinc
Copy link
Contributor

Ziinc commented Dec 9, 2025

@msmithstubbs can we take the first key and last key? truncating the middle key halfway looks odd

@msmithstubbs
Copy link
Contributor Author

truncating the middle key halfway looks odd

Yeah, you're right. I'm overthinking it. I was trying to keep the end of the key visible as that's more useful than "metadata...". But even if we go with first and last key they may be keys that are too long.

I suggest simplify and just truncate. If the fields are hard to read truncated you can always use an alias (s:m.my.deeply.nested.field.user.id@user_id)

CleanShot 2025-12-10 at 16 20 54@2x

?

@Ziinc
Copy link
Contributor

Ziinc commented Dec 10, 2025

yes lets go with the last field of the path. for the case where the field is long, then we can simply truncate, that is fine.

@msmithstubbs msmithstubbs force-pushed the feat/search-results-select-fields branch 3 times, most recently from 48a5e20 to fdd253d Compare December 15, 2025 02:03
@msmithstubbs msmithstubbs force-pushed the feat/search-results-select-fields branch from fdd253d to d914b73 Compare January 4, 2026 22:48
@msmithstubbs msmithstubbs force-pushed the feat/search-results-select-fields branch from 53cdac0 to a864576 Compare January 7, 2026 05:31
@Ziinc Ziinc merged commit bee5779 into Logflare:main Jan 7, 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