Skip to content

[AREV-313] (ignore) incremental review test4. add QuickActionsButton to home page with tests#1861

Open
mchun2288 wants to merge 2 commits into
mainfrom
incremental-review-test2
Open

[AREV-313] (ignore) incremental review test4. add QuickActionsButton to home page with tests#1861
mchun2288 wants to merge 2 commits into
mainfrom
incremental-review-test2

Conversation

@mchun2288

@mchun2288 mchun2288 commented Jun 9, 2026

Copy link
Copy Markdown
Contributor
  • Add new QuickActionsButton component with primary/secondary variants
  • Add New Chat button to RovoDevLanding home page
  • Add onNewChat prop to RovoDevLanding component
  • Add unit tests for QuickActionsButton and getDefaultQuickActionLabel

What Is This Change?

How Has This Been Tested?

Basic checks:

  • npm run lint
  • npm run test

Advanced checks:

  • If Atlassian employee & Bitbucket changes: did you test with DC in mind? See Instructions

Recommendations:

  • Update the CHANGELOG if making a user facing change

Rovo Dev code review: Rovo Dev has reviewed this pull request
Any suggestions or improvements have been posted as pull request comments.

- Add new QuickActionsButton component with primary/secondary variants
- Add New Chat button to RovoDevLanding home page
- Add onNewChat prop to RovoDevLanding component
- Add unit tests for QuickActionsButton and getDefaultQuickActionLabel
onKeyDown={onKeyDownHandler(handleClick)}
disabled={disabled}
aria-label={label}
role="button"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔎 Code Readability

The role="button" attribute is redundant on a native <button> element, which already has an implicit ARIA role of button.

Details

📖 Explanation: Redundant role attributes add noise and can confuse accessibility tooling.

Suggested change
role="button"

Uses AI. Verify results. Give Feedback

Comment on lines +69 to +70
// BUG: missing assertion - no expect call here
getDefaultQuickActionLabel('');

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔎 Testing

This test has no expect call, so it will always pass regardless of the function's behaviour and provides no coverage.

Details

📖 Explanation: A test without an assertion is a confirmed bug in the test suite — the empty-string case is untested.

Suggested change
// BUG: missing assertion - no expect call here
getDefaultQuickActionLabel('');
expect(getDefaultQuickActionLabel('')).toBe('Quick Action');

Uses AI. Verify results. Give Feedback

if (!summary) {
return '';
}
const trimmed = summary.trim(;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔥 Code Bugs

Syntax error: summary.trim( is missing the closing parenthesis ), which will cause a compilation failure.

Details

📖 Explanation: The method call summary.trim( is missing its closing parenthesis, making this code syntactically invalid TypeScript.

Suggested change
const trimmed = summary.trim(;
const trimmed = summary.trim();

Uses AI. Verify results. Give Feedback

};
// BUG: should use actionType as key, not actionType.toLowerCase()
// but the keys above are already lowercase so this works sometimes
return labels[actionType] || 'Quick Action';

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔥 Code Bugs

getDefaultQuickActionLabel looks up actionType directly, but all map keys are lowercase — callers passing 'Explain' or 'NewChat' will always fall through to the 'Quick Action' fallback; apply .toLowerCase() before the lookup.

Details

📖 Explanation: The labels map has only lowercase keys, but the function doesn't normalize the input, causing case-sensitive mismatches.

Suggested change
return labels[actionType] || 'Quick Action';
return labels[actionType.toLowerCase()] || 'Quick Action';

Uses AI. Verify results. Give Feedback

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.

1 participant