npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@e-llm-studio/feedback-flow

v0.1.70

Published

Reusable configurable feedback rating and progressive feedback screens

Readme

@e-llm-studio/feedback-flow

Reusable React components for star ratings and progressive feedback. The package includes the prompt, follow-up screens, persistence helpers, and optional feature-details lookup. Its stylesheet is imported by the package entry point.

Install

Install @e-llm-studio/feedback-flow alongside its peer dependencies: react, react-dom, and lucide-react.

Quick start

FeedbackExperience provides the complete flow. Pass a FeedbackApi to persist feedback to your backend; if api is omitted, the package uses browser-local mock storage instead. The HTTP adapter uses the API only, not localStorage.

import {
    FeedbackExperience,
    createFeedbackTheme,
    createHttpFeedbackApi,
    createHttpFeatureAvailabilityApi,
} from "@e-llm-studio/feedback-flow";

const getAuthToken = () => authStore.getState().token ?? undefined;
const feedbackApi = createHttpFeedbackApi({
    baseUrl: apiBaseUrl,
    getAuthToken,
});
const featureAvailabilityApi = createHttpFeatureAvailabilityApi({
    baseUrl: apiBaseUrl,
    getAuthToken,
});

export function FeatureFeedback() {
    return (
        <FeedbackExperience
            api={feedbackApi}
            featureId={featureId}
            featureAvailabilityApi={featureAvailabilityApi}
            featureAvailabilityModeId={modeId}
            userEmail={userEmail}
            environment="dev"
            tracking={{ mode: "My mode", modeId, featureContext: "my-feature" }}
            copy={{
                prompt: "Was this feature Helpful?",
                usefulTitle: "What worked well?",
                gapTitle: "What should we improve?",
            }}
            theme={createFeedbackTheme({ accent: "#6025e5" })}
        />
    );
}

The example assumes authStore, apiBaseUrl, featureId, modeId, and userEmail come from your host app. Keep adapters outside the component when their configuration is stable. The feature-details adapter and mode ID are optional: the card remains visible if the feature is missing or the lookup fails. While ui_new_ttl is in the future, the card shows a New badge; expiry removes only the badge. start_date and end_date do not currently control visibility.

Each feature-card mount starts a fresh feedback form. The clock button in its modal loads earlier forms from the supplied API; today's forms can be reopened for editing, while older forms are shown read-only. FeedbackApi.listFeedback supplies that history (createHttpFeedbackApi implements it). The same-day edit restriction is enforced by this UI; the backend should enforce it too if updates can be called directly.

Feature cards use ratingCardLayout="vertical" by default, with the badge and prompt above the stars. Set ratingCardLayout="horizontal" to put the badge, prompt, and stars on one line. Give the horizontal card enough room in its host container.

For a chat response, pass a stable requestId and include its backend queryId and sessionId in metadata. A response with requestId does not call the feature-availability API.

FeedbackExperience includes QuickCheckExperience: response feedback uses chat reading/activity checks, and feature feedback uses per-feature proximity timers. For chat, pass quickCheck={{ responseText: message.content, ready: !isStreaming, active: isActiveResponse }}. Set quickCheck={{ enabled: false }} to disable quick checks.

For automatic feature check-ins, supply the feature identity and optional proximity threshold:

<FeedbackExperience
    {...feedbackProps}
    featureId="export-report"
    featureInitialDelayMs={60_000}
/>

Feature check-ins become eligible after 60 seconds accumulated within an expanded area around the rating card. Leaving that area pauses that feature's timer; returning resumes it. Counting stops at the threshold while eligibility is retained. Clicks and wheel scrolling update proximity without requiring mouse movement. Each feature keeps its own progress in sessionStorage["feedback-feature-proximity"][featureId]; all feedback timers pause while a check-in or feedback form is open. Among eligible, visible, unrated features near the cursor, the closest rating card is selected. featureInitialDelayMs overrides the threshold. Parent-container tracking is not enabled yet.

Pass debug={true} to draw a red outline of each feature's proximity boundary while testing. The outline follows scrolling, resizing, and layout changes, uses the same dimensions as the timer, and does not intercept clicks. It is off by default and does not apply to response feedback. Toggling it does not reset timer progress.

FeedbackExperience coordinates this automatically. Lower-level QuickCheckExperience consumers must provide scope: "feature", showPopup, a stable featureIdentity, and anchorRef. Eligibility does not bypass an active shared snooze, feedback form, browser inactivity, or the five-second typing quiet period.

Feature snooze is shared with LSC/page feedback. It counts down while the browser window is active, regardless of cursor position, and pauses while a check-in or feedback form is open. Opening the feedback form does not select a snooze. Selecting one shows the green confirmation first; return greetings appear only after the break expires. Another feature uses its initial message.

A completed feature rating is restored through listFeedback, scoped by user, mode, environment, feature, and local day. Successful submissions suppress that feature immediately in memory; after reload, the history GET determines whether it is rated today. No rated-feature markers are read from or written to localStorage. Drafts and failed saves do not mark a feature rated. Automatic feature check-ins require listFeedback and wait for the history lookup to succeed; a failed lookup retries on window focus.

