Skip to content

Improve general submission process - #231

Draft
Saterz wants to merge 25 commits into
mainfrom
feat/improve-submission-process
Draft

Improve general submission process#231
Saterz wants to merge 25 commits into
mainfrom
feat/improve-submission-process

Conversation

@Saterz

@Saterz Saterz commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary by CodeRabbit

  • New Features

    • Added a documentation viewer with formatted Markdown, alerts, emoji, footnotes, linked headings, and an “On this page” navigation.
    • Added dedicated pages for the submission manual, cube submissions, and vendor submissions.
  • Documentation

    • Added comprehensive guidance for submitting cubes and vendors, including eligibility, required details, sourcing, formatting, review outcomes, and support options.
    • Documented submission statuses, follow-up expectations, and relevant standards for dates, currencies, countries, and competition regulations.

- Introduced `DocsMarkdown.svelte` for rendering Markdown content with plugins for alerts, footnotes, and emojis.
- Added cube submission guide (`cube-submission.md`) detailing eligibility, source requirements, and field definitions.
- Created a general submission manual (`submission-manual.md`) outlining the review process and help resources.
- Developed vendor submission guide (`vendor-submission.md`) specifying eligibility and source requirements for vendors.
- Updated `package.json` to include necessary dependencies for Markdown processing.
- Implemented new routes for the submission manuals in the documentation section.
@netlify

netlify Bot commented Jul 14, 2026

Copy link
Copy Markdown

Deploy Preview for cubeindex failed. Why did it fail? →

Name Link
🔨 Latest commit d490f8b
🔍 Latest deploy log https://app.netlify.com/projects/cubeindex/deploys/6a5a68bd064ff30008a5e774

@Saterz
Saterz marked this pull request as draft July 14, 2026 18:40
@coderabbitai

coderabbitai Bot commented Jul 14, 2026

Copy link
Copy Markdown

Review Change Stack

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c9d015c7-be01-4d4e-aab8-e92cf0389245

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a Markdown rendering component with heading anchors and table-of-contents navigation, three submission guide documents, and documentation routes that render the guides.

Changes

Documentation Markdown

