Skip to content

Commit 34701a6

Browse files
committed
refactor: remove outdated comments and improve code clarity across multiple files
1 parent 060cf29 commit 34701a6

8 files changed

Lines changed: 1 addition & 70 deletions

File tree

crates/aetheris-app/src/app.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -198,10 +198,6 @@ flowboxchild.filter-chip-child:selected:hover {
198198
background-color: alpha(@accent_color, 0.24);
199199
}
200200
201-
/* Object tables: rounded card look, matching the old boxed-list style —
202-
* card background for rows, a distinct shaded header, hairline row
203-
* separators. The frame class goes on the enclosing ScrolledWindow so the
204-
* rounded corners wrap header and rows together. */
205201
scrolledwindow.aetheris-table-frame {
206202
background-color: @card_bg_color;
207203
border: 1px solid alpha(currentColor, 0.1);
@@ -213,10 +209,6 @@ columnview.aetheris-table > listview {
213209
background: transparent;
214210
}
215211
216-
/* GNOME-style header: dimmed label at rest (like .dim-label), and on
217-
* hover a genuinely darker surface (@shade_color is Adwaita's translucent
218-
* black shading color in both light and dark) with the label brightening
219-
* to full strength. */
220212
columnview.aetheris-table > header > button {
221213
background-color: alpha(currentColor, 0.05);
222214
border-bottom: 1px solid alpha(currentColor, 0.1);
@@ -315,9 +307,6 @@ pub struct App {
315307
add_cluster_button: gtk::Button,
316308
import_cluster_button: gtk::Button,
317309
clusters_content_stack: gtk::Stack,
318-
/// State/Provider/Version/CPU/Memory/Pods snapshot per context name,
319-
/// fetched lazily the first time the Clusters page shows a given
320-
/// context and cached until the app restarts.
321310
cluster_summaries: std::collections::HashMap<String, ClusterSummaryState>,
322311
namespace_menu_button: gtk::MenuButton,
323312
namespace_selector_label: gtk::Label,
@@ -342,7 +331,6 @@ pub struct App {
342331
/// activation positions index into this model.
343332
object_sorted: gtk::SortListModel,
344333
object_columns: Vec<(ObjectTableColumn, gtk::ColumnViewColumn)>,
345-
/// Switches between the object table and the "No objects" placeholder.
346334
object_list_stack: gtk::Stack,
347335
detail_stack: gtk::Stack,
348336
detail_name_label: gtk::Label,
@@ -368,8 +356,6 @@ pub struct App {
368356
detail_conditions_list: gtk::ListBox,
369357
detail_related_pods_store: gtk::gio::ListStore,
370358
detail_related_pods_sorted: gtk::SortListModel,
371-
/// Switches the detail "Pods" tab between the pods table and an
372-
/// informational message (non-Deployment kinds, empty selector match).
373359
detail_related_pods_stack: gtk::Stack,
374360
detail_related_pods_message: adw::StatusPage,
375361
detail_log_container_dropdown: gtk::DropDown,
@@ -414,8 +400,6 @@ pub struct App {
414400
project_dialog_description: gtk::Label,
415401
project_name_entry: adw::EntryRow,
416402
project_create_button: gtk::Button,
417-
/// The project's name before this edit, when the project dialog is in
418-
/// rename mode. `None` means the dialog is creating a new project.
419403
editing_project_name: Option<String>,
420404
create_yaml_dialog: adw::Dialog,
421405
create_yaml_buffer: sourceview5::Buffer,
@@ -432,8 +416,6 @@ pub struct App {
432416
setup_button: gtk::Button,
433417
editing_cluster: bool,
434418
editing_context_name: Option<String>,
435-
/// The namespace being renamed while `rename_namespace_dialog` is open.
436-
/// `None` means the dialog is closed.
437419
renaming_namespace: Option<String>,
438420
}
439421

crates/aetheris-app/src/app/dialogs.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -273,10 +273,6 @@ pub(super) fn option_row(title: &str, subtitle: &str, icon_name: &str) -> gtk::L
273273
row
274274
}
275275

276-
/// Groups `AdwEntryRow`/`AdwPasswordEntryRow`/`AdwSwitchRow` fields into the
277-
/// standard GNOME HIG "boxed list" form container — each row carries its own
278-
/// label embedded in the top-left corner, so no separate label widget is
279-
/// needed above it.
280276
pub(super) fn entry_list(rows: &[&gtk::Widget]) -> gtk::ListBox {
281277
let list = gtk::ListBox::new();
282278
list.add_css_class("boxed-list");

crates/aetheris-app/src/app/methods.rs

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,6 @@ impl App {
1717
self.root_stack.set_visible_child_name("browser");
1818
}
1919

20-
/// Shows the Clusters page for the currently selected project: rebuilds
21-
/// the list, kicks off a background summary fetch for any context that
22-
/// doesn't have one cached yet, and switches `root_stack`. Shared by
23-
/// every path that lands on this page (picking a project, coming back
24-
/// from Browser, and after adding/editing a cluster).
2520
pub(super) fn enter_clusters_page(&mut self, sender: ComponentSender<Self>) {
2621
self.rebuild_cluster_list();
2722
self.ensure_cluster_summaries_loading(sender);
@@ -60,9 +55,6 @@ impl App {
6055
self.rebuild_cluster_list();
6156
}
6257

63-
/// Loads the clusters view for whichever project is now selected in
64-
/// `self.projects`. Shared by switching projects, deleting the current
65-
/// one (falling back to another), and duplicating one.
6658
pub(super) fn switch_to_project(&mut self, sender: ComponentSender<Self>) {
6759
if !self
6860
.visible_contexts()
@@ -110,10 +102,6 @@ impl App {
110102
}
111103
}
112104

113-
/// Columns that make sense to offer/render for the currently selected
114-
/// resource kind (e.g. "Status" is only meaningful for resources that
115-
/// expose a ready/desired ratio, like Deployments; "CPU"/"Memory" only
116-
/// for Pods and Nodes, the only kinds metrics.k8s.io covers).
117105
pub(super) fn offerable_object_columns(&self) -> Vec<ObjectColumn> {
118106
offerable_columns_for(self.selected_resource_kind())
119107
}

crates/aetheris-app/src/app/streams.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,6 @@ impl App {
269269
}
270270
session.input_tx = None;
271271
session.view.reset(true, true);
272-
session.view.feed(b"Connecting to pod terminal...\r\n");
273272

274273
let container = selected_log_container(&session.container_dropdown, &session.target)
275274
.or_else(|| default_terminal_container(&session.target))?;

crates/aetheris-app/src/app/widgets.rs

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ pub(super) fn selector_popover(list: &gtk::ListBox) -> gtk::Popover {
3636
popover
3737
}
3838

39-
/// A left-aligned icon + label row styled as a flat popover menu item.
4039
pub(super) fn menu_action_button(icon_name: &str, label: &str) -> gtk::Button {
4140
let content = gtk::Box::new(gtk::Orientation::Horizontal, 8);
4241
content.set_margin_top(6);
@@ -448,8 +447,6 @@ fn cluster_state_chip(summary: Option<&ClusterSummaryState>) -> gtk::Label {
448447
chip
449448
}
450449

451-
/// "{provider} · {version}" when loaded, dropping either half that's
452-
/// unavailable; a short status line otherwise.
453450
fn cluster_subtitle_text(summary: Option<&ClusterSummaryState>) -> String {
454451
match summary {
455452
None | Some(ClusterSummaryState::Loading) => String::from("Checking cluster…"),
@@ -579,12 +576,6 @@ pub(super) fn is_cluster_resource(resource: &ResourceKind) -> bool {
579576
)
580577
}
581578

582-
/// Columns for the Deployment detail page's "Pods" tab, which always lists
583-
/// Pods as a compact preview. Pods never have a "Status" ready/desired
584-
/// ratio, and CPU/Memory depend on metrics-server being installed (often
585-
/// not, and not worth a column that's blank for everyone when it isn't) —
586-
/// both are dropped here regardless of which resource kind the main object
587-
/// list has selected.
588579
const RELATED_POD_COLUMNS: [ObjectColumn; 3] = [
589580
ObjectColumn::Namespace,
590581
ObjectColumn::Api,
@@ -741,8 +732,6 @@ fn summary_sorter(
741732
})
742733
}
743734

744-
/// Persists user column resizes: clamps the dragged width back into range
745-
/// and forwards in-range values to the app for (debounced) saving.
746735
pub(super) fn connect_object_column_persistence(
747736
view_column: &gtk::ColumnViewColumn,
748737
table_column: ObjectTableColumn,
@@ -768,8 +757,6 @@ fn clamp_table_column_width(column: ObjectTableColumn, width: i32) -> i32 {
768757
}
769758
}
770759

771-
/// The model item type behind the main object table: an `ObjectSummary`
772-
/// boxed into a `glib::Object` so it can live in a `gio::ListStore`.
773760
pub(super) fn boxed_object(object: &ObjectSummary) -> gtk::glib::BoxedAnyObject {
774761
gtk::glib::BoxedAnyObject::new(object.clone())
775762
}
@@ -782,10 +769,6 @@ fn list_item_object(
782769
Some((item, boxed))
783770
}
784771

785-
/// Cell factory for the object table's "Name" column: optional status chip
786-
/// plus the object name. The chip's tone and presence change per object, so
787-
/// the cell content is rebuilt on each bind (only the handful of on-screen
788-
/// rows ever bind, so this stays cheap regardless of list size).
789772
pub(super) fn object_name_column_factory() -> gtk::SignalListItemFactory {
790773
let factory = gtk::SignalListItemFactory::new();
791774
factory.connect_setup(|_, item| {
@@ -822,9 +805,6 @@ pub(super) fn object_name_column_factory() -> gtk::SignalListItemFactory {
822805
factory
823806
}
824807

825-
/// Cell factory for one data column of the object table. Text columns keep
826-
/// a single label alive and only swap its text on bind; the CPU/Memory
827-
/// LevelBar cells are rebuilt per bind like the name cell.
828808
pub(super) fn object_data_column_factory(column: ObjectColumn) -> gtk::SignalListItemFactory {
829809
let factory = gtk::SignalListItemFactory::new();
830810
match column {

crates/aetheris-app/src/app/yaml.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ pub(super) fn ensure_text_tag(
3030
}
3131
}
3232

33-
/// A `sourceview5::View` configured for editing a Kubernetes manifest: line
34-
/// numbers, current-line highlight, monospace, no wrapping (long lines
35-
/// scroll horizontally instead of reflowing).
3633
pub(super) fn build_yaml_view(buffer: &sourceview5::Buffer) -> sourceview5::View {
3734
let view = sourceview5::View::with_buffer(buffer);
3835
view.set_show_line_numbers(true);
@@ -235,9 +232,6 @@ fn update_yaml_error_state(buffer: &sourceview5::Buffer, error_label: &gtk::Labe
235232
error_label.set_label(&format!("Line {line}: {message}"));
236233
}
237234

238-
/// Returns the (1-indexed) line and message of the first YAML syntax error
239-
/// in `text`, or `None` if it parses (or is blank — an empty editor isn't
240-
/// an error yet).
241235
pub(super) fn yaml_parse_error(text: &str) -> Option<(usize, String)> {
242236
if text.trim().is_empty() {
243237
return None;

crates/aetheris-kube/src/cluster.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,6 @@ use anyhow::{Context as AnyhowContext, Result};
33
use crate::{ClusterSummary, KubeSession};
44

55
impl KubeSession {
6-
/// A best-effort snapshot for the Clusters list page. Only the initial
7-
/// connectivity check (the version endpoint) is fatal; node listing,
8-
/// pod counting and metrics-server queries each degrade to `None`
9-
/// independently so a cluster without metrics-server (or with a slow
10-
/// node list) still reports as reachable.
116
/// Only the version endpoint is queried: it's a discovery call granted
127
/// to `system:authenticated` in every stock RBAC setup, unlike listing
138
/// Nodes or cluster-wide Pods, which regularly aren't (the same reason

crates/aetheris-kube/src/types.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,10 +121,7 @@ pub struct ContainerUsage {
121121
pub memory: String,
122122
}
123123

124-
/// A best-effort snapshot of a cluster used by the Clusters list page.
125-
/// Every field beyond connectivity itself is optional: metrics-server may
126-
/// not be installed, and provider detection is a heuristic guess, not an
127-
/// authoritative source.
124+
/// Version/provider data shown on the Clusters list page.
128125
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
129126
pub struct ClusterSummary {
130127
pub version: Option<String>,

0 commit comments

Comments
 (0)