Skip to content

Fix: Prompt Details UI Improvements#25

Merged
MatFillion merged 7 commits intomainfrom
msyo/fix-prompt-details
Jan 8, 2026
Merged

Fix: Prompt Details UI Improvements#25
MatFillion merged 7 commits intomainfrom
msyo/fix-prompt-details

Conversation

@mohamedsedkiyouzbechi
Copy link
Contributor

@mohamedsedkiyouzbechi mohamedsedkiyouzbechi commented Jan 8, 2026

This PR addresses UI/UX issues in the prompt details webview to improve user experience and consistency.

BUG 1: Empty blank details view display on load

When the prompt details panel was first loaded, it showed a blank details view (like there is a selected prompt, but with empty details) instead of the expected empty state message.

Steps to Reproduce:

  • Open VS Code.
  • Open the Promptitude extension, then the prompt details panel will be opened for the first time.
  • Observe the panel before selecting any prompt.

Expected Behavior:
=> Display empty state with message "No Prompt Selected..."

Actual Behavior:
=> Blank details view was displayed with the empty state message.

Fix:
=> Initialize webview with clearPrompt() call to properly display empty state on load.

BUG 2: Content Editing and Empty State Persistence

The prompt content was editable (should be read-only) and the empty state would persist after selecting a prompt.

Steps to Reproduce:

  • Open the prompt details panel.
  • Select a prompt from the tree view.
  • (1): Observe the content in the textarea is esitable.
  • (2): Observe if empty state disappears.

Expected Behavior:

  • Content should be read-only (view-only mode).
  • Empty state should be hidden when a prompt is selected

Actual Behavior:
=> Content was editable && empty state could persist after selection.

Fix:
=> Added readonly attribute to content textarea && properly hide empty state when showing prompt details.

BUG 3: Activate Button Styling

The activate button in the prompt details view was not properly styled when a prompt was inactive.

Steps to Reproduce:

  • Navigate to the Prompts tree view.
  • Select a prompt that is not activated (inactive prompt).
  • Observe the activate button in the prompt details panel.

Expected Behavior:
=> Button should be blue (primary style) with a "+" icon at the center.

Actual Behavior:
=> Button displayed with default secondary styling.

Fix:

  • Added .activate CSS class for inactive state with primary button colors.
  • Updated updateSelectionButton() to properly toggle between activate and selected classes.
    => Button now correctly displays:
    Inactive state: Blue background with "+" icon.
    Active state: Green background with "✓" icon.

Additional Fix

Fixed marketplace icon not displaying:
Added top-level icon property in package.json pointing to PNG file (resources/promptitude-icon.png) to ensure the extension icon displays correctly on VS Code Extensions Marketplace.
The marketplace requires a separate PNG icon (minimum 128x128 pixels) in addition to the SVG icon used for the Activity Bar.

Screenshots

PR description images:


Before: Old Prompt details After: New Prompt details
image image

Summary by CodeRabbit

  • Style

    • Added a new activated button appearance (distinct background, border, and hover state; updated activate/plus visual).
  • Refactor

    • Prompt details view now initializes showing the empty state by default.
    • Prompt content is read-only; inline save/reset editing controls and unsaved-change tracking removed.
    • Selection toggle simplified to a clearer activate/plus state.
  • Chores

    • Package updated to 1.5.3 and top-level icon added.

✏️ Tip: You can customize this high-level summary in your review settings.

Copilot AI review requested due to automatic review settings January 8, 2026 12:02
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 8, 2026

Walkthrough

Adds a new .action-button.activate CSS variant and refactors the prompt details webview: removes inline save/reset actions and unsaved-changes tracking, makes the content textarea readonly, simplifies the selection toggle to an activate-style control, and calls clearPrompt() on load.

Changes

Cohort / File(s) Summary
Button styling variant
media/main.css
Adds .action-button.activate and hover state: sets background, text color, and border to match the button palette; hover background adjusted.
Webview UI and state refactor
src/ui/promptDetailsWebview.ts
Removes inline save/reset controls and in-webview unsaved-change tracking (originalContent, hasUnsavedChanges); makes prompt content textarea readonly; simplifies selection toggle to an activate/plus-style control; calls clearPrompt() on load; adjusts empty-state visibility and HTML template layout.
Changelog update
CHANGELOG.md
Adds Unreleased 1.5.3 section and updates 1.5.2 notes (metadata/content descriptions updated).
Package metadata
package.json
Bumps version to 1.5.3 and adds top-level icon field pointing to resources/promptitude-icon.png.

Sequence Diagram(s)

(omitted)

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested reviewers

  • jeanplevesque
  • MatFillion
🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main changes in the changeset, which focus on fixing multiple UI/UX issues in the prompt details webview including empty state handling, content editing, and activate button styling.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch msyo/fix-prompt-details

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
src/ui/promptDetailsWebview.ts (1)

466-473: Critical: clearPrompt function references removed variables and functions.

The clearPrompt function references originalContent, hasUnsavedChanges, and updateSaveButtons(), which were removed as part of this PR (per the AI summary noting removal of unsaved-changes tracking). This will cause a ReferenceError when the function is called during initialization (line 499).