Layer / File(s) Summary
Markdown renderer and dependencies
package.json, src/lib/components/docs/DocsMarkdown.svelte
Adds Markdown-It dependencies and renders Markdown with alerts, emoji, footnotes, heading anchors, and a generated h2/h3 table of contents.
Submission guide content
src/lib/content/guides/*.md
Adds cube, vendor, and general submission manuals covering eligibility, form fields, sources, review outcomes, and support routes.
Documentation route wiring
src/routes/(docs)/docs/...
Adds the documentation layout and routes that load each guide as raw Markdown and render it through DocsMarkdown.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant DocsPage
  participant DocsMarkdown
  participant MarkdownIt
  participant Browser
  DocsPage->>DocsMarkdown: pass Markdown text
  DocsMarkdown->>MarkdownIt: render text with plugins
  MarkdownIt-->>DocsMarkdown: return HTML and heading tokens
  DocsMarkdown->>Browser: render article and table of contents
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning No description was provided, so the required Why, change summary, type of change, and checklist sections are missing. Add the template sections: Why/Closes, Type of change, What's being changed, and Checklist, with at least brief content in each.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: improving the submission process through new submission guides and docs pages.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/improve-submission-process

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (2)
src/lib/components/docs/DocsMarkdown.svelte (2)

94-95: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Sanitize HTML output if text can contain untrusted input.

You added dompurify to package.json, but result is rendered as raw HTML without sanitization. If this component is ever used to render user-generated content, this poses a Cross-Site Scripting (XSS) vulnerability.

If you intend to use DOMPurify here, note that it requires a DOM and will crash during SvelteKit SSR unless you use isomorphic-dompurify or run it purely client-side. If text is strictly local and trusted documentation, sanitization isn't strictly necessary, but removing the unused dompurify dependency from package.json is advised.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/components/docs/DocsMarkdown.svelte` around lines 94 - 95, Sanitize
the HTML assigned to result before the {`@html`} render in DocsMarkdown, using an
SSR-compatible sanitizer such as isomorphic-dompurify so SvelteKit server
rendering does not crash; if text is guaranteed trusted local documentation
instead, remove the unused dompurify dependency and keep the raw rendering
contract explicit.

36-83: 🚀 Performance & Scalability | 🔵 Trivial | ⚡ Quick win

Initialize MarkdownIt outside the reactive block.

Instantiating MarkdownIt and re-registering all plugins inside Svelte's $derived.by callback causes the entire parser to be rebuilt every time text changes.

Consider initializing the MarkdownIt instance outside the $derived block and using a local array variable to collect the tableOfContents during the .render() pass. This significantly improves performance during reactive updates.

⚡ Proposed performance optimization
-  const rendered = $derived.by(() => {
-    const tableOfContents: TocItem[] = [];
-
-    const md = MarkdownIt({
+  let currentToc: TocItem[] = [];
+
+  const md = MarkdownIt({
       html: false,
       linkify: true,
     })
       .use(alert)
       .use(markdownItAnchor, {
         level: [2, 3],
 
         permalink: markdownItAnchor.permalink.linkInsideHeader({
           symbol: "#",
           placement: "after",
           class: "header-anchor",
           ariaHidden: true,
         }),
 
         callback(token, info) {
           const level = Number(token.tag.slice(1));
 
           if (level !== 2 && level !== 3) {
             return;
           }
 
           const inlineToken = token.children?.find(
             (child) => child.type === "inline",
           );
 
           const title = inlineToken?.children
             ? getHeadingText(inlineToken.children)
             : info.title;
 
-          tableOfContents.push({
+          currentToc.push({
             id: info.slug,
             title: title || info.slug,
             level,
           });
         },
       })
       .use(footnote)
       .use(fullEmoji);
+
+  const rendered = $derived.by(() => {
+    currentToc = [];
+    const html = md.render(text);
 
     return {
-      html: md.render(text),
-      tableOfContents,
+      html,
+      tableOfContents: [...currentToc],
     };
   });
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/components/docs/DocsMarkdown.svelte` around lines 36 - 83, Move the
MarkdownIt construction and plugin registration out of the rendered $derived.by
callback into a stable instance, while preserving the existing anchor callback
behavior. Keep tableOfContents as a fresh local array for each reactive render
and have the callback populate that array during md.render(text), so only
rendering and TOC collection rerun when text changes.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/lib/components/docs/DocsMarkdown.svelte`:
- Line 9: Update the side-effect import in DocsMarkdown.svelte to reference the
package’s resolvable CSS entry, using the .css extension if that file exists;
otherwise add an ambient declaration for the extensionless
`@mdit/plugin-alert/style` module. Do not suppress the error with TypeScript
ignore directives.

---

Nitpick comments:
In `@src/lib/components/docs/DocsMarkdown.svelte`:
- Around line 94-95: Sanitize the HTML assigned to result before the {`@html`}
render in DocsMarkdown, using an SSR-compatible sanitizer such as
isomorphic-dompurify so SvelteKit server rendering does not crash; if text is
guaranteed trusted local documentation instead, remove the unused dompurify
dependency and keep the raw rendering contract explicit.
- Around line 36-83: Move the MarkdownIt construction and plugin registration
out of the rendered $derived.by callback into a stable instance, while
preserving the existing anchor callback behavior. Keep tableOfContents as a
fresh local array for each reactive render and have the callback populate that
array during md.render(text), so only rendering and TOC collection rerun when
text changes.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: baf7a8eb-1983-4aeb-9bda-c6ecbd907f29

📥 Commits

Reviewing files that changed from the base of the PR and between 48990c9 and 05d25aa.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (9)
  • package.json
  • src/lib/components/docs/DocsMarkdown.svelte
  • src/lib/content/guides/cube-submission.md
  • src/lib/content/guides/submission-manual.md
  • src/lib/content/guides/vendor-submission.md
  • src/routes/(docs)/docs/+layout.svelte
  • src/routes/(docs)/docs/submission-manual/+page.svelte
  • src/routes/(docs)/docs/submission-manual/cubes/+page.svelte
  • src/routes/(docs)/docs/submission-manual/vendors/+page.svelte

import { footnote } from "@mdit/plugin-footnote";
import { fullEmoji } from "@mdit/plugin-emoji";

import "@mdit/plugin-alert/style";

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win

Resolve the missing type declarations for this side-effect import.

The pipeline is failing (svelte-check) because TypeScript cannot resolve this module. If the package provides a CSS file, append the .css extension to resolve the import:

import "`@mdit/plugin-alert/style.css`";

Alternatively, if the extensionless import is correct, you must declare it in an ambient .d.ts file (e.g., declare module '@mdit/plugin-alert/style';) to satisfy the TypeScript compiler. As per coding guidelines, do not use @ts-ignore or @ts-expect-error.

🧰 Tools
🪛 GitHub Actions: Pull Request Check / 0_check.txt

[error] 9-9: svelte-check (TypeScript): Cannot find module or type declarations for side-effect import of '@mdit/plugin-alert/style'.

🪛 GitHub Actions: Pull Request Check / check

[error] 9-9: svelte-check (TypeScript): Cannot find module or type declarations for side-effect import of '@mdit/plugin-alert/style'. (ts) import "@mdit/plugin-alert/style";

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/lib/components/docs/DocsMarkdown.svelte` at line 9, Update the
side-effect import in DocsMarkdown.svelte to reference the package’s resolvable
CSS entry, using the .css extension if that file exists; otherwise add an
ambient declaration for the extensionless `@mdit/plugin-alert/style` module. Do
not suppress the error with TypeScript ignore directives.

Sources: Coding guidelines, Pipeline failures

@Saterz Saterz self-assigned this Jul 14, 2026
Saterz added 20 commits July 14, 2026 18:02
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