Skip to content

Comments

[Expert Finder] Services, hooks, layout and pages#644

Open
nicktytarenko wants to merge 15 commits intomainfrom
expert-finder-foundation
Open

[Expert Finder] Services, hooks, layout and pages#644
nicktytarenko wants to merge 15 commits intomainfrom
expert-finder-foundation

Conversation

@nicktytarenko
Copy link
Contributor

What?

  • Defined types for expert search configurations and results.
  • Added ExpertFinderService for API interactions related to expert searches.
  • Created hooks for managing expert search details and progress tracking.
  • Implemented LayoutWithRightSidebar for consistent layout structure. copied from the current Moderator dashboard
  • Introduced ExpertFinderLayout for managing user access and loading states.
  • Created main ExpertFinderPage that redirects to the find page.
  • Added ExpertFinderLibraryPage, ExpertFinderOutreachPage, and ExpertFinderTemplatesPage for library, outreach, and templates sections. (no functionality)
image

- Introduced `ExpertFinderLayout` for managing user access and loading states.
- Created main `ExpertFinderPage` that redirects to the find page.
- Added `ExpertFinderLibraryPage`, `ExpertFinderOutreachPage`, and `ExpertFinderTemplatesPage` for library, outreach, and templates sections.
- Implemented `LayoutWithRightSidebar` for consistent layout structure.
- Developed hooks for managing expert search details and progress tracking.
- Added `ExpertFinderService` for API interactions related to expert searches.
- Defined types for expert search configurations and results.
@nicktytarenko nicktytarenko requested a review from a team as a code owner February 17, 2026 14:06
@chatgpt-codex-connector
Copy link

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Credits must be used to enable repository wide code reviews.

@vercel
Copy link
Contributor

vercel bot commented Feb 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
web Ready Ready Preview, Comment Feb 22, 2026 6:32pm

Copy link
Contributor

Choose a reason for hiding this comment

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

The sidebarnav (I think referred to right sidebar) is a pattern we only use in the admin area of the site and will likely change up a bit soon.

To organize things a bit more clearly, can you place in components/ui/moderator/ModeratorSidebarNav.tsx

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are correct! this is realted to the admin area.
I created this components/SidebarNav.tsx to reuse it in the Moderator Dashboard and ExpertFinder
And the ModeratorSidebarNav looks like this (we specify nav items and render this SidebarNav)

const navigationItems: SidebarNavItem[];

export const ModerationMenu: FC = () => (
  <SidebarNavMenu
    items={navigationItems}
    menuTitle="Choose moderation area"
    triggerFallbackLabel="Moderation"
  />
);

we have the same layout for the Moderator dashboard and ExpertFinder pages

const abortController = new AbortController();
abortControllerRef.current = abortController;

const connect = async () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

  • Are we streaming results here as they arrive?
  • I think method does too much. Opens stream, read stream, parse stream via transformer. It is challenging to read since it is verbose. Could we split it up?

Some pseudocode, obviously simplistic:

const connect = async () => {
     const { streamReader, cancelStream } = openStream()

     while (true) {

        const { rawRecord  } = streamReader.nextRecord()
        const record = transformRecord(rawRecord);

        if (!rawRecord) {
             cancelStream()
         }
     }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This isn't working as I expected. I'll probably need to update the backend, because currently no messages are received in the web app. I only get them all at once when the search is completed. 😕🔧
For now we don't show a progress bar like 1% >>> 100% - we just redirect the user to the search details page when it's completed.

const isModerator = !!user?.isModerator;

useEffect(() => {
if (!isLoading && !isModerator) {
Copy link
Contributor

Choose a reason for hiding this comment

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

If not too difficult, let's use server side verification. If complex to determine moderator then we can just continue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

/**
* Create a new expert search.
*/
export function useCreateExpertSearch(): UseCreateExpertSearchReturn {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this used?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, in my next PR i use it

const [isConnected, setIsConnected] = useState(false);
const abortControllerRef = useRef<AbortController | null>(null);

const cleanup = useCallback(() => {
Copy link
Contributor

Choose a reason for hiding this comment

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

@nicktytarenko nicktytarenko changed the title [Expert Finder] Services, hooks, layout and pages(no functionality) [Expert Finder] Services, hooks, layout and pages Feb 22, 2026
@sonarqubecloud
Copy link

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.

2 participants