8000 chore: deletes unnecessary code by Rahban1 · Pull Request #142 · antiwork/iffy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

chore: deletes unnecessary code #142

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Rahban1
Copy link
@Rahban1 Rahban1 commented Jun 29, 2025

Removes a bunch of unused code, found with the help of knip.

Summary by CodeRabbit

  • Removals
    • Several UI components and utilities have been removed, including avatar, collapsible, drawer, select button, data table, and data table pagination components.
    • Appeal action button and day display components have been deleted.
    • Various formatting and helper functions, as well as several type aliases and interfaces, have been removed from internal modules.
    • Dependencies related to the removed components and features have been cleaned up from the application.
    • Webpage metadata fetching and XML formatting functionality have been removed.

Copy link
coderabbitai bot commented Jun 29, 2025

Walkthrough

This change set removes a large number of exported React UI components, utility functions, and type aliases from various files. It deletes several component files entirely, eliminates helper and formatting functions, and prunes type exports from service and library modules. Multiple dependencies related to these components are also removed from the package configuration.

Changes

File(s) Change Summary
app/dashboard/inbox/appeal-action-button.tsx Deleted AppealActionButton component, CloseAction type, and CloseIssueButtonProps interface.
components/date.tsx Removed Day component export.
components/select-button.tsx Entire file deleted; removed all SelectButton-related components and context.
components/ui/avatar.tsx Entire file deleted; removed Avatar, AvatarImage, and AvatarFallback components.
components/ui/collapsible.tsx Entire file deleted; removed re-exports for Collapsible, CollapsibleTrigger, CollapsibleContent.
components/ui/data-table-pagination.tsx Entire file deleted; removed DataTablePagination component.
components/ui/data-table.tsx Entire file deleted; removed DataTable component and DataTableProps interface.
components/ui/drawer.tsx Entire file deleted; removed all Drawer-related components and exports.
inngest/client.ts Removed export of Events type alias.
lib/docs/source.ts Removed exported type aliases Page and Meta.
lib/user-record.ts Removed exported functions formatUserRecordSecondary and formatUserRecordCompactSecondary.
package.json Removed several dependencies and devDependencies (UI, utility, and type packages).
services/messages.ts Removed exported updateMessage async function.
services/records.ts Removed exported getRecordUrls function.
services/rules.ts Removed exported type alias RuleWithStrategiesInsert.
services/url-moderation.ts Removed PageData interface, formatPageInfoAsXml, and fetchPageData functions; pruned related imports.
source.config.ts Removed export modifier from docs constant.
strategies/types.ts Removed StrategyConstructor interface.

Poem

A bunny hopped through fields of code,
Tidying up the UI load.
Buttons, drawers, tables gone—
Lighter now, we code at dawn!
With types and helpers swept away,
The garden’s neat for future play.
🐇✨

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

npm error Exit handler never called!
npm error This is an error with npm itself. Please report this error at:
npm error https://github.com/npm/cli/issues
npm error A complete log of this run can be found in: /.npm/_logs/2025-06-29T19_30_01_150Z-debug-0.log

✨ Finishing Touches
  • 📝 Generate Docstrings

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
@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

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 2fa2c7d and de351cb.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (18)
  • app/dashboard/inbox/appeal-action-button.tsx (0 hunks)
  • components/date.tsx (0 hunks)
  • components/select-button.tsx (0 hunks)
  • components/ui/avatar.tsx (0 hunks)
  • components/ui/collapsible.tsx (0 hunks)
  • components/ui/data-table-pagination.tsx (0 hunks)
  • components/ui/data-table.tsx (0 hunks)
  • components/ui/drawer.tsx (0 hunks)
  • inngest/client.ts (0 hunks)
  • lib/docs/source.ts (0 hunks)
  • lib/user-record.ts (0 hunks)
  • package.json (0 hunks)
  • services/messages.ts (0 hunks)
  • services/records.ts (0 hunks)
  • services/rules.ts (0 hunks)
  • services/url-moderation.ts (0 hunks)
  • source.config.ts (1 hunks)
  • strategies/types.ts (0 hunks)
💤 Files with no reviewable changes (17)
  • inngest/client.ts
  • components/date.tsx
  • strategies/types.ts
  • services/rules.ts
  • services/records.ts
  • lib/docs/source.ts
  • package.json
  • components/ui/collapsible.tsx
  • services/messages.ts
  • components/ui/avatar.tsx
  • components/ui/data-table-pagination.tsx
  • app/dashboard/inbox/appeal-action-button.tsx
  • lib/user-record.ts
  • components/ui/data-table.tsx
  • components/ui/drawer.tsx
  • services/url-moderation.ts
  • components/select-button.tsx
🔇 Additional comments (1)
source.config.ts (1)

7-7: defineConfig() is called with no arguments – likely an oversight

defineConfig() ordinarily receives an options object (e.g., { docs }).
With the previous export removed, this empty call effectively produces a default config, defeating the purpose of defining docs in the first place.

Confirm whether this file should:

  1. Supply the newly created docs object, or
  2. Delete the defineDocs call altogether if docs are no longer required.

Untangling this now prevents runtime surprises in the docs generation pipeline.

source.config.ts Outdated
Comment on lines 3 to 5
const docs = defineDocs({
dir: "content/docs",
});
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

docs is now an unused variable – configuration is no longer wired up

docs is declared but never consumed after dropping export.
If fumadocs-mdx expects the docs definition to be passed into defineConfig, the current state silently disables your docs tree and will likely be caught by ESLint/TS (no-unused-vars) as well.

-const docs = defineDocs({
-  dir: "content/docs",
-});
+// Option A – inline, keeps the constant private
+export default defineConfig({
+  docs: defineDocs({
+    dir: "content/docs",
+  }),
+});
+
+// Option B – keep the constant (still non-exported) but actually use it
+const docs = defineDocs({ dir: "content/docs" });
+export default defineConfig({ docs });

Pick either approach; the key point is to pass docs into defineConfig (or remove it entirely if truly obsolete).
Failing to do so results in dead code and a broken docs build.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
const docs = defineDocs({
dir: "content/docs",
});
// Option A – inline, keeps the constant private
export default defineConfig({
docs: defineDocs({
dir: "content/docs",
}),
});
// Option B – keep the constant (still non-exported) but actually use it
const docs = defineDocs({ dir: "content/docs" });
export default defineConfig({ docs });
🤖 Prompt for AI Agents
In source.config.ts around lines 3 to 5, the variable `docs` is declared but not
used, causing dead code and disabling the docs tree. To fix this, either remove
the `docs` declaration entirely if it is obsolete, or pass the `docs` variable
into the `defineConfig` function as required by `fumadocs-mdx` to properly wire
up the docs configuration and avoid build issues.

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
0