🐛 Fix clearPrompt function to remove stale references
 function clearPrompt() {
     currentPrompt = null;
-    originalContent = '';
     emptyState.style.display = 'block';
     promptDetails.style.display = 'none';
-    hasUnsavedChanges = false;
-    updateSaveButtons();
 }
🤖 Fix all issues with AI agents
In @src/ui/promptDetailsWebview.ts:
- Around line 497-499: The call to clearPrompt during initialization fails with
a ReferenceError because clearPrompt is either not defined yet or references
undefined state; fix by ensuring a properly implemented clearPrompt function
exists and is in scope before the initialization call: declare clearPrompt (as a
function or const arrow) above where it's invoked, remove or fix any references
inside clearPrompt to undefined symbols (e.g., promptState, setPrompt, or other
local state), or export/import it correctly if it belongs to another module or
attach it to the webview/window context so the initializer can call it without
ReferenceError.
🧹 Nitpick comments (2)
media/main.css (1)

183-191: Consider reusing the existing .primary class to avoid duplication.

The .activate class styling is identical to the existing .primary class (lines 157-165). This duplicates code and makes maintenance harder.

♻️ Consolidate duplicate button styles

Option 1: Use multiple selectors (recommended)

-.action-button.primary {
+.action-button.primary,
+.action-button.activate {
 	background: var(--vscode-button-background);
 	color: var(--vscode-button-foreground);
 	border-color: var(--vscode-button-background);
 }
 
-.action-button.primary:hover {
+.action-button.primary:hover,
+.action-button.activate:hover {
 	background: var(--vscode-button-hoverBackground);
 }
-
-.action-button.activate {
-	background: var(--vscode-button-background);
-	color: var(--vscode-button-foreground);
-	border-color: var(--vscode-button-background);
-}
-
-.action-button.activate:hover {
-	background: var(--vscode-button-hoverBackground);
-}

Option 2: Apply both classes in the HTML

If the classes serve different semantic purposes, apply both primary and activate classes to the button element, then remove the duplicate CSS rules.

src/ui/promptDetailsWebview.ts (1)

188-215: Verify if savePromptContent is now dead code.

Since the content textarea is now readonly (line 357) and the save/reset buttons were removed from the webview, the savePromptContent handler and its saveContent message case (lines 46-48) may no longer be reachable from the UI. If content editing has been moved entirely to the external editor (via editPromptInEditor), consider removing this dead code in a future cleanup.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9dfa5cd and 6da7e74.

📒 Files selected for processing (2)
  • media/main.css
  • src/ui/promptDetailsWebview.ts
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Agent
🔇 Additional comments (5)
src/ui/promptDetailsWebview.ts (5)

328-328: LGTM - Fixes blank view on initial load.

Setting display: block on the empty state ensures users see the "No Prompt Selected" message when the webview first loads, addressing BUG 1 from the PR objectives.


357-358: LGTM - Content is now read-only as intended.

Making the textarea readonly and removing the inline save/reset buttons addresses BUG 2, preventing users from editing content directly in the details view while still allowing them to view it.


360-360: Verify the source section should always be visible.

The source section is now always displayed (removed display: none). When there's no repository URL, it will show "Local" as the source (line 446). Ensure this is the intended UX, as previously this section was conditionally shown only when a repository URL existed.


396-401: LGTM - Button styling correctly toggles between states.

The updated logic properly switches between the activate class (blue button with '+' icon for inactive prompts) and selected class (green button with '✓' icon for active prompts), addressing BUG 3 from the PR objectives.


408-408: LGTM - Empty state properly hidden when showing prompt.

This ensures the empty state is hidden when a prompt is selected, addressing the persistence issue mentioned in BUG 2.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses UI/UX issues in the prompt details webview by fixing empty state display, making content read-only, and improving button styling for inactive prompts.

Key changes:

  • Made prompt content textarea read-only and removed edit/save functionality
  • Added proper initialization to display empty state on webview load
  • Implemented activate button styling with primary colors for inactive prompts

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/ui/promptDetailsWebview.ts Removed save/edit UI elements and event handlers; made textarea readonly; added empty state initialization; updated button toggle logic with new icon and CSS class
media/main.css Added .activate CSS class styling for inactive prompt button state with primary theme colors

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
src/ui/promptDetailsWebview.ts (1)

46-48: Consider removing or documenting the unused saveContent handler.

Since the content textarea is now readonly and the inline save/reset actions have been removed, the saveContent message handler (lines 46-48) and its implementation (lines 188-215) appear to be unused. Consider either:

  • Removing the dead code if editing in the webview won't be supported going forward
  • Adding a comment explaining that this functionality is preserved for potential future use
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6da7e74 and a1139d5.

📒 Files selected for processing (1)
  • src/ui/promptDetailsWebview.ts
🔇 Additional comments (5)
src/ui/promptDetailsWebview.ts (5)

328-328: LGTM! Empty state now displays correctly on initial load.

This change ensures the "No Prompt Selected" message is visible by default, fixing BUG 1 where the panel previously showed a blank view on first load.


349-365: LGTM! Content textarea is now correctly set to readonly.

The readonly attribute on line 357 fixes BUG 2 by preventing unintended content editing in the webview. The formatting and structure changes improve code readability.


391-404: LGTM! Activate/selected button toggle logic is correct.

The class toggling correctly implements BUG 3's fix:

  • Inactive state: '+' icon with activate class (blue primary button)
  • Active state: '✓' icon with selected class (green button)

The mutual exclusivity of the classes and appropriate icon/title updates provide clear visual feedback.


407-409: LGTM! Empty state is now properly hidden when displaying a prompt.

The simplified logic correctly ensures the empty state is hidden and prompt details are shown when a prompt is selected, completing the fix for BUG 2.


494-496: LGTM! Proper initialization ensures consistent empty state on load.

Calling clearPrompt() on script initialization ensures the webview always starts in the correct state, completing the fix for BUG 1. This defensive approach prevents any inconsistencies regardless of HTML default display values.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
CHANGELOG.md (1)

23-26: Approve changelog entries; consider rewording for stylistic variety.

The four new entries accurately document the fixes from this PR and align well with the PR objectives. However, all four consecutive lines begin with "Fixed", creating repetitive sentence structure.

📝 Optional rewording to vary sentence structure
- Fixed prompt details webview initializing with visible empty state instead of hidden state on load.
- Fixed prompt content textarea being editable instead of read-only in details view.
- Fixed empty state remaining visible when prompt is selected in details view.
- Fixed activate button styling in prompt details view to use blue color with plus icon for better visibility and consistency.
+ Prompt details webview now initializes with the correct empty state message on load.
+ Prompt content textarea is now read-only in details view.
+ Empty state is now properly hidden when a prompt is selected.
+ Activate button styling updated to use blue color with plus icon for improved visibility and consistency.
📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a1139d5 and f041b4b.

📒 Files selected for processing (1)
  • CHANGELOG.md
🧰 Additional context used
🪛 LanguageTool
CHANGELOG.md

[style] ~23-~23: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ... support for proper theme adaptation. - Fixed prompt details webview initializing wit...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~24-~24: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...tate instead of hidden state on load. - Fixed prompt content textarea being editable ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~25-~25: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...instead of read-only in details view. - Fixed empty state remaining visible when prom...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~26-~26: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...n prompt is selected in details view. - Fixed activate button styling in prompt detai...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (1)
CHANGELOG.md (1)

11-15: Consider varying the sentence structure to improve readability.

While the parallel "Fixed..." structure is common in changelogs, you could optionally vary the wording for better flow. For example:

  • "Prompt details webview now shows empty-state message on initial load"
  • "Content textarea is now read-only in the details view"
  • "Empty state properly hides when a prompt is selected"

However, the current structure is clear and follows standard changelog conventions.

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between f041b4b and 63ed9b9.

⛔ Files ignored due to path filters (1)
  • resources/promptitude-icon.png is excluded by !**/*.png
📒 Files selected for processing (2)
  • CHANGELOG.md
  • package.json
🧰 Additional context used
🪛 LanguageTool
CHANGELOG.md

[style] ~12-~12: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...tate instead of hidden state on load. - Fixed prompt content textarea being editable ...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~13-~13: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...instead of read-only in details view. - Fixed empty state remaining visible when prom...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~14-~14: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...n prompt is selected in details view. - Fixed activate button styling in prompt detai...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)


[style] ~15-~15: Three successive sentences begin with the same word. Consider rewording the sentence or use a thesaurus to find a synonym.
Context: ...or better visibility and consistency. - Fixed marketplace icon not displaying on VS C...

(ENGLISH_WORD_REPEAT_BEGINNING_RULE)

🔇 Additional comments (4)
package.json (2)

5-5: LGTM!

The version bump to 1.5.3 correctly reflects the patch-level UI fixes documented in the changelog.


7-7: Icon file correctly configured for VS Code marketplace.

The top-level icon field uses the correct PNG format and points to an existing file at resources/promptitude-icon.png. This properly addresses the marketplace icon display issue.

CHANGELOG.md (2)

11-11: Clarify the wording to match the actual bug and fix.

The current wording is confusing and appears backwards from the PR objectives. According to the PR description:

  • Bug: "blank details view" displayed on load (empty state was hidden/not shown)
  • Fix: Display the "empty-state message" on load (empty state is visible)

Consider rewording to:

  • "Fixed prompt details webview showing blank view on load instead of displaying the empty-state message."

or

  • "Fixed prompt details webview not showing empty-state message on initial load."

12-15: LGTM!

These changelog entries accurately describe the UI/UX fixes from the PR objectives:

  • Read-only content textarea (line 12)
  • Empty state handling on prompt selection (line 13)
  • Improved activate button styling (line 14)
  • Marketplace icon display fix (line 15)

@MatFillion MatFillion merged commit 57080ec into main Jan 8, 2026
4 checks passed
@Soap-141 Soap-141 deleted the msyo/fix-prompt-details branch January 9, 2026 17:47
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.

4 participants