Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions frontend/src/components/custom-tools/prompt-card/Header.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,16 @@ try {
// The component will remain 'undefined' it is not available
}

let PromptChangeIndicator;
try {
const mod = await import(
"../../../plugins/prompt-change-indicator/PromptChangeIndicator"
);
PromptChangeIndicator = mod.PromptChangeIndicator;
} catch {
// Cloud-only feedback loop indicator; stays undefined in OSS builds
}

function Header({
promptDetails,
promptKey,
Expand Down Expand Up @@ -394,6 +404,12 @@ function Header({
</>
)}
<ExpandCardBtn expandCard={expandCard} setExpandCard={setExpandCard} />
{PromptChangeIndicator && (
<PromptChangeIndicator
promptDetails={promptDetails}
toolDetails={details}
/>
)}
{isSimplePromptStudio && PromptRunBtnSps && (
<PromptRunBtnSps
spsLoading={spsLoading}
Expand Down
41 changes: 41 additions & 0 deletions frontend/src/routes/useMainAppRoutes.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ let ManualReviewPage;
let SimpleManualReviewPage;
let ReviewLayout;
let Manage;
let ReadOnlyReviewPage;
let UnstractSubscriptionPage;
let UnstractSubscriptionCheck;
let AgenticPromptStudio;
Expand Down Expand Up @@ -111,6 +112,40 @@ try {
// Do nothing, Not-found Page will be triggered.
}

try {
const mod = await import(
"../plugins/prompt-change-indicator/ReadOnlyReviewPage.jsx"
);
ReadOnlyReviewPage = mod.ReadOnlyReviewPage;
} catch (err) {
// Expected in OSS builds where the cloud plugin is absent. Surface
// anything that isn't a missing-module error so syntax/runtime
// failures inside the plugin don't silently disable the route.
const msg = err?.message || "";
const isModuleMissing =
err?.code === "MODULE_NOT_FOUND" ||
msg.includes("Failed to fetch dynamically imported module") ||
msg.includes("Cannot find module");
if (!isModuleMissing) {
// eslint-disable-next-line no-console
console.error(
"[prompt-change-indicator] ReadOnlyReviewPage import failed unexpectedly",
err,
);
}
}

// The readonly route lives inside the manual-review ReviewLayout. If the
// prompt-change-indicator plugin ships without manual-review, the route
// would silently never register — surface that misconfiguration loudly.
if (ReadOnlyReviewPage && !ReviewLayout) {
// eslint-disable-next-line no-console
console.warn(
"[prompt-change-indicator] ReadOnlyReviewPage loaded but ReviewLayout " +
"is missing; readonly route will not be registered.",
);
}

try {
const mod1 = await import(
"../plugins/unstract-subscription/pages/UnstractSubscriptionPage.jsx"
Expand Down Expand Up @@ -248,6 +283,12 @@ function useMainAppRoutes() {
element={<ManualReviewPage type="approve" />}
/>
{Manage && <Route path="review/manage" element={<Manage />} />}
{ReadOnlyReviewPage && (
<Route
path="review/readonly/:documentId"
element={<ReadOnlyReviewPage />}
/>
)}
Comment thread
greptile-apps[bot] marked this conversation as resolved.
</Route>
)}
</>
Expand Down