Skip to content

[20761] Add command history navigation in user interface #128

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

Closed
wants to merge 6 commits into from

Conversation

LuciaEchevarria99
Copy link
Contributor

This PR introduces the capability to navigate command history within the graphical interface of the application. Users can now utilize the arrow keys to traverse through previously entered commands. Key Changes:

  • CommandHistoryHandler Class: A new class, CommandHistoryHandler, has been created to manage the history of commands. This class handles adding commands to history, as well as retrieving the previous and next commands.

  • Integration with StdinEventHandler: The StdinEventHandler class has been updated to utilize the CommandHistoryHandler. When the user presses the up or down arrow keys, the application fetches the appropriate command from the history and displays it in the input area.

@LuciaEchevarria99 LuciaEchevarria99 changed the title Add command history navigation in user interface [20761] Add command history navigation in user interface Oct 8, 2024
@codecov-commenter
Copy link

codecov-commenter commented Apr 10, 2025

Codecov Report

Attention: Patch coverage is 40.90909% with 39 lines in your changes missing coverage. Please review.

Project coverage is 64.82%. Comparing base (328d165) to head (627766c).

Files with missing lines Patch % Lines
cpp_utils/src/cpp/event/StdinEventHandler.cpp 44.44% 22 Missing and 3 partials ⚠️
...pp_utils/src/cpp/history/CommandHistoryHandler.cpp 33.33% 13 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #128      +/-   ##
==========================================
- Coverage   65.97%   64.82%   -1.16%     
==========================================
  Files          64       65       +1     
  Lines        1699     1757      +58     
  Branches      484      496      +12     
==========================================
+ Hits         1121     1139      +18     
- Misses        278      314      +36     
- Partials      300      304       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Signed-off-by: Denisa <[email protected]>
@Danipiza
Copy link

[LINUX]

Visual Bug

When navigating throw the history commands, and one of them does not enters in a single line, if you move to a previous or next command it keeps the line in the terminal.


Visual_Bug


As the screenshot show, when executing a command that needs two lines because the terminal does not have the space to display it in the same line, moving to a different command keeps the line (that did not fit) in the terminal.

@Danipiza
Copy link

The previous "Visual Bug" comment also applies to the windows implementation.

@Danipiza
Copy link

[LINUX & WINDOWS]

Bug: Commit Hash in "version" command

(This also occurs in the main branch)

When executing the version command, it displays the version correctly, but the commit hash do not. In fact, the printed hash does not even exists. (commit hash: 70e023b7c57d7a9f66b7f726c50e8b730bdacdf0)


fastddsspy_version

@Danipiza
Copy link

[LINUX & WINDOWS]

When executing an echo command, if the user inputs characters before pressing enter (to stop the printing process), it stores the input in the history commands.


echo_commands_enter


As the screenshot show, the 'a' char is pressed before enter and the history keeps the character.

echo commands

echo <name>                     : data of a specific Topic (Data Type must be discovered).
echo <wildcard_name>            : data of Topics matching the wildcard name (and whose Data Type is discovered).
echo <name> verbose             : data with additional source info of a specific Topic.
echo <wildcard_name> verbose    : data with additional source info of Topics matching the topic name (wildcard allowed (*)).
echo all                        : verbose data of all topics (only those whose Data Type is discovered).

@depink5
Copy link
Contributor

depink5 commented May 5, 2025

[LINUX & WINDOWS]

Bug: Commit Hash in "version" command

(This also occurs in the main branch)

When executing the version command, it displays the version correctly, but the commit hash do not. In fact, the printed hash does not even exists. (commit hash: 70e023b7c57d7a9f66b7f726c50e8b730bdacdf0)

fastddsspy_version

This has nothing to do with the PR. Furthermore, it works perfectly. This is the commit that it was referencing: eProsima/Fast-DDS-spy@70e023b

@Danipiza
Copy link

Danipiza commented May 7, 2025

[LINUX & WINDOWS]

Bug: Commit Hash in "version" command

(This also occurs in the main branch)
When executing the version command, it displays the version correctly, but the commit hash do not. In fact, the printed hash does not even exists. (commit hash: 70e023b7c57d7a9f66b7f726c50e8b730bdacdf0)
fastddsspy_version

This has nothing to do with the PR. Furthermore, it works perfectly. This is the commit that it was referencing: eProsima/Fast-DDS-spy@70e023b

Ok!

Copy link
Contributor

@depink5 depink5 left a comment

Choose a reason for hiding this comment

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

All changes suggested by @Danipiza are made in the following PR: #136

@rsanchez15
Copy link
Collaborator

@rsanchez15 rsanchez15 closed this May 13, 2025
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.

5 participants