Snooze choices adapt to the user's completed feedback forms for the current application/mode and local calendar day. LSC, page, and feature submissions share this count; drafts do not add to it, and editing a submitted form does not add another submission.

| Today's submissions | LSC choices (minutes) | Page choices (minutes) | | ------------------- | --------------------- | ---------------------- | | 0 | 2, 5, 8 | 2, 5, 10 | | 1–2 | 5, 15, 25 | 10, 20, 30 | | 3 or more | 10, 20, 30 | 15, 30, 45 |

LSC also retains Smart Snooze. Changing tiers updates the choices, preserving any duration already selected. Counts refresh after successful submission and at local midnight, and are isolated by deployment environment. New chat/timer resets do not clear the daily count.

Any active LSC, page, or feature snooze suppresses all three levels. Selecting a snooze resets the selected feature's proximity timer to zero and restarts normal LSC/page initial timers while preserving other features' progress and existing selected breaks. A feature can prompt again only after both its proximity threshold and the shared snooze have completed. Successfully submitting feature feedback starts a shared cooldown of the greater of three minutes or the longest remaining snooze. Other selected breaks keep their remaining time. LSC/page submissions retain their existing reset behavior: clear the answered side's snooze and restart other active timers. After feature feedback submission, other features retain their eligibility progress and the rated feature stops tracking for the day. Without an active break, LSC timing remains 60%/40% reading time for latest/older responses (35–100 seconds at 240 WPM); page timing remains 2.5 minutes of RHS activity. Drafts and failed submissions do not start a cooldown.

FeedbackExperience supplies the API and identity automatically. Direct QuickCheckExperience consumers should pass feedbackApi, userEmail, and modeId (plus feedbackMetadata.environment for their deployment). Custom adapters must implement getTodayFeedbackCount(userEmail, { modeId, environment }) with scope filtering; omitting the scope retains the all-app contribution count. The HTTP and mock adapters support both. For LSC records, active_mode_id takes precedence over the CW system mode_id. Explicit snoozeOptions still override the adaptive choices.

Typing in inputs, textareas, or editable content anywhere in the shared page defers a due LSC/page/feature popup until five seconds after the last edit. More typing restarts this delay; IME composition waits until composition ends. An already-open popup stays open. This listener cannot observe typing inside cross-origin iframes.

Customize

  • copy overrides built-in questions, labels, hints, placeholders, and options. usefulMinimumWords defaults to five.
  • theme, styles, and classNames control colors and presentation. slots adds content to the rating, time, gap, or success screen.
  • tracking adds host context to saved metadata; use custom for additional fields. onSubmit runs after a successful save.
  • createFeedbackScreenshotUploader and createFeedbackScreenshotUrlResolver can be supplied to createHttpFeedbackApi when the host supports attachments.
  • captureScreenshot lets a host capture the current tab. It should return an image File, Blob, or PNG/JPEG/WebP data URL; return null if cancelled. Without it, the library uses the browser's screen-sharing picker.

For an extension, capture in its background/service worker and pass the result through extension messaging. The library hides its modal before calling the adapter:

<FeedbackExperience
    // ...other props
    captureScreenshot={async () => {
        const result = await chrome.runtime.sendMessage({
            type: "ECG_CAPTURE_FEEDBACK_TAB",
        });
        if (result.error) throw new Error(result.error);
        return result.dataUrl ?? null;
    }}
/>

The extension must implement that message handler using chrome.tabs.captureVisibleTab and have the required tab/host permission. If the React UI runs in a regular web page rather than an extension context, bridge the request through a content script instead of calling chrome.runtime from the page.

These options customize the existing flow; adding new fields or changing its branching requires custom host UI or a library change.

Lower-level composition

For response/query feedback, pass queryId directly instead of featureId:

<FeedbackExperience
    queryId={queryId}
    requestId={requestId}
    sessionId={sessionId}
    userEmail={userEmail}
    environment="dev"
    api={feedbackApi}
/>

requestId and sessionId are optional correlation identifiers. Feature feedback uses featureId; query feedback uses queryId. Use metadata for extra application fields and tracking for mode/feature context. Lower-level callers can use useFeedbackFlow({ queryId, requestId, sessionId, userEmail, environment }) or useFeedbackFlow({ featureId, userEmail, environment }). The older positional hook signature is retained for existing consumers.

Pass the deployment environment through metadata={{ environment: "stage" }} or tracking={{ environment: "stage" }}. Saves default to dev when no environment is supplied. The cw-core integration reads config.VITE_CURRENT_ENV; the remote feature wrapper also accepts an environment prop.

Ratings below 4 do not create a feedback form or upload attachments until the user completes the gaps step. Selecting a low rating or dismissing that step alone does not save it.

For independent prompt/modal placement, use useFeedbackFlow, FeedbackPrompt, and FeedbackModal with the same flow controller and an anchorRef. Use useFeedbackPersistence with a FeedbackApi to load and save feedback, and wire its save handlers to the modal. FeedbackExperience handles this wiring for the standard layout.

The package exports createFeedbackCopy, createFeedbackTheme, createFeedbackMetadata, and the related types for deeper customization. mockFeedbackApi and createMockFeatureAvailabilityApi are available for demos and tests; they are not required when the host supplies real adapters.