Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UX: Messages: Use "Newest" as default mode #579

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

polegkashti
Copy link
Contributor

  • Breaking change? (if so, please describe the impact and migration path for existing application instances)

What changes did you make? (Give an overview)
Simply chaned the default filter mode.

Is there anything you'd like reviewers to focus on?
Hi, I’ve noticed that other users have also expressed a need for this change, and some of our Kafka users specifically mentioned it. I believe it’s a great idea to modify the default mode, as it aligns better with Kafka's real-time streaming nature.

How Has This Been Tested? (put an "x" (case-sensitive!) next to an item)

  • No need to
  • Manually (please, describe, if necessary)
  • Unit checks
  • Integration checks
  • Covered by existing automation

Checklist (put an "x" (case-sensitive!) next to all the items, otherwise the build will fail)

  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation (e.g. ENVIRONMENT VARIABLES)
  • My changes generate no new warnings (e.g. Sonar is happy)
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged

Check out Contributing and Code of Conduct

A picture of a cute animal (not mandatory but encouraged)
gamer cat

@polegkashti polegkashti requested a review from a team as a code owner October 6, 2024 19:12
@kapybro kapybro bot added status/triage Issues pending maintainers triage status/triage/manual Manual triage in progress status/triage/completed Automatic triage completed and removed status/triage Issues pending maintainers triage labels Oct 6, 2024
@polegkashti
Copy link
Contributor Author

resolves #570

@Haarolean Haarolean linked an issue Oct 6, 2024 that may be closed by this pull request
2 tasks
@Haarolean Haarolean added type/enhancement En enhancement/improvement to an already existing feature scope/frontend Related to frontend changes area/ux User experiense issues and removed status/triage/manual Manual triage in progress labels Oct 6, 2024
@Haarolean Haarolean changed the title Use "Newest" as default mode (Closes #570) UX: Messages: Use "Newest" as default mode Oct 6, 2024
@Haarolean Haarolean added the hacktoberfest-accepted PRs accepted towards hacktoberfest goal and will be counted as approved label Oct 6, 2024
@fallen-up
Copy link

fallen-up commented Oct 7, 2024

i tried to solve the problem this way. as a result "Newest" is displayed in the UI, but sometimes the messages are empty. only changing to "Oldest" and then back to "Newest" helps.

@Haarolean
Copy link
Member

i tried to solve the problem this way. as a result "Newest" is displayed in the UI, but sometimes the messages are empty. only changing to "Oldest" and then back to "Newest" helps.

should be working, as we have const defaultModeValue = ModeOptions[0].value; in useMEssageFilters.ts. @polegkashti can you confirm?

@polegkashti
Copy link
Contributor Author

i tried to solve the problem this way. as a result "Newest" is displayed in the UI, but sometimes the messages are empty. only changing to "Oldest" and then back to "Newest" helps.

should be working, as we have const defaultModeValue = ModeOptions[0].value; in useMEssageFilters.ts. @polegkashti can you confirm?

Based on my testing, everything is functioning properly, and I don't see any reason for this issue to occur.

@fallen-up
Copy link

fallen-up commented Oct 7, 2024

i have tested both options (they are essentially identical).
1)

export const ModeOptions = [
  { value: PollingMode.EARLIEST, label: 'Oldest' },
  { value: PollingMode.LATEST, label: 'Newest' },
  { value: PollingMode.TAILING, label: 'Live' },
  { value: PollingMode.FROM_OFFSET, label: 'From offset' },
  { value: PollingMode.TO_OFFSET, label: 'To offset' },
  { value: PollingMode.FROM_TIMESTAMP, label: 'Since time' },
  { value: PollingMode.TO_TIMESTAMP, label: 'To time' },
];

in frontend/src/lib/hooks/filterUtils.ts
+
const defaultModeValue = ModeOptions[1].value;
in frontend/src/lib/hooks/useMessagesFilters.ts
2)

export const ModeOptions = [
  { value: PollingMode.LATEST, label: 'Newest' },
  { value: PollingMode.EARLIEST, label: 'Oldest' },
  { value: PollingMode.TAILING, label: 'Live' },
  { value: PollingMode.FROM_OFFSET, label: 'From offset' },
  { value: PollingMode.TO_OFFSET, label: 'To offset' },
  { value: PollingMode.FROM_TIMESTAMP, label: 'Since time' },
  { value: PollingMode.TO_TIMESTAMP, label: 'To time' },
];

in frontend/src/lib/hooks/filterUtils.ts
+
const defaultModeValue = ModeOptions[0].value;
in frontend/src/lib/hooks/filterUtils.ts

the result is the same. sometimes it works (in most cases), sometimes it doesn't. maybe there is some other forgotten part of the code?
newest

p.s.: it's not compacted topic

@polegkashti
Copy link
Contributor Author

I tested the change again with a variety of messages and was unable to reproduce the issue. Additionally, I reviewed the codebase for any other references to the "Newest" filter and found no related components.

Given this, I believe there isn't a valid reason to withhold approval for this pull request. If the issue continues to affect you, I recommend opening a new issue with more details to help us investigate further :)

@Haarolean Haarolean merged commit 19b13ea into kafbat:main Oct 16, 2024
10 of 12 checks passed
@Haarolean
Copy link
Member

@polegkashti thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ux User experiense issues hacktoberfest-accepted PRs accepted towards hacktoberfest goal and will be counted as approved scope/frontend Related to frontend changes status/triage/completed Automatic triage completed type/enhancement En enhancement/improvement to an already existing feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

UX: Messages: Use "Newest" as default mode
3 